Microsoft KB Archive/65586

INF: Sample PM Program That Shows How to Select and Set Fonts PSS ID Number: Q65586 Article last modified on 09-09-1991 PSS database name: P_PresMan

1.21

OS/2

Summary:

In the Software/Data Library is an archived file named SMFCODE that contains the files necessary to build a program that will demonstrate how to use the Presentation Manager (PM) font system.

SMFCODE can be found in the Software/Data Library by searching on the word SMFCODE, the Q number of this article, or S12696. SMFCODE was archived using the PKware file-compression utility.

This program was written to dynamically set the FATTRS structure prior to calling GpiCreateLogFont, to change the CHARBUNDLE of a PS (presentation space), and to see the resulting FONTMETRICS structure and its output. As such, it is intended to be a straightforward layer between the user and the font display system. The program does not protect against system RIPs, nor does it ensure logical results.

To use the program for the first time, press each of the three buttons, starting at the bottom and working up. The Select Font option will bring up a screen listing of all the currently installed public fonts. Select one of the fonts using the left mouse button. This will set the face name and lMatch values in the FATTRS structure. The Create Logical Font option will take these FATTRS values and create a logical font that is displayed in the upper-left, gray window.

The FONTMETRICS values for this logical font are displayed in the scrollable window below it. The Set Char Bundle option will read the values out of the char bundle window and set them for the PS used in the gray test window. The values in the FATTRS structure or CHARBUNDLE window can be changed at any time; however, this has an effect only when one of the two aforementioned buttons is pressed.

Copyright Microsoft Corporation 1991.