Font::GetHeight(REAL) method (gdiplusheaders.h)

The Font::GetHeight method gets the line spacing, in pixels, of this font. The line spacing is the vertical distance between the base lines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of the character itself.

Syntax

REAL GetHeight(
  [in] REAL dpi
);

Parameters

[in] dpi

Type: REAL

Real number that specifies the vertical resolution, in dots per inch, of the device that displays the font.

Return value

Type: REAL

This method returns the line spacing of the font in pixels.

Remarks

If the font unit is set to anything other than UnitPixel, the height, in pixels, is calculated using the specified vertical resolution. For example, suppose the font unit is inches and the font size is 0.3. Also suppose that for the corresponding font family, the em height is 2048 and the line spacing is 2355. If the specified vertical resolution is 96 dots per inch, the height is calculated as follows:

2355*(0.3/2048)*96 = 33.1171875

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Font

Font::GetSize

Font::GetStyle

Font::GetUnit

Using Text and Fonts