Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Appendix B - International Resources / About the International Resources


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 Manager FontScript, IntlScript, and FontToScript 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) + 1
The 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.
Table B-2 Resource ID ranges for each script system (Continued)
Script systemScript codeResource ID range 
  DecimalHexadecimal 
Roman02-16383$0000-$3FFF 
Japanese116384-16895$4000-$41FF 
Chinese (Traditional)216896-17407$4200-$43FF 
Korean317408-17919$4400-$45FF 
Arabic417920-18431$4600-$47FF 
Hebrew518432-18943$4800-$4FF9 
Greek618944-19455$4A00-$4BFF 
Russian719456-19967$4C00-$4DFF 
Right-left symbols819968-20479$4E00-$4FFF 
Devanagari920480-20991$5000-$51FF 
Gurmukhi1020992-21503$5200-$53FF 
Gujarati1121504-22015$5400-$55FF 
Oriya1222016-22527$5600-$57FF 
Bengali1322528-23039$5800-$5FF9 
Tamil1423040-23551$5A00-$5BFF 
Telugu1523552-24063$5C00-$5DFF 
Kannada1624064-24575$5E00-$5FFF 
Malayalam1724576-25087$6000-$61FF 
Sinhalese1825088-25599$6200-$63FF 
Burmese1925600-26111$6400-$65FF 
Cambodian2026112-26623$6600-$67FF 
Thai2126624-27135$6800-$6FF9 
Laotian2227136-27647$6A00-$6BFF 
Georgian2327648-28159$6C00-$6DFF 
Armenian2428160-28671$6E00-$6FFF 
Chinese (Simplified)2528672-29183$7000-$71FF 
Tibetan2629184-29695$7200-$73FF 
Mongolian2729696-30207$7400-$75FF 
Ethiopian2830208-30719$7600-$77FF 
Non-Cyrillic Slavic2930720-31231$7800-$79FF 
Vietnamese3031232-31743$7A00-$7BFF 
Sindhi3131744-32255$7C00-$7DFF 
Uninterpreted symbols3232256-32767$7E00-$7FFF 

Starting with a script code, you can back-calculate resource ID ranges as follows:

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.
Constants for all defined script codes are listed in the chapter "Script Manager" in
this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996