Search code examples
localedirectwrite

Issue with IDWriteFont::GetInformationalStrings(...) on Windows 7 (Japanese system locale)


I am using IDWriteFont::GetInformationalStrings(...) to get the full name of a font on Windows 7 (Japanese locale ja-JP) and here is the issue :

When i pass DWRITE_INFORMATIONAL_STRING_FULL_NAME or DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME as the DWRITE_INFORMATIONAL_STRING_ID, I get exists=false and no IDWriteLocalizedStrings are returned (for any font on the system).

However, the corresponding entries exist in the name Table in the fonts and the IDWriteFont::GetInformationalStrings(...) call works fine for the same fonts on Win 7 (en-us locale).

//works when system locale is en-us; exists=true
//does not work when system locale is ja-JP; exists=false; pFontNames=NULL
hr = pFont->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_FULL_NAME, &pFontNames, &exists);

Can anyone please tell me whether or not this is an issue with DirectWrite.

Thanks.


Solution

  • I had raised a bug with Microsoft and here is the resolution they provided :

    [Symptom] Calling IDWriteFont::GetInformationalStrings() with DWRITE_INFORMATIONAL_STRING_FULL_NAME or DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME returns exists == FALSE on some machines.

    [Cause] DWRITE_INFORMATIONAL_STRING_FULL_NAME and DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME were introduced in Windows 8. For this to work, you need to have the platform update for Windows 7 (https://support.microsoft.com/en-us/kb/2670838) installed on Windows 7 systems.

    [Resolution] Installing the platform update resolved the issue.