Important: The information in this document is obsolete and should not be used for new development.
Script Codes and Resource ID Ranges
Fonts, international resources, and keyboard resources that are related to a particular script system have resource ID numbers in a range specific to that script. The script management system uses this relationship between resource ID and script code to assign the proper resources for displaying and formatting text. For example, the Script ManagerFontScript
,IntlScript
, andFontToScript
functions all use a font family ID to determine the script code that they return. Many other Script Manager, Text Utilities, and QuickDraw routines that load and use international resources take an explicit or implicit script code parameter; they will load only resources with ID numbers in the proper range for the supplied script code.This numbering convention applies to font family IDs, and to the ID numbers of the following international and keyboard resources:
'itl0'
,'itl1'
,'itl2'
,'itl4'
,'itl5'
,'trsl'
,'KCHR'
,'itlk'
,'kcs#'
,'kcs4'
, and'kcs8'
.Resources with ID numbers below 16384 ($4000) belong to the Roman script system. Currently, the script management system uses the following formula to calculate the script code for resources with ID numbers of 16384 and over:
scriptCode = ((resourceID - 16384) DIV 512) + 1The formula allots half of the range of nonnegative ID values to the Roman script system, and 512 ID numbers (for each resource type) to each other script system, as shown in Table B-2. Please note that this formula may change in the future; note also that future script systems may possibly use negative ID values.Starting with a script code, you can back-calculate resource ID ranges as follows:
- Scripts with script codes in the range 1-32 have a range of 512 resource ID numbers, beginning with a number calculated according to this formula:
firstID = 16384 + 512 * (script code - 1)- Scripts with script codes in the range 33-64 have a range of 512 resource ID numbers, beginning with a number calculated according to this formula:
firstID = -32768 + 512 * (script code -33)
Constants for all defined script codes are listed in the chapter "Script Manager" in
- 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 invalid; furthermore, script codes above 48 are currently unavailable and may become invalid.
this book.