Class GdiFontProvider
- Namespace
- CADability.Forms
- Assembly
- CADability.Forms.dll
A FontProvider that gets the fonts from GDI and GDI+, as CADability did before issue #412: the glyph
outlines from AddString(string, FontFamily, int, float, PointF, StringFormat), the widths
and the kerning from gdi32. It knows every font Windows knows (also OpenType fonts with CFF outlines) and
synthesizes bold and italic faces a family does not have. As soon as one of the main classes of CADability.Forms is
used (CadControl, CadCanvas, CadFrame, PaintToOpenGL or
PaintToGDI), this provider becomes the default, so that Windows Forms applications show their texts
as before. An application that sets Current itself keeps its choice, e.g.
FontProvider.Current = new ManagedFontProvider(); for the same fonts as on the other platforms.
public class GdiFontProvider : FontProvider
- Inheritance
-
GdiFontProvider
- Inherited Members
Constructors
GdiFontProvider()
public GdiFontProvider()
Methods
GetDefaultFace(bool, bool)
The generic sans serif family of GDI+, as before issue #412.
public override FontFace GetDefaultFace(bool bold, bool italic)
Parameters
Returns
GetFace(string, bool, bool)
Returns the face of the font family familyName (not case sensitive) that matches the requested
style best, or null if the provider does not know this family.
public override FontFace GetFace(string familyName, bool bold, bool italic)
Parameters
familyNamestringThe name of the font family, e.g. "Arial"
boldboolBold requested
italicboolItalic requested
Returns
GetFamilyNames()
The names of all font families this provider knows, e.g. for a list to choose from.
public override string[] GetFamilyNames()
Returns
- string[]