GdipGetFontHeight

 

 

Description

Gets this line spacing of the font in the current unit of a specified Graphics object. 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

GpStatus WINGDIPAPI GdipGetFontHeight(

    GDIPCONST GpFont *font,

    GDIPCONST GpGraphics *graphics,

    REAL *height

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetFontHeight ( _

    BYVAL pFont AS DWORD, _

    BYVAL graphics AS DWORD, _

    BYREF nHeight AS SINGLE _

) AS LONG

Parameters

 

font

[in] Pointer to the Font object.

graphics

[in] Pointer to a Graphics object whose unit and vertical resolution are used in the height calculation.

height

[out] Pointer to a variab le that receives te line spacing of this font.

Remarks

If the font unit is set to anything other than UnitPixel, the height, in pixels, is calculated using the vertical resolution of the specified Graphics object. 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 unit of the Graphics object is UnitPixel and the vertical resolution of the Graphics object is 96 dots per inch, the height is calculated as follows:

 

2355*(0.3/2048)*96 = 33.1171875

 

Continuing with the same example, suppose the unit of the Graphics object is something other than UnitPixel, say UnitMillimeter. Then (using 1 inch = 25.4 millimeters) the height, in millimeters, is calculated as follows:

 

2355*(0.3/2048)25.4 = 8.762256

 

Valid HTML 4.01 Transitional