Class FontFace
- Namespace
- CADability
- Assembly
- CADability.dll
A face of a font family (e.g. "Arial Bold") as a FontProvider provides it. Metrics are in font units, widths and kerning in units of the em height, and the glyph outlines are Bezier curves, so that all providers produce the same exact geometry.
public abstract class FontFace
- Inheritance
-
FontFace
- Inherited Members
Constructors
FontFace()
protected FontFace()
Properties
CellAscent
The ascent of the character cell in font units.
public abstract int CellAscent { get; }
Property Value
CellDescent
The descent of the character cell in font units, positive downwards.
public abstract int CellDescent { get; }
Property Value
EmHeight
The height of the em square in font units (e.g. 2048 for most TrueType fonts).
public abstract int EmHeight { get; }
Property Value
FamilyName
The name of the font family.
public abstract string FamilyName { get; }
Property Value
IsBold
True if this face is bold.
public abstract bool IsBold { get; }
Property Value
IsItalic
True if this face is italic.
public abstract bool IsItalic { get; }
Property Value
LineSpacing
The distance between the baselines of two lines in font units.
public abstract int LineSpacing { get; }
Property Value
Methods
GetAdvanceWidth(int)
The advance width of the character codePoint in units of the em height. Characters are Unicode
code points, so that characters outside the Basic Multilingual Plane (e.g. most emoji), which take two UTF-16
chars (a surrogate pair) in a string, are one character here.
public abstract double GetAdvanceWidth(int codePoint)
Parameters
codePointint
Returns
GetGlyphPath(int, bool, bool, out PointF[], out byte[])
Returns the outline of the character (Unicode code point) codePoint in the layout of a GDI+ GraphicsPath after
AddString with an em size of 1 and StringFormat.GenericTypographic: in units of the em height, y
downwards, the top of the character cell at 0 and the baseline at CellAscent/EmHeight.
The point types are those of GDI+ (0 start, 1 line, 3 cubic Bezier, 0x80 closes the figure). Curves must be returned
as Bezier segments and not be flattened. Underline and strikeout are added as rectangles when requested.
public abstract void GetGlyphPath(int codePoint, bool underline, bool strikeout, out PointF[] points, out byte[] types)
Parameters
GetKerning(int, int)
The kerning between two characters (Unicode code points) in units of the em height, usually negative; 0 if there is none.
public abstract double GetKerning(int left, int right)