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 /
Chapter 6 - Script Manager / Using the Script Manager


Testing for the Script Manager and Script Systems

This section describes how to use the Gestalt function to test for the current version of the Script Manager and the number of active script systems. For details on the Gestalt function, see the Gestalt Manager chapter of Inside Macintosh: Operating System Utilities.

The Operating System initializes the Script Manager at startup. The Script Manager then initializes the Roman script system. Next the Script Manager initializes any other installed 1-byte simple script system whose smsfAutoInit bit (see page 6-69) is set. The Script Manager then allows the script extensions WorldScript I and WorldScript II (if present) to initialize all installed 1-byte complex and 2-byte script systems.

When initializing a script system, the Script Manager or script extension first checks to make sure that there is enough memory for the script system, and then checks that an international bundle resource is present in the System file and that at least one font in the proper ID range for that script system is present in the System file or in the Fonts folder. If these resources are present, the script system is considered to be enabled (available for use by the Script Manager and applications). If the required resources are not available, the script system remains disabled.

Note
The Script Manager is fully loaded and all script systems are enabled before any files of type 'INIT' in the Extensions folder are launched. Thus, all Script Manager routines can be called from system extensions.
Use Gestalt with the gestaltScriptMgrVersion selector to obtain a result in the response parameter that identifies the version number of the Script Manager. This is the same value returned by a call to the GetScriptManagerVariable function with the selector constant smVersion. Table 6-1 on page 6-6 lists some of the routines and features available with the principal versions of the Script Manager.

Table 6-2 gives more detail on the version numbers returned by Gestalt or by GetScriptManagerVariable with the selector smVersion, for all versions of system software and all versions of the Script Manager. It also shows the Roman script system versions returned by the GetScriptVariable function with the selector smScriptVersion.
Table 6-2 Version numbers for the Script Manager and Roman script system
System software versionScript Manager
(newer ROMs)
Script Manager
(older ROMs)
Roman
script system
6.0.3 and earlierN.A.<= $20F<= $101
6.0.4 Roman$215$211$101
6.0.4 non-Roman$216$212$101
6.0.5 all$217 ( = 2.23)$213$101
Above this line, minor version numbers are binary; below, they are BCD:
6.0.7 all[4]$231 ( = 2.3.1)$230$101
J-6.0.7.1 (Japanese)[5]$231$230$101
6.0.8 all$231$230$101
6.1 (non-Roman)$241$240$101
7.0$700$700$700
7.0.1 Roman$700$700$700
7.0.1 non-Rman$701$701$701
7.1$710$710$710

Note
In versions of system software earlier than 6.0.7, the major and minor version numbers are each treated as if they were binary. Thus a result of $217 from Gestalt means a Script Manager version of 2.23 (in decimal). Starting with system 6.0.7, version numbers are returned as binary-coded decimal numbers, so a result of $710 means a Script Manager version of 7.10 (or 7.1.0).
Use the Gestalt selector gestaltScriptCount to obtain a result in the response parameter that gives the number of active script systems. This is the same value returned by a call to the GetScriptManagerVariable function with the smEnabled selector.

Obtaining the number of active script systems is most useful for testing whether
more than a single script system is present. If the result is 1, only the Roman script system is present and text-handling is simplest. If the result is greater than 1, at
least one non-Roman script system is present, and your application needs to be able to handle its text.


[4] Gestalt actually returns $606 as the system version for non-Roman versions of system 6.0.7.
[5] Gestalt actually returns $609 as the system version for system J-6.0.7.1.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996