msos2.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
FONTMETRICS (1.2)
Changes                                             Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
typedef struct _FONTMETRICS {    /* fm */
    CHAR    szFamilyname[FACESIZE];
    CHAR    szFacename[FACESIZE];
    USHORT  idRegistry;
    USHORT  usCodePage;
    LONG    lEmHeight;
    LONG    lXHeight;
    LONG    lMaxAscender;
    LONG    lMaxDescender;
    LONG    lLowerCaseAscent;
    LONG    lLowerCaseDescent;
    LONG    lInternalLeading;
    LONG    lExternalLeading;
    LONG    lAveCharWidth;
    LONG    lMaxCharInc;
    LONG    lEmInc;
    LONG    lMaxBaselineExt;
    SHORT   sCharSlope;
    SHORT   sInlineDir;
    SHORT   sCharRot;
    USHORT  usWeightClass;
    USHORT  usWidthClass;
    SHORT   sXDeviceRes;
    SHORT   sYDeviceRes;
    SHORT   sFirstChar;
    SHORT   sLastChar;
    SHORT   sDefaultChar;
    SHORT   sBreakChar;
    SHORT   sNominalPointSize;
    SHORT   sMinimumPointSize;
    SHORT   sMaximumPointSize;
    USHORT  fsType;
    USHORT  fsDefn;
    USHORT  fsSelection;
    USHORT  fsCapabilities;
    LONG    lSubscriptXSize;
    LONG    lSubscriptYSize;
    LONG    lSubscriptXOffset;
    LONG    lSubscriptYOffset;
    LONG    lSuperscriptXSize;
    LONG    lSuperscriptYSize;
    LONG    lSuperscriptXOffset;
    LONG    lSuperscriptYOffset;
    LONG    lUnderscoreSize;
    LONG    lUnderscorePosition;
    LONG    lStrikeoutSize;
    LONG    lStrikeoutPosition;
    SHORT   sKerningPairs;
    SHORT   sFamilyClass;
    LONG    lMatch;
} FONTMETRICS;
 
The FONTMETRICS structure contains information about fonts.
 
Field                   Description
────────────────────────────────────────────────────────────────────────────
 
szFamilyname[FACESIZE]  Specifies the family name of the font. Examples of
                        common family names are Courier, Swiss, and Roman.
 
szFacename[FACESIZE]    Specifies the typeface name of the font. Examples of
                        common typeface names are Courier, Helv, System
                        Monospaced, System Proportional, and Times Roman.
 
idRegistry              Specifies the registry number of the font.
 
usCodePage              Identifies the code page an application should use
                        with a particular font.
 
lEmHeight               Specifies the average height of uppercase
                        characters. The height is measured in world
                        coordinates from the baseline to the top of the
                        character.
 
lXHeight                Specifies the average height of lowercase
                        characters. The height is measured in world
                        coordinates from the baseline to the top of the
                        character.
 
lMaxAscender            Specifies the maximum height of any character in the
                        font. The height is measured in world coordinates
                        from the baseline to the top of the character.
 
lMaxDescender           Specifies the maximum depth of any character in the
                        font. The depth is measured in world coordinates
                        from the baseline to the bottom of the deepest
                        character.
 
lLowerCaseAscent        Specifies the maximum height of any lowercase
                        character in the font. The height is measured in
                        world coordinates from the baseline to the top of
                        the ascender of the tallest lowercase character.
 
lLowerCaseDescent       Specifies the maximum depth of any lowercase
                        character in a font. The depth is measured in world
                        coordinates from the baseline to the bottom of the
                        descender on the deepest lowercase character.
 
lInternalLeading        Specifies the amount of space reserved in the top of
                        each character cell for accent marks. This metric is
                        always given in world coordinates.
 
lExternalLeading        Specifies the amount of space that should appear
                        between adjacent rows of text. This metric is always
                        given in world coordinates.
 
lAveCharWidth           Specifies the average character width for characters
                        in the font. The average character width is
                        determined by multiplying the width of each
                        lowercase character by a predetermined constant,
                        adding the results, and then dividing by 1000.
                        Following are the letters and their predetermined
                        constants:
 
                            a    64        j    3        s        56
                            b    14        k    6        t        71
                            c    27        l    35       u        31
                            d    35        m    20       v        10
                            e    100       n    56       w        18
                            f    20        o    56       x         3
                            g    14        p    17       y        18
                            h    42        q    4        z        2
                            i    63        r    49       space    166
 
lMaxCharInc             Specifies the maximum increment between characters
                        in the font.
 
lEmInc                  Specifies the width of an uppercase M in the font.
 
lMaxBaselineExt         Specifies the sum of the maximum ascender and
                        maximum descender values.
 
sCharSlope              Specifies the angle (in degrees and minutes) between
                        a vertical line and the upright strokes in
                        characters in the font. The first nine bits of this
                        value contain the degrees, the next six bits contain
                        the minutes, and the last bit is reserved. The slope
                        of characters in a normal font is zero; the slope of
                        italic characters is nonzero.
 
sInlineDir              Specifies an angle (in degrees and minutes,
                        increasing clockwise) from the x-axis that the
                        system uses when it draws a text string. The system
                        draws each consecutive character from the text
                        string in the in-line direction. The in-line
                        direction for a Swiss font is zero; the in-line
                        direction for a Hebrew font is 180.
 
sCharRot                Specifies the angle (in degrees and minutes) between
                        the baseline of characters in the font and the
                        x-axis. This is the angle assigned by the font
                        designer.
 
usWeightClass           Specifies the thickness of the strokes that form the
                        characters in the font. This field can be one of the
                        following values:
 
                        Value  Meaning
                        ────────────────────────────────────────────────────
                        1      Ultra-light
                        2      Extra-light
                        3      Light
                        4      Semi-light
                        5      Medium (normal)
                        6      Semi-bold
                        7      Bold
                        8      Extra-bold
                        9      Ultra-bold
 
usWidthClass            Specifies the relative aspect ratio of characters in
                        the font in relation to the normal aspect ratio for
                        a font of this type. The following are the possible
                        values:
 
                        Value    Description        Normal aspect ratio
                        ────────────────────────────────────────────────────
                        1        Ultra-condensed    50%
 
                        2        Extra-condensed    62.5%
 
                        3        Condensed          75%
 
                        4        Semi-condensed     87.5%
 
                        5        Normal             100%
 
                        6        Semi-expanded      112.5%
 
                        7        Expanded           125%
 
                        8        Extra-expanded     150%
 
                        9        Ultra-expanded     200%
 
sXDeviceRes             Specifies the horizontal resolution of the target
                        device for which the font was originally designed.
                        This value is given in pels per inch.
 
sYDeviceRes             Specifies the vertical resolution of the target
                        device for which the font was originally designed.
                        This value is given in pels per inch.
 
sFirstChar              Specifies the code point for the first character in
                        the font.
 
sLastChar               Specifies the code point for the last character in
                        the font. This code point is an offset from the
                        sFirstChar value.
 
sDefaultChar            Specifies the code point for the default character
                        in the font. This code point is an offset from the
                        sDefaultChar value. The default character is the
                        character the system uses when an application
                        specifies a code point that is out of the range of a
                        font's code page.
 
sBreakChar              Specifies the code point for the space character in
                        the font. This code point is an offset from the
                        sFirstChar value.
 
sNominalPointSize       Specifies the height of the font (in
                        decipoints──each decipoint is 1/720 inch). The
                        nominal point size is the point size in which the
                        font was designed to be drawn.
 
sMinimumPointSize       Specifies the mimimum height of the font (in
                        decipoints). A font should not be reduced to a size
                        smaller than the minimum point size.
 
sMaximumPointSize       Specifies the maximum height of the font (in
                        decipoints). A font should not be increased to a
                        size larger than this value.
 
fsType                  Specifies the type of font. This field can be one or
                        more of the following values:
 
                        Value             Meaning
                        ────────────────────────────────────────────────────
                        FM_TYPE_FIXED     Font is fixed. Font is
                                          proportional if this value is not
                                          specified.
 
                        FM_TYPE_LICENSED  Font is licensed.
 
                        FM_TYPE_KERNING   Font has kerning information.
 
                        FM_TYPE_DBCS      Font is a double-byte character
                                          set.
 
                        FM_TYPE_MBCS      Font is a multiple-byte character
                                          set.
 
                        FM_TYPE_64K       Font requires more than 64K of
                                          memory.
 
fsDefn                  Specifies the definition of the font. This field can
                        be one or more of the following values:
 
                        Value            Meaning
                        ────────────────────────────────────────────────────
                        FM_DEFN_OUTLINE  Specifies an outline font
                                         (vector).
 
                        FM_DEFN_GENERIC  Specifies a generic font (raster or
                                         bitmapped).
 
fsSelection             Specifies how the characters are to be drawn. This
                        field can be one or more of the following values:
 
                        Value              Meaning
                        ────────────────────────────────────────────────────
                        FM_SEL_ITALIC      Characters are italic.
 
                        FM_SEL_UNDERSCORE  Characters are underscored.
 
                        FM_SEL_NEGATIVE    Characters are drawn using
                                           negative images.
 
                        FM_SEL_OUTLINE     Characters are outlined.
 
                        FM_SEL_STRIKEOUT   Characters are overstruck.
 
                        FM_SEL_BOLD        Characters are bold.
 
fsCapabilities          Specifies whether the characters in this font can be
                        mixed with graphics. If this field is FM_CAP_NOMIX,
                        the characters cannot be mixed with graphics;
                        otherwise, they can be mixed with graphics.
 
lSubscriptXSize         Specifies the horizontal size (in world coordinates)
                        for subscripts in the font.
 
lSubscriptYSize         Specifies the vertical size (in world coordinates)
                        for subscripts in the font.
 
lSubscriptXOffset       Specifies the horizontal offset from the left edge
                        of the character cell.
 
lSubscriptYOffset       Specifies the vertical offset from the
                        character-cell baseline.
 
lSuperscriptXSize       Specifies the horizontal size (in world coordinates)
                        for superscripts in the font.
 
lSuperscriptYSize       Specifies the vertical size (in world coordinates)
                        for superscripts in the font.
 
lSuperscriptXOffset     Specifies the horizontal offset from the left edge
                        of the character cell.
 
lSuperscriptYOffset     Specifies the vertical offset from the
                        character-cell baseline.
 
lUnderscoreSize         Specifies the width of the underscore (in world
                        coordinates).
 
lUnderscorePosition     Specifies the distance from the baseline to the
                        underscore line (in world coordinates).
 
lStrikeoutSize          Specifies the width of the overstrike (in world
                        coordinates).
 
lStrikeoutPosition      Specifies the position of the overstrike in relation
                        to the baseline.
 
sKerningPairs           Specifies the number of kerning pairs in the
                        kerning-pair table for the font.
 
sFamilyClass            Specifies the font-family class and subclass.
 
lMatch                  Specifies a long integer that identifies this font.
                        The application should copy this value to the
                        FATTRS structure when the GpiCreateLogFont function
                        is called.
 
See Also
 
GpiCreateLogFont, GpiQueryFontMetrics, GpiQueryFonts, VioQueryFonts