Where goest my True Type fonts?

By Richard K. Goran

WIN-ATM Object Setting
Many OS/2 users have found that they can no longer use their True Type fonts under OS/2. The remedy is very simple - just change the WIN_ATM setting in the Settings notebook for the WIN-OS/2 object in question. The OS/2 Warp default is to have WIN_ATM set to off as shown in Figure 1. If there are just one or two objects that require this setting to be changed, it is not a very time consuming nor difficult task to make these changes. However, if you have vary many of these WIN-OS/2 program objects, it could be a laborious task to change each of these objects manually. This is the tie-in between these object's settings and this column which is primarily devoted to REXX. This column may get a little more technical than many of you would like; however, the end result will provide you with the knowledge and the capability to create your own REXX program to enable the WIN_ATM setting for all of your WIN-OS/2 program objects. If the details bore you, you can simply download the finished product (winatmon.zip) and run it on your system.

REXXUTIL, the function package that is part of the standard OS/2 REXX package and contains all of the commonly known functions that begin with Sys provides the capability to create and modify Workplace Shell (WPS) objects but has no ability to query objects about their settings or other properties. This shortcoming was overcome by the DeskMan/2 commercial product but DeskMan/2 was not intended as a user Application Program Interface (API) to allow the user to interrogate WPS objects from within his own REXX programs. Fortunately, there is an API written by Henk Kelder of the Netherlands and available free of charge which provides that capability. Kelder's package is available on most OS/2 repositories, including [this site], as file wptool19.zip.

One other capability that is needed is the ability to reference WPS objects by their handle (a persistent object identity whose explanation goes beyond the scope of this column). This function is provided in the [REXXLIB API] from Quercus Systems.

The REXXUTIL functions require that all object manipulation be done with reference to an object ID or the full file system name for file system objects (directories and files). An object ID is a string of characters bounded by less than (<) and greater than (>) characters respectively and normally assigned to a WPS object when that object is created. If a non-file system object - an abstract object - is created without an object ID, the standard REXXUTIL functions cannot be used to reference that object. However, all objects have a persistent identity known as the object's handle. The REXXLIB extensions provide the capability to alter an object's settings by referencing the object by its handle - even to the point of allowing an object ID to be assigned to any object previously created without one. Most of the WPS objects for WIN-OS/2 programs fall into this category - they were created with an object ID.

Overall steps
The APIs that are required are included in the files rexxutil.dll, rexxlib.dll, and wptools.dll. They are registered using the built-in REXX RxFuncAdd function (Fragment 1). These DLLs must be in a directory that is named in LIBPATH statement in config.sys, reside in a directory named in a BeginLibPath or EndLibPath environment variable, or reside in the same directory of the calling program (presuming that ".;" is included in the LIBPATH statement).

An output file is defined so that a record can be made of all of the WIN-OS/2 objects that are changed. The output file name is built from the path and file name of the calling program with a file extension of TXT - winatmon.txt.

All WIN-OS/2 objects will have a program type selected from one of the following types: PROG_31_ENH, PROG_31_ENHSEAMLESSCOMMON, PROG_31_ENHSEAMLESSVDM, SEPARATEWIN, WIN, WINDOWEDWIN. By interrogating all of the WPS program objects that are included in the PM_Abstract:Objects section of the os2.ini file, ignoring those that do not have a PROGTYPE= value included in the above list, we are left with all of the WIN-OS/2 program objects ([#Fragment 2 Fragment 2]).

Ignoring those objects that already have a setting of WIN_ATM=1;, we are left with only those objects that are to be modified. Since we have the object's handle from the data retrieved from the os2.ini file, and REXXLIB has been extended to allow an object's setup string to be altered simply by using the file's object handle as its identifier, we simply have to supply a setup string of WIN_ATM=1; to effect the desired change ([#Fragment 3 Fragment 3]).