DrFont

DrFont class

Use this class instead of GDI+ Font

public class DrFont

Properties

Name Description
AscentLis { get; } Cell ascent of this font (lis). This is a vertical distance from cell top to cell baseline.
AscentPoints { get; } Returns the cell ascent in points.
CellHeightLis { get; } Returns cell height of this font (lis). This is a shortcut for AscentLis + DescentLis.
CellHeightPoints { get; } Shortcut for AscentPoints + DescentPoints.
DescentLis { get; } Cell descent of this font (lis). This is a vertical distance from cell bottom to cell baseline.
DescentPoints { get; } Returns the cell descent in points.
FamilyName { get; } Gets name of this font.
IsBold { get; } Gets a value indicating whether this instance is bold.
IsItalic { get; } Gets a value indicating whether this instance is italic.
LeadingLis { get; } Returns leading of this font (lis). This is a shortcut for LineSpacingLis - CellHeightLis.
LeadingPoints { get; } Returns leading of this font (lis). This is a shortcut for LineSpacingLis - CellHeightLis.
LineSpacingLis { get; } Returns cell spacing of this font (lis). This is a vertical distance between baselines of the two glyphs.
LineSpacingPoints { get; } Returns cell spacing of this font (points). This is a vertical distance between baselines of the two glyphs.
SizePoints { get; set; } Gets size of this font (points).
SmallCapsScaleFactor { get; } Gets the SmallCaps scale factor.
Style { get; } Gets style of this font.
StyleEx { get; set; } This property contains additional information about font’s style

Methods

Name Description
override Equals(object) Determines whether the specified Object, is equal to this instance.
GetCharWidthLis(char) Gets the char width lis.
GetCharWidthPoints(char) Returns width of the character (points).
override GetHashCode() Returns a hash code for this instance.
GetTextSizePoints(string) Returns measurement text box of the text in points.
GetTextWidthLis(string) Gets the text width lis.
GetTextWidthPoints(string) Gets the text width points.
GetTextWidthPoints(string, int, int) Gets the text width points.
Replace(DrFont) Replace font content
static IsPoorlyRenderedByGdiPlus(string) Returns True for “Microsoft Sans Serif” font. This one is poorly rendered by GDI+. See Test286 and Gemini-6959.

See Also