GH_FontServer
Maintains a collection of standard fonts and mays to measure them.
Inheritance Hierarchy
System.Object
Grasshopper.Kernel.GH_FontServer
Namespace: Grasshopper.Kernel
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public sealed class GH_FontServer
The GH_FontServer type exposes the following members.
Properties
Name
Description
Public Property
Static Member
Console
FontFamily.GenericMonospace, 10pt, regular
Public Property
Static Member
ConsoleAdjusted
FontFamily.GenericMonospace, 10pt, regular, adjusted to counter UI scaling.
Public Property
Static Member
ConsoleSmall
FontFamily.GenericMonospace, 8pt, regular
Public Property
Static Member
ConsoleSmallAdjusted
FontFamily.GenericMonospace, 8pt, regular, adjusted to counter UI scaling.
Public Property
Static Member
FamilyConsole
Gets or sets the FontFamily used for monospaced fonts in Grasshopper.
Public Property
Static Member
FamilyScript
Gets or sets the FontFamily used for scripted fonts in Grasshopper.
Public Property
Static Member
FamilyStandard
Gets or sets the FontFamily used for standard fonts in Grasshopper.
Public Property
Static Member
Large
SystemFonts.CaptionFont, 10pt, bold
Public Property
Static Member
LargeAdjusted
SystemFonts.CaptionFont, 10pt, bold, adjusted for logical pixel size.
Public Property
Static Member
Script
FontFamily.GenericSansSerif, 10pt, italic
Public Property
Static Member
ScriptSmall
FontFamily.GenericSansSerif, 8pt, italic
Public Property
Static Member
Small
SystemFonts.CaptionFont, 6pt, regular
Public Property
Static Member
Standard
SystemFonts.CaptionFont, 8pt, regular
Public Property
Static Member
StandardAdjusted
SystemFonts.CaptionFont, 8pt, regular, adjusted for logical pixel size.
Public Property
Static Member
StandardBold
SystemFonts.CaptionFont, 8pt, bold
Public Property
Static Member
StandardItalic
SystemFonts.CaptionFont, 8pt, italic
Methods
Name
Description
Public Method
Static Member
FontToString
Convert a font to a string.
Public Method
Static Member
MeasureString(String, Font)
Measure the size of a string
Public Method
Static Member
MeasureString(String, Font, SizeF)
Measure the size of a string
Public Method
Static Member
MeasureString(String, Font, Single)
Measure the size of a string
Public Method
Static Member
NewFont(Font, FontStyle)
Safe font constructor.
Public Method
Static Member
NewFont(Font, Single)
Safe font constructor.
Public Method
Static Member
NewFont(FontFamily, Single)
Safe font constructor.
Public Method
Static Member
NewFont(Font, Single, FontStyle)
Safe font constructor.
Public Method
Static Member
NewFont(FontFamily, Single, FontStyle)
Safe font constructor.
Public Method
Static Member
NewFont(String, Single, FontStyle)
High level function for Font creation. We’ve ran into loads of trouble in the past with missing Fonts. Never create a font directly via GDI+, always use this method.
Public Method
Static Member
StringToFont
Convert a font description string back into a font.
Public Method
Static Member
StringWidth(IEnumerable.String., Font)
Measure the maximum width of a collection of strings
Public Method
Static Member
StringWidth(String, Font)
Measure the width of a string in pixels
Events
Name
Description
Public Event
Static Member
ConsoleFamilyChanged
Raised whenever the MonospacedFamily is changed.
Public Event
Static Member
ScriptFamilyChanged
Raised whenever the ScriptFamily is changed.
Public Event
Static Member
StandardFamilyChanged
Raised whenever the StandardFamily is changed.