Distinguishing Scripts
Each script is distinguished by a unique script code. The script codes
currently defined are in the range 0-32, although the Script Manager can support 64 scripts at the same time. The resource ID number for a script's
'itlb' resource is the same as the script code. The resource ID numbers for the
other resources associated with a script are in a range specific to that script.
For Roman, this range is 0-16383. Scripts with script codes in the range
1-32 have a range of 512 resource ID numbers beginning at 16384 + 512 *
(script code - 1). Scripts with script codes in the range 33-64 have a range
of 512 resource ID numbers beginning at -32768 + 512 * (script code
-33). For example, the script code for Korean is 3, so Korean resources have
resource IDs in the range 17408-17919. The Figure below illustrates the
font ranges for the Roman, Japanese, and Devanagari scripts. A full table of
Note: Some script codes above 32 are not usable because they
correspond to resource ID ranges that are reserved for other
purposes. Script codes 33 through 40 are in valid; furthermore,
script codes above 48 are currently unavailable and may become
in valid.
Distinguishing scripts with resource ID ranges for script codes 0-32
The font used for text indicates the script for that text. A text string in a font
with a 'FOND' resource ID of 200 is interpreted as Roman text, while the same
text string in a font whose 'FOND' ID is 18432 is interpreted as Hebrew text
and displayed accordingly. The meaning of each character code depends on the
font. In an Arabic font, the code 0xCC represents the character
(jiim), while in a Roman font, the code 0xCC represents the character . However,
character codes 0x00 through 0x7F are always interpreted the same
way-except when they are the second byte of a double-byte character ( codes
0x00 through 0x1F are never the second byte of a double-byte character). For
historical reasons within the Chinese and Roman Script Systems, even within a
given script, the meaning of character codes may depend on the font: the
Symbol font is in the Roman script range, but character codes in the Symbol
font have a different meaning from the same character codes in the Geneva font.
This situation now only occurs in the Roman Script System. The Traditional
Chinese and Simplified Chinese Script Systems are different script systems
and use different character set encodings, but until recently they shared the
same script code.
There is an additional consideration for 'FOND' resource IDs. The special
'FOND' resource IDs 0 and 1 specify the Macintosh system font and the default
application font and do not necessarily indicate a Roman font and the Roman
Script System. On Roman script systems, the Chicago font is the system font,
and it has a 'FOND' ID of 0. On non-Roman script systems, Chicago has a
different 'FOND' ID (usually 16383), and 'FOND' ID 0 is mapped to the system
font for the appropriate non-Roman system. On the Japanese Script System,
for example, 'FOND' ID 0 is mapped to the Osaka font, which has a 'FOND' ID of
16384.
The script can be determined by just the 'FOND' ID. Therefore, even when an
entire font family is missing, the Font Manager can still substitute a font of the same script.
Warning: If a non-Roman font has a 'FOND' ID with an ID in the Roman
range, it will not be handled correctly.