Font-metrics structure: Difference between revisions

From OS2World.Com Wiki
Jump to navigation Jump to search
Jugbogdan (talk | contribs)
mNo edit summary
Jugbogdan (talk | contribs)
m Presentation Manager Bit Map Fonts: clean out copy-n-pasted stupid garbage
Line 152: Line 152:
|Courier||Courier|| || || || ||?6x48
|Courier||Courier|| || || || ||?6x48
|-
|-
| || || || || ||?0||96x72
|...
|-
| || || || || ||?3||96x96
|-
| || || || || ||?6||120x120
|-
| || ||?0|| || ||96x48
|-
| || || || || ||?2||96x72
|-
| || || || || ||?6||96x96
|-
| || || ||?2||?2||?0||120x120
|-
| || ||?2||?2||?2||?0||96x48
|-
| || ||?2||?2||?5||96x72
|-
| || ||?2||?2||?0||96x96
|-
| || ||?5||?5||?5||120x120
|-
|System Proportional||System Proportional|| || ||0|| ||96x48
|-
| || ||?0|| ||?0||?2||96x96
|-
|      ?              ?0    ?      ?0    ?6    96x96
|-
|      ?              ?0    ?      ?3    ?0    120x120
|-
|      ?              ?1    ?0    ?3    ?3    120x120
|-
|System Monospaced||System Monospaced|| || || || ||?6x48
|-
|      ?              ?0    ?      ?      ?2    ?6x72
|-
|      ?              ?0    ?      ?      ?6    ?6x96
|-
|      ?              ?0    ?      ?      ?0    ?20x120?
|-
|Helv||Helv|| || ||?3|| ||?6x48
|-
|      ?              ?      ?      ?3    ?0    ?6x72
|-
|      ?              ?      ?      ?3    ?3    ?6x96
|-
|      ?              ?      ?      ?4    ?6    ?20x120
|-
|      ?              ?0    ?      ?5    ?    ?6x48
|-
|      ?              ?      ?      ?4    ?2    ?6x72
|-
|      ?              ?      ?      ?4    ?6    ?6x96
|-
|      ?              ?      ?      ?0    ?0    ?20x120
|-
|      ?              ?2    ?      ?7    ?0    ?6x48
|-
|      ?              ?      ?      ?7    ?5    ?6x72
|-
|      ?              ?      ?      ?7    ?0    ?6x96
|-
|      ?              ?      ?      ?1    ?5    ?20x120
|-
|      ?              ?4    ?      ?1    ?2    ?6x48
|-
|      ?              ?      ?      ?1    ?8    ?6x72
|-
|      ?              ?      ?      ?1    ?4    ?6x96
|-
|      ?              ?      ?1    ?6    ?9    ?20x120
|-
|      ?              ?8    ?1    ?6    ?5    ?6x48
|-
|      ?              ?      ?0    ?6    ?2    ?6x72
|-
|      ?              ?      ?1    ?6    ?9    ?6x96
|-
|      ?              ?      ?3    ?4    ?6    ?20x120
|-
|      ?              ?4    ?4    ?5    ?9    ?6x48
|-
|      ?              ?      ?4    ?5    ?8    ?6x72
|-
|      ?              ?      ?4    ?5    ?7    ?6x96
|-
|      ?              ?      ?8    ?5    ?6    ?20x120
|-
|Tms Rmn||Tms Rmn|| || ||?2|| ||?6x48
|-
|      ?              ?      ?      ?3    ?0    ?6x72
|-
|      ?              ?      ?      ?2    ?3    ?6x96
|-
|      ?              ?      ?      ?4    ?6    ?20x120
|-
|      ?              ?0    ?      ?5    ?    ?6x48
|-
|      ?              ?      ?      ?4    ?2    ?6x72
|-
|      ?              ?      ?      ?4    ?6    ?6x96
|-
|      ?              ?      ?      ?9    ?0    ?20x120
|-
|      ?              ?2    ?      ?8    ?0    ?6x48
|-
|      ?              ?      ?      ?8    ?5    ?6x72
|-
|      ?              ?      ?      ?6    ?9    ?6x96
|-
|      ?              ?      ?      ?3    ?3    ?20x120
|-
|      ?              ?4    ?      ?1    ?1    ?6x48
|-
|      ?              ?      ?      ?1    ?6    ?6x72
|-
|      ?              ?      ?      ?0    ?1    ?6x96
|-
|      ?              ?      ?0    ?6    ?7    ?20x120
|-
|      ?              ?8    ?0    ?6    ?4    ?6x48
|-
|      ?              ?      ?0    ?6    ?0    ?6x72
|-
|      ?              ?      ?0    ?6    ?7    ?6x96
|-
|      ?              ?      ?2    ?4    ?3    ?20x120
|-
|      ?              ?4    ?4    ?5    ?8    ?6x48
|-
|      ?              ?      ?3    ?5    ?6    ?6x72
|-
|      ?              ?      ?3    ?5    ?5    ?6x96
|-
|      ?              ?      ?6    ?6    ?3    ?20x120
|}
|}



Revision as of 00:38, 16 January 2026

This structure is returned to applications on the GpiQueryFonts and GpiQueryFontMetrics calls and conveys information from the font creator to the application.

typedef struct _FONTMETRICS {
CHAR     szFamilyname[FACESIZE];  /*  Family name. */
CHAR     szFacename[FACESIZE];    /*  Face name. */
USHORT   idRegistry;              /*  Registry identifier. */
USHORT   usCodePage;              /*  Code page. */
LONG     lEmHeight;               /*  Em height. */
LONG     lXHeight;                /*  X height. */
LONG     lMaxAscender;            /*  Maximum ascender. */
LONG     lMaxDescender;           /*  Maximum descender. */
LONG     lLowerCaseAscent;        /*  Lowercase ascent. */
LONG     lLowerCaseDescent;       /*  Lowercase descent. */
LONG     lInternalLeading;        /*  Internal leading. */
LONG     lExternalLeading;        /*  External leading. */
LONG     lAveCharWidth;           /*  Average character width. */
LONG     lMaxCharInc;             /*  Maximum character increment. */
LONG     lEmInc;                  /*  Em increment. */
LONG     lMaxBaselineExt;         /*  Maximum baseline extent. */
SHORT    sCharSlope;              /*  Character slope. */
SHORT    sInlineDir;              /*  Inline direction. */
SHORT    sCharRot;                /*  Character rotation. */
USHORT   usWeightClass;           /*  Weight class. */
USHORT   usWidthClass;            /*  Width class. */
SHORT    sXDeviceRes;             /*  X-device resolution. */
SHORT    sYDeviceRes;             /*  Y-device resolution. */
SHORT    sFirstChar;              /*  First character. */
SHORT    sLastChar;               /*  Last character. */
SHORT    sDefaultChar;            /*  Default character. */
SHORT    sBreakChar;              /*  Break character. */
SHORT    sNominalPointSize;       /*  Nominal point size. */
SHORT    sMinimumPointSize;       /*  Minimum point size. */
SHORT    sMaximumPointSize;       /*  Maximum point size. */
USHORT   fsType;                  /*  Type indicators. */
USHORT   fsDefn;                  /*  Definition indicators. */
USHORT   fsSelection;             /*  Selection indicators. */
USHORT   fsCapabilities;          /*  Font capabilities. */
LONG     lSubscriptXSize;         /*  Subscript x-size. */
LONG     lSubscriptYSize;         /*  Subscript y-size. */
LONG     lSubscriptXOffset;       /*  Subscript x-offset. */
LONG     lSubscriptYOffset;       /*  Subscript y-offset. */
LONG     lSuperscriptXSize;       /*  Superscript x-size. */
LONG     lSuperscriptYSize;       /*  Superscript y-size. */
LONG     lSuperscriptXOffset;     /*  Superscript x-offset. */
LONG     lSuperscriptYOffset;     /*  Superscript y-offset. */
LONG     lUnderscoreSize;         /*  Underscore size. */
LONG     lUnderscorePosition;     /*  Underscore position. */
LONG     lStrikeoutSize;          /*  Strikeout size. */
LONG     lStrikeoutPosition;      /*  Strikeout position. */
SHORT    sKerningPairs;           /*  Kerning pairs. */
SHORT    sFamilyClass;            /*  Font family design classification. */
LONG     lMatch;                  /*  Matched font identity. */
LONG     FamilyNameAtom;          /*  Font family name atom. */
LONG     FaceNameAtom;            /*  Font facename atom. */
PANOSE   panose;                  /*  Panose font descriptor. */
 } FONTMETRICS;

typedef FONTMETRICS *PFONTMETRICS;

Font-attributes structure.

typedef struct _FATTRS {
USHORT   usRecordLength;        /*  Length of record. */
USHORT   fsSelection;           /*  Selection indicators. */
LONG     lMatch;                /*  Matched-font identity. */
CHAR     szFacename[FACESIZE];  /*  Typeface name. */
USHORT   idRegistry;            /*  Registry identifier. */
USHORT   usCodePage;            /*  Code page. */
LONG     lMaxBaselineExt;       /*  Maximum baseline extension. */
LONG     lAveCharWidth;         /*  Average character width. */
USHORT   fsType;                /*  Type indicators. */
USHORT   fsFontUse;             /*  Font-use indicators. */
 } FATTRS;

typedef FATTRS *PFATTRS;

The following table lists the full character set in the order in which the characters occur in the multi-code-page font. Characters are listed in order of their universal glyph list (UGL) number; the graphic character global identifier (GCGID) and a description of each character are also given.

UGL GCGID Description
0 ?S000000 smiling face
1 ?S010000 smiling face, reverse image
2 ?S020000 heart suit symbol
3 ?S030000 diamond suit symbol
4 ?S040000 club suit symbol
5 ?S050000 spade suit symbol
...

OS/2* outline fonts and Presentation Manager* bit map fonts are supplied by the operating system.

OS/2 Outline Fonts

The following Adobe** Type 1 fonts are supplied with OS/2:

Family Name Face Name
Times New Roman*
Times New Roman
Times New Roman Bold
Times New Roman Bold Italic
Times New Roman Italic
Helvetica*
Helvetica
Helvetica Bold
Helvetica Bold Italic
Helvetica Italic
Courier
Courier
Courier Bold
Courier Bold Italic
Courier Italic
Symbol
Symbol

The Courier, Tms Rmn, and Swiss family fonts that were supplied with OS/2 release 1.1 and 1.2 are no longer supplied. Using one of the old names results in one of the new fonts listed above being used, as follows:

 Old Family/Face Name     Font Used. 
 Roman/Tms Rmn            Times New Roman 
 Swiss/Helv               Helvetica 

These fonts are provided in an efficient binary format for use by the OS/2 Adobe Type Manager. They are also provided in standard Type 1 format (PFB and AFM) for use with the OS/2 PostScript* printer device driver.

Presentation Manager Bit Map Fonts

The following tables list all system bit map fonts available using the Graphics Programming Interface. The first table applies to hardware that does not conform to the International Standards Organization (ISO) 9241. (See International Standards Organization (ISO) 9241 for more information on ISO 9241.) The second table lists the fonts supplied with OS/2 for IBM hardware that does conform to ISO 9241.

During system installation, the operating system determines the type of display adapter available on your computer and installs only the fonts which match the device resolution. Since additional device bit map fonts may be available on specific devices, you may have to install the correct bit map fonts if you change your display device after the operating system is installed.

Fonts Supplied for ISO 9241 Non-Conforming Hardware

The following information for each font is included in the table:

Points
This is the point size of the font, on a device whose resolution matches that of the font, (see "Device" below).
Ave Wid
This is the average width in pels of alphabetic characters weighted according to US English letter frequencies.
Max Wid
This is the maximum width in pels of all characters in the font. This field is not necessarily the maximum width of any character in the code page. It could be used to ensure that the horizontal space allocated on a display or printer is big enough to handle any character.
Height
This is the height in pels of the font. This is the minimum number of rows of pels needed to output any character of the font on a given baseline. This field may be larger than necessary for a given code page. It could be used to ensure that the vertical space allocated on a display or printer is big enough to handle any character.
Device
This is the X and Y resolution in pels per inch at which the font is intended to be used. Only those fonts which match the device resolution of the installed display driver are available on the system. If the installed display is changed, the install process will reinstall the proper font sets for the new adapter. The IBM devices whose device drivers report these resolutions are:
96 x 48 CGA
96 x 72 EGA
96 x 96 VGA and XGA (in 640 x 480 mode)
120 x 120 8514/A and XGA (in 1024 x 768 mode)

Note: These values are approximate representations of the actual resolution, which in the case of displays depends on which monitor is attached. Consequently the point size of characters on the screen is also approximate.

The following table applies to hardware that does not conform to ISO 9241.

Family Face Name Points Ave Wid Max Wid Height Device
Courier Courier ?6x48
...

Fonts Supplied for ISO 9241 Conforming Hardware

The following table lists the fonts and sizes that have been tested and certified as passing the ISO 9241 black text on white background criteria for the three IBM displays that conform to the standard. These displays are:

  • 9515 - A 14 inch XGA display.
  • 9517 - A 17 inch XGA display.
  • 9518 - A 14 inch VGA display.

See International Standards Organization (ISO) 9241 for information on ISO 9241.

The following information about each font is also included in the table:

 P        The point size of the font.
 AW       The average character width in pels in the font. 
 MW       The maximum character width in pels in the font. 
 HE       The height in pels of the font (maximum baseline extent). 
 Device   The X and Y resolution in pels per inch on the device the font is intended to be used. The IBM devices whose device drivers report 
          these resolutions are:
      96 x 96         VGA and XGA (in 640 x 480 mode)
      120 x 120       XGA (in 1024 x 768 mode)
 ?amily  ?ace Nam?   AW  MW  HE  ?evice   ?515  9517  9518 ?
 ?ame    ?       ?               ?        ?                ?

 ?ourier ?ourier ?8   8   8  13  ?96   96 ?o    No    No   ?
 ?       ?SO     ?8  10  10  16  ?20  120 ?o    No    n/a  ?
 ?       ?       ?9   8   8  15  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?0  10  10  16  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?0  12  12  20  ?20  120 ?o    No    n/a  ?
 ?       ?       ?2  12  12  20  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?2  15  15  25  ?20  120 ?es   Yes   n/a  ?

 ?elv    ?elv ISO?8   5  13  13  ?96   96 ?o    No    No   ?
 ?       ?       ?8   7  14  16  ?20  120 ?o    No    n/a  ?
 ?       ?       ?9   6  13  15  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?9   8  20  21  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?0   7  14  16  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?0   9  20  21  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?2   9  17  20  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?2  10  21  25  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?4  10  21  24  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?4  12  26  29  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?8  12  26  29  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?8  15  34  36  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?4  14  34  36  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?4  19  45  46  ?20  120 ?es   Yes   n/a  ?

 ?ms Rmn ?ms Rmn ?8   5  12  13  ?96   96 ?o    No    No   ?
 ?       ?SO     ?8   7  15  16  ?20  120 ?o    No    n/a  ?
 ?       ?       ?9   6  12  15  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?0   7  14  16  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?0   8  17  19  ?20  120 ?o    Yes   n/a  ?
 ?       ?       ?2   8  16  19  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?2  10  23  22  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?4   9  23  22  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?4  11  26  27  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?8  11  26  27  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?8  14  34  34  ?20  120 ?es   Yes   n/a  ?
 ?       ?       ?4  14  34  34  ?96   96 ?es   Yes   Yes  ?
 ?       ?       ?4  17  46  43  ?20  120 ?es   Yes   n/a  ?

 ?ystem  ?ystem  ?9   6  13  15  ?96   96 ?es   Yes   Yes  ?
 ?ropor- ?ropor- ?0   6  20  16  ?96   96 ?es   Yes   Yes  ?
 ?ional  ?ional  ?0   8  23  20  ?20  120 ?o    Yes   n/a  ?
 ?       ?       ?2  10  23  22  ?20  120 ?es   Yes   n/a  ?

 ?ystem  ?ystem  ?0   8   8  16  ?96   96 ?es   Yes   Yes  ?
 ?ono-   ?ono-   ?0  10  10  21  ?20  120 ?es   Yes   n/a  ?
 ?paced  ?paced  ?               ?        ?                ?

See International Standards Organization (ISO) 9241 for more information on ISO 9241.

Many of the characters required by each code page are common; for example, the first 128 characters of all the ASCII code pages are identical. This set of characters is called the Universal Glyph List (UGL). A code page is simply a set of pointers into the UGL.

As the characters in every font are in the same order, only one set of code-page translation tables is necessary.

Note
The fonts of Microsoft Windows support only code page 1004.

ISO 9241 is an international standard covering health and safety in the work place for users of visual display terminals. Part 3 of this standard covers clarity and legibility of text displayed on computer screens; it places requirements on minimum sizes and luminance contrast.

The presence of the FM_SEL_ISO9241_TESTED flag in the FONTMETRICS structure indicates that the font has been tested for ISO compliance.

Note: While the fonts were primarily tested for meeting the ISO standard, they have also been designed to meet the German standard DIN 66 234. Where the two standards differ, the fonts have been designed to meet the stricter requirement.

The FM_ISO_xxx flags indicate the results of the test on the three IBM* displays that conform to the standard. These are the IBM 9515, 9517, and 9518 color displays at the supported resolutions of 640 x 480 and 1024 x 768. To determine whether a non-IBM display complies with ISO 9241, contact the manufacturer. The current display type can be established using VioGetConfig.

In order for applications to meet the standard, they have to ensure that they use only fonts that have been tested and passed. You can determine this by examining the new FM_SEL_ISO9241_TESTED flag in the fsSelection parameter in the FONTMETRICS structure, the FM_ISO_xxx flags and the sXDeviceRes and sYDeviceRes fields in the structure.

See Fonts Supplied with the OS/2 Operating System for the table describing ISO 9241 compliant fonts.