please dont rip this site Prev Next

NEWTEXTMETRIC info  Overview  Group

The NEWTEXTMETRIC structure contains data that describes a physical font.

typedef struct tagNEWTEXTMETRIC { // ntm 

    LONG   tmHeight; 

    LONG   tmAscent; 

    LONG   tmDescent; 

    LONG   tmInternalLeading; 

    LONG   tmExternalLeading; 

    LONG   tmAveCharWidth; 

    LONG   tmMaxCharWidth; 

    LONG   tmWeight; 

    LONG   tmOverhang; 

    LONG   tmDigitizedAspectX; 

    LONG   tmDigitizedAspectY; 

    BCHAR  tmFirstChar; 

    BCHAR  tmLastChar; 

    BCHAR  tmDefaultChar; 

    BCHAR  tmBreakChar; 

    BYTE   tmItalic; 

    BYTE   tmUnderlined; 

    BYTE   tmStruckOut; 

    BYTE   tmPitchAndFamily; 

    BYTE   tmCharSet; 

    DWORD  ntmFlags; 

    UINT   ntmSizeEM; 

    UINT   ntmCellHeight; 

    UINT   ntmAvgWidth; 




Specifies the height (ascent + descent) of characters.
Specifies the ascent (units above the base line) of characters.
Specifies the descent (units below the base line) of characters.
Specifies the amount of leading (space) inside the bounds set by the tmHeight member. Accent marks and other diacritical characters may occur in this area. The designer may set this member to zero.
Specifies the amount of extra leading (space) that the application adds between rows. Since this area is outside the font, it contains no marks and is not altered by text output calls in either OPAQUE or TRANSPARENT mode. The designer may set this member to zero.
Specifies the average width of characters in the font (generally defined as the width of the letter x). This value does not include overhang required for bold or italic characters.
Specifies the width of the widest character in the font.
Specifies the weight of the font.
Specifies the extra width per string that may be added to some synthesized fonts. When synthesizing some attributes, such as bold or italic, graphics device interface (GDI) or a device may have to add width to a string on both a per-character and per-string basis. For example, GDI makes a string bold by expanding the spacing of each character and overstriking by an offset value; it italicizes a font by shearing the string. In either case, there is an overhang past the basic string. For bold strings, the overhang is the distance by which the overstrike is offset. For italic strings, the overhang is the amount the top of the font is sheared past the bottom of the font.

The tmOverhang member enables the application to determine how much of the character width returned by a GetTextExtentPoint32 function call on a single character is the actual character width and how much is the per-string extra width. The actual width is the extent minus the overhang.

Specifies the horizontal aspect of the device for which the font was designed.
Specifies the vertical aspect of the device for which the font was designed. The ratio of the tmDigitizedAspectX and tmDigitizedAspectY members is the aspect ratio of the device for which the font was designed.
Specifies the value of the first character defined in the font.
Specifies the value of the last character defined in the font.
Specifies the value of the character to be substituted for characters that are not in the font.
Specifies the value of the character to be used to define word breaks for text justification.
Specifies an italic font if it is nonzero.
Specifies an underlined font if it is nonzero.
Specifies a strikeout font if it is nonzero.
Specifies the pitch and family of the selected font. The low-order bit (bit 0) specifies the pitch of the font. If it is 1, the font is variable pitch (or proportional). If it is 0, the font is fixed pitch (or monospace). Bits 1 and 2 specify the font type. If both bits are 0, the font is a raster font; if bit 1 is 1 and bit 2 is 0, the font is a vector font; if bit 1 is 0 and bit 2 is set, or if both bits are 1, the font is some other type. Bit 3 is 1 if the font is a device font; otherwise, it is 0.

The four high-order bits designate the font family. The tmPitchAndFamily member can be combined with the hexadecimal value 0xF0 by using the bitwise AND operator and can then be compared with the font family names for an identical match. For more information about the font families, see the LOGFONT structure.

Specifies the character set of the font.
Specifies whether the font is italic, underscored, outlined, bold, and so forth. The following list shows the bits corresponding to each font type:















Specifies the size of the em square for the font. This value is in “notional units” (that is, the units for which the font was designed).
Specifies the height, in notional units, of the font. This value should be compared with the value of the ntmSizeEM member.
Specifies the average width of characters in the font, in notional units. This value should be compared with the value of the ntmSizeEM member.


The last four members of the NEWTEXTMETRIC structure are not included in the TEXTMETRIC structure; in all other respects, the structures are identical.

The sizes in the NEWTEXTMETRIC structure are typically given in logical units; that is, they depend on the current mapping mode of the display context.

See Also

EnumFontFamilies, GetTextExtentPoint32, GetTextMetrics, LOGFONT

See also:

file: /Techref/os/win/api/win32/struc/src/str12_18.htm, 8KB, , updated: 2000/4/7 12:20, local time: 2022/5/23 01:35,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!


After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220523
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!