KazFont - free programmer font for Windows
5. Flexible encoding selection
If you do not mix language families, you do not need enhanced functionalities of KazFont. But today's software market is international, so sooner or later you will encounter some issues.
The ultimate solution for the following troubles would be to use only Unicode or UTF-8 files and some TrueType font. Unfortunately many compilers do not accept Unicode source files, so usually we use files encoded in any of 8 bit encoding.
Every font name contain bitmaps for both Western (CP1252) and Central European (CP1250) encodings. You can choose font script (encoding) through Font Common Dialog.
Why UTF8 and Hex fonts have two encodings ?
There is advanced setting named "Language for non-Unicode programs in "Regional and Language Options" item in the Control Panel. This is the same as preffered encoding of the language.
The system match this preffered encoding with the encoding of the actual font. If a character in preffered encoding isn't available in the font encoding, magic value 7F appears. In the table below you can see the result of this matching while displaying the same ASCII text using different encodings:
Analogous effect occurs in UTF8 and Hex fonts. Here the magic value is 5F.
When using TrueType Unicode font, you will also get wrong results. Characters belong to the language of the preffered encoding no matter which script is used:
Here is the example of multilanguage problem. We have two words in Icelandic and in Polish. The languages belong to different encodings. How do this words appear in the editor ?
To make things worse, many editors do not present an option to choose the font script. Some editors do not tolerate any font encoding other than Western.
To resolve this issues and to give full control of the encoding, KazFontPlus has been created.
5a. KazFontPlus.fon - the enhanced solution
Every font name contains bitmap for only one encoding, according to the name. You can choose font script (encoding) by choosing the font name. The font encoding information, built into the font, can be different than the real encoding.
When using KazFontPlus enhanced fonts, simple choose the font according to your preffered encoding and actual text encoding.
Copyright © 2004-2013 Omega Computer