Mega Code Archive

 
Categories / Delphi / Examples
 

Display a form and its controls with croatian font

Windows uses a number of character sets (not to be confused with fonts) to handle foreign language characters. The widely used ANSI_CHARSET holds the characters of the old 7 bit ASCII set plus those used in most Western European countries. But there are others: BALTIC_CHARSET CHINESEBIG5_CHARSET EASTEUROPE_CHARSET GB2312_CHARSET GREEK_CHARSET HANGUL_CHARSET MAC_CHARSET OEM_CHARSET RUSSIAN_CHARSET SHIFTJIS_CHARSET SYMBOL_CHARSET TURKISH_CHARSET Some of these apply to multi byte character sets (MCBS), some, like EASTEUROPE_CHARSET are for 1-byte character sets but they have different glyphs for the character codes above 127. You can select a specific character set by assigning one of these constants to a TFont.Charset property. But it depends on the Windows platform (and the language version) you are using whether that will change anything. It also depends on the font, not all fonts have multiple character set mappings build in. The alternative (NT only) would be UNICODE fonts. However, the standard VCL controls have no support for UNICODE (they would not work on Win9x if they had).