Constructors
public Font(string familyName, FontWeight weight, FontStyle style, bool underlined, bool strikethrough)
Parameters:
| familyName (string) | |
| weight (Font.FontWeight) | |
| style (Font.FontStyle) | |
| underlined (bool) | |
| strikethrough (bool) |
public Font(string familyName, FontWeight weight, FontStyle style, FontStretch stretch, bool underlined, bool strikethrough)
Parameters:
| familyName (string) | |
| weight (Font.FontWeight) | |
| style (Font.FontStyle) | |
| stretch (Font.FontStretch) | |
| underlined (bool) | |
| strikethrough (bool) |
Properties
The font's typographic capital height, in the design units reported by UnitsPerEm. This is the metric a "text height" is measured against, so text of height h renders its capitals h tall. Zero when the font has no usable metrics.
Returns a long description that includes family, face, weight, stretch and style information. Generally not useful for finding matching fonts.
Returns concatenated Family and Face names
Returns the Font PostScriptName - "Apple font name"
Returns the Font RichTextFontName used in RTF strings: {\\fonttbl...{\\fN RichTextFontName;}...}
The number of design units per em in this font's normalized metrics. Together with AscentOfCapital this converts between an em size - the "font size" used by CSS, SVG, PDF and most page layout - and the height of a capital letter, which is what Rhino means by a text height. Zero when the font has no usable metrics.
Methods
public static Font FromRichTextProperties(string richTextFontName, bool bold, bool italic, bool underlined, bool strikethrough)
Returns a font with the requested rich-text (family) name, preserving that name even when the font is not installed on the current machine. If an installed font matches it is returned; otherwise a "not on device" managed font that keeps the requested name is returned (rendered with a fallback quartet). Use this to author a font by name on a machine that does not have it installed: the Font constructor and FromQuartetProperties(string, bool, bool) both substitute the family in that case, losing the requested name when the file is written.
Parameters:
| richTextFontName (string) | The rich-text font (family) name to store. |
| bold (bool) | True to select the heavier member of the rich-text quartet. |
| italic (bool) | True to select the more slanted member of the rich-text quartet. |
| underlined (bool) | True for underlined text. |
| strikethrough (bool) | True for strikethrough text. |
Returns: A font that preserves the requested name, or null if none could be created.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
public void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
Parameters:
| info (SerializationInfo) | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| context (StreamingContext) | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
If this font is not installed on the system, try to find a substitute
Parameters:
| familyName (string) |