none
GDI+ font issue in Windows Server 2008 R2 Operating System RRS feed

  • Question

  • Hi,

    I have installed the "Minion Pro" OTF font in the machine and the font exists in the "C:\Windows\Fonts" folder but unable to create System.Drawing.Font instance for "Minion Pro" font.

    Please find the code snippet:

    System.Drawing.Font minionPro = new System.Drawing.Font("Minion Pro", 12);
            if(minionPro.Name !=  "Minion Pro")
                minionPro = new System.Drawing.Font("Minion Pro Regular", 12);

    The above code returns the "Microsoft Sans Serif" the default font in Windows Server 2008 R2. And in Windows 10 OS, this code returns "Minion Pro" as expected. So this problem occurs specific to Windows Server 2008 R2.

    Can anyone help on this, how to retrieve the fonts properly in Windows 2008 R2?
    Is there any known limitation?



    Thanks,

    Mohanaselvam



    Thursday, November 8, 2018 1:12 PM

All replies

  • It's because "Microsoft Sans Serif" is created if the font family cannot be created.

    Not sure what format does this Adobe font use, but according to Wikipedia:

    While Microsoft originally supported only the COLR/CPAL color format, support for all of the different color formats, including Apple's 'sbix' format, was added to Microsoft Windows in the Windows 10 Anniversary Update.[21] The 'sbix' table was subsequently added to OpenType in version 1.8.[17]

    Since Win2008R2 uses the same kernel as Win7, maybe this font indeed is not supported there.

    P.S.: You may also what to take a look on this thread for troubleshooting Adobe font install issues on Win7.
    Friday, November 9, 2018 3:01 AM
    Answerer