Method function IGDIPlus.IGPFont.GetHeight(IGPGraphics) : Single

From Mitov Wiki Doc
Jump to: navigation, search

This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.

Class: IGPFont

Contents

Syntax

Delphi:

function GetHeight( graphics : IGPGraphics ) : Single;

C++ Builder:

float __fastcall GetHeight( IGPGraphics graphics );

Visual C++ (MFC):

GetHeight(  graphics );

Summary

Gets the line spacing of this font in the current unit of a specified Graphics object.

Description

Call this method to get the line spacing of this 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.


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

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox