StandardFonts

public static class StandardFonts
Provides access to the default fonts used in Grasshopper.

Properties

PixelsPerPoint

#
public static float PixelsPerPoint { get; }
Gets the number of logical pixels per typographic point on this platform. Font sizes are in points, which are 96/72 pixels on Windows and a single pixel on macOS. Divide a desired pixel size by this ratio to get a font size that renders identically everywhere.

Methods

Mono

#
public static Font Mono(FontSize size = FontSize.Normal, FontStyle style = FontStyle.None)
The default mono-spaced font to use. This is the recommended font for code blocks or tabular data which requires whitespace for alignment. Do not dispose this font as it may be shared amongst many instances.
size (FontSize = FontSize.Normal)Size of font. 10 is recommended for UI use.
style (FontStyle = FontStyle.None)Style of font, none is recommended.

Sans

#
public static Font Sans(FontSize size = FontSize.Normal, FontStyle style = FontStyle.None)
The default sans-serif font to use. This is the recommended font for UI use and short to medium blocks of text. Do not dispose this font as it may be shared amongst many instances.
size (FontSize = FontSize.Normal)Size of font. 10 is recommended for UI use.
style (FontStyle = FontStyle.None)Style of font, none is recommended.

Script

#
public static Font Script(FontSize size = FontSize.Normal, FontStyle style = FontStyle.None)
The default script or cursive font to use. This is the recommended font for UI elements which are supposed to look detached from the underlying controls.
size (FontSize = FontSize.Normal)Size of font.
style (FontStyle = FontStyle.None)Style of font.

Serif

#
public static Font Serif(FontSize size = FontSize.Normal, FontStyle style = FontStyle.None)
The default serif font to use. Do not dispose this font as it may be shared amongst many instances.
size (FontSize = FontSize.Normal)
style (FontStyle = FontStyle.None)

SetMonoCascade

#
public static void SetMonoCascade(params string[] families)
Use a different monospaced cascade for the rest of this session, bypassing the Settings.TypefaceMono setting. Names which are not installed are skipped, and when none is, Grasshopper's default for the family is used.
families (params string[])Font family names to use (in order of most preferred to least preferred) for the monospaced fonts in Grasshopper.

SetSansSerifCascade

#
public static void SetSansSerifCascade(params string[] families)
Use a different sans-serif cascade for the rest of this session, bypassing the Settings.TypefaceSans setting. Names which are not installed are skipped, and when none is, Grasshopper's default for the family is used.
families (params string[])Font family names to use (in order of most preferred to least preferred) for the sans-serif fonts in Grasshopper.

SetScriptCascade

#
public static void SetScriptCascade(params string[] families)
Use a different script cascade for the rest of this session, bypassing the Settings.TypefaceScript setting. Names which are not installed are skipped, and when none is, Grasshopper's default for the family is used.
families (params string[])Font family names to use (in order of most preferred to least preferred) for the script fonts in Grasshopper.

SetSerifCascade

#
public static void SetSerifCascade(params string[] families)
Use a different serif cascade for the rest of this session, bypassing the Settings.TypefaceSerif setting. Names which are not installed are skipped, and when none is, Grasshopper's default for the family is used.
families (params string[])Font family names to use (in order of most preferred to least preferred) for the serif fonts in Grasshopper.

Size

#
public static float Size(FontSize size)
Get the actual size of a font.
size (FontSize)