IPixelFontInfo
Description
- Extended by
-
PixelFont sealed
PixelFontInfo sealed
Base interface that provides information about pixel font metrics.
The following figure illustrates the various metrics of a pixel font:
___ __ __ ___ Ascent | / // / | | ___ ______ /_//_/ __ _ | | | / ____/________ _____ / /_ (_)_________ | | | / / __/ ___/ __ `/ __ \/ __ \/ / ___/ ___/ | | | / /_/ / / / /_/ / /_/ / / / / / /__(__ ) | | |__ \____/_/ \__,_/ .___/_/ /_/_/\___/____/ __| Baseline | Compact / / | |__ /_/ __| Descent Height <== |________| |.......|_|.....| Width Kerning
The Height
of a font is the maximum glyph height. The Height
is divided into Ascent
and Descent
, i.e. the amount by which glyphs move away from the font Baseline
. The Compact
extend is measured from the baseline upwards and includes glyphs of commonly used characters. Each glyph has a Width
(the plain width). Pairs of glyphs can have a Kerning
width, which is used to compute the number of pixels to advance when moving from one glyph to the next.
- See also
Public / Methods
KerningWidth
Returns the kerning amount to use when drawing the given character glyph.
In order to move from one character to the next, the kerning width must be subtracted from the PixelFontGlyph.Width of the first character glyph, in order to obtain the final location of the second character glyph.
Public / Attributes
Ascent
The font ascent (maximum upwards distance from baseline).
The ascent of a font is measured upwards from the baseline to the maximum extend of all character glyphs.
Extensions
MeasureHeight
2 overloads
Measures the vertical extend of the given character.
Returns the vertical extend of the given string.
MeasureWidth
2 overloads
Measures the width of the given character.
Measures the width of the given string, applying character kerning.
Padding
Returns the amount of padding around the font compact height that is necessary to contain all glyph pixels.
PaddingOffset
Returns the offset to add to the Y-coordinate of a Anchor.Top anchor in order to render text with uniform padding.