DrFont class

DrFont class

Use this class instead of GDI+ Font

The DrFont type exposes the following members:

Properties

PropertyDescription
styleGets style of this font.
is_boldGets a value indicating whether this instance is bold.
is_italicGets a value indicating whether this instance is italic.
small_caps_scale_factorGets the SmallCaps scale factor.
family_nameGets name of this font.
size_pointsGets size of this font (points).
ascent_pointsReturns the cell ascent in points.
descent_pointsReturns the cell descent in points.
cell_height_pointsShortcut for DrFont.ascent_points + DrFont.descent_points.
ascent_lisCell ascent of this font (lis).
This is a vertical distance from cell top to cell baseline.
descent_lisCell descent of this font (lis).
This is a vertical distance from cell bottom to cell baseline.
cell_height_lisReturns cell height of this font (lis).
This is a shortcut for DrFont.ascent_lis + DrFont.descent_lis.
leading_lisReturns leading of this font (lis).
This is a shortcut for DrFont.line_spacing_lis - DrFont.cell_height_lis.
leading_pointsReturns leading of this font (lis).
This is a shortcut for DrFont.line_spacing_lis - DrFont.cell_height_lis.
line_spacing_lisReturns cell spacing of this font (lis).
This is a vertical distance between baselines of the two glyphs.
line_spacing_pointsReturns cell spacing of this font (points).
This is a vertical distance between baselines of the two glyphs.
style_exThis property contains additional information about font’s style

Methods

MethodDescription
get_text_width_pointsGets the text width points.
get_text_width_pointsGets the text width points.
replaceReplace font content
get_char_width_pointsReturns width of the character (points).
get_text_size_pointsReturns measurement text box of the text in points.
get_char_width_lisGets the char width lis.
get_text_width_lisGets the text width lis.
is_poorly_rendered_by_gdi_plusReturns True for “Microsoft Sans Serif” font. This one is poorly rendered by GDI+. See Test286 and Gemini-6959.

See Also