To assign Windows CharSet id to OS/2 font, the Open32 NLS Extension refers to the following information.
Note: Checking the type of fonts may take some overhead. To have enough performance, the Open32 NLS Extension manages the list of fonts internally and keeps Windows CharSet ids in the list. The GpiQueryFontAction OS/2 function will be used to keep the li updated.
Symbol Fonts
The symbol font contains symbolic (pictorial) glyphs. Because the symbol font is never used for scripting text, it does not have other CharSet ids than SYMBOL_CHARSET.
SYMBOL_CHARSET : Symbol Font (Exclusive)
sFamilyClass = Symbolic (0x000C). SubClass (0x??00) can be vary.szFamilyName contains the string "Symbol" (for backward compatibility).
Fonts for Scripting Text (for GUI Applications - Windows ANSI CharSet)
If a font is not the symbol font, the font is for scripting text. The font in this category contains known set of glyphs in know order. An OS/2 UGL font supports more than one Windows ANSI CharSet. The Open32 NLS Extension returns all possible Window s ANSI CharSets for each OS/2 UGL font.
ANSI_CHARSET : U.S. and Western Europe Font
GlyphListName = "PM383", or "UNICODE" GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS GlyphListName = NULL, and usCodePage = 1252 (U.S. and Western Europe Only)
EASTEUROPE_CHARSET : Eastern Europe Font
GlyphListName = "PM383", or "UNICODE" GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS GlyphListName = NULL, and usCodePage = 1250 (Eastern Europe Only)
TURKISH_CHARSET : Turkish Font
GlyphListName = "PM383", or "UNICODE" GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS GlyphListName = NULL, and usCodePage = 1254 (Turkish Only)
RUSSIAN_CHARSET : Russian Font
GlyphListName = "UNICODE" GlyphListName = "PM383", and sLastChar >= 504 GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS, and sLastChar > =504 GlyphListName = NULL, and usCodePage = 1251 (Cyrillic Only)
GREEK_CHARSET : Greek Font
GlyphListName = "UNICODE" GlyphListName = "PM383", and sLastChar >= 504 GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS, and sLastChar > =504 GlyphListName = NULL, and usCodePage = 1253 (Greek Only)
HEBREW_CHARSET : Hebrew Font
GlyphListName = "UNICODE" GlyphListName = "PM383", and sLastChar >= 504 GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS, and sLastChar > =504 GlyphListName = NULL, and usCodePage = 1255 (Hebrew Only)
ARABIC_CHARSET : Arabic Font
GlyphListName = "UNICODE" GlyphListName = "PM383", and sLastChar >= 504 GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS, and sLastChar > =504 GlyphListName = NULL, and usCodePage = 1256 (Arabic Only)
BALTIC_CHARSET : Baltic Font
GlyphListName = "UNICODE" GlyphListName = "PM383", and sLastChar >= 504 GlyphListName = NULL, and usCodePage = 0, fsType != FM_TYPE_MBCS, and sLastChar > =504 GlyphListName = NULL, and usCodePage = 1257 (Baltic Only)
THAI_CHARSET : Thai Font
GlyphListName = "UNICODE" GlyphListName = NULL, and usCodePage = 874 (Thai Only)
SHIFTJIS_CHARSET : Japanese Font
GlyphListName = "UNICODE" GlyphListName = "PMJPN" (Japanese + UGL) GlyphListName = NULL, usCodePage = 0, fsType = FM_TYPE_MBCS, and SystemCp = 932, 942 or 943 (Japanese + UGL) GlyphListName = NULL, and usCodePage = 932, 942 or 943 (Japanese Only)
HANGEUL_CHARSET : Hangeul (Wansung) Font
GlyphListName = "UNICODE" GlyphListName = "PMKOR" or "PMKS" (Hangeul + UGL) GlyphListName = NULL, usCodePage = 0, fsType = FM_TYPE_MBCS, and SystemCp = 949 (Hangeul + UGL) GlyphListName = NULL, and usCodePage = 949 (Hangeul Wansung Only)
JOHAB_CHARSET : Hangeul (Johab) Font
GlyphListName = "UNICODE" (if Codepage 1361 is supported by PMWIN) GlyphListName = NULL, and usCodePage = 1361 (Hangeul Johab Only)
CHINESEBIG5_CHARSET : Traditional Chinese Font
GlyphListName = "UNICODE" GlyphListName = "PMTWN" or "PMBIG5" (T-Chinese + UGL) GlyphListName = NULL, usCodePage = 0, fsType = FM_TYPE_MBCS, and SystemCp = 950 (T-Chinese + UGL) GlyphListName = NULL, and usCodePage = 950 (T-Chinese Only)
GB2312_CHARSET : Simplified Chinese Font
GlyphListName = "UNICODE" GlyphListName = "PMPRC" or "PMGB" (S-Chinese + UGL) GlyphListName = NULL, usCodePage = 0, fsType = FM_TYPE_MBCS, and SystemCp = 1381 (S-Chinese + UGL) GlyphListName = NULL, and usCodePage = 1381 (S-Chinese Only)
Note: SystemCp (System Default Codepage) should be obtained with GetLocaleInfo Open32 function with LOCALE_IDEFAULTANSICODEPAGE for LOCALE_SYSTEM_DEFAULT.
Fonts for Scripting Text (for Base Operating System - Windows OEM CharSet)
The base operating system may use the different CharSet from the ones used by GUI applications. In Windows the CharSet used by file system, text console and some other purposes is categorized as OEM CharSet. The OS/2 PM applications also have used this OEM CharSet for drawing text. To keep backward compatibility, the Open32 NLS Extension returns one OEM CharSet for each OS/2 UGL font.
OEM_CHARSET : CharSet for Windows OEM Codepages
If the SystemOEMCp is one of SBCS codepage, and:
GlyphListName = "PM383", "PMJPN", "PMKOR", "PMKS", "PMTWN", "PMBIG5", "PMPRC" , "PMGB" or "UNICODE" GlyphListName = NULL, and usCodePage = 0 GlyphListName = NULL, and usCodePage = SystemOEMCp
OEM_CHARSET : CharSet for Windows ANSI/OEM Common Codepages
If one of following:
ANSI CharSet = THAI_CHARSET, and SystemOEMCp = 874 ANSI CharSet = SHIFTJIS_CHARSET, and SystemOEMCp = 932, 942 or 943 ANSI CharSet = HANGEUL_CHARSET, and SystemOEMCp = 949 ANSI CharSet = JOHAB_CHARSET, and SystemOEMCp = 1361 ANSI CharSet = CHINESEBIG5_CHARSET, and SystemOEMCp = 950 ANSI CharSet = GB2312_CHARSET, and SystemOEMCp = 936 (Windows GB codepage, not OS/2 GB codepage)
Note: SystemOEMCp (System OEM Codepage) should be obtained with GetLocaleInfo Open32 function with LOCALE_IDEFAULTCODEPAGE for LOCALE_SYSTEM_DEFAULT.
Fonts for Scripting Text (of Uncertain CharSet)
If the font is none of above, the fonts contains uncertain set of glyphs in uncertain order. In this case, the font should be categorized as device / platform dependent OEM CharSet.
OEM_CHARSET : OEM Font (None of above)
GlyphListName = NULL, and usCodePage = any