StandardFonts
Provides access to the default fonts used in Grasshopper.
Properties
PixelsPerPoint
#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
#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.
Parameters:
| size (FontSize = FontSize.Normal) | Size of font. 10 is recommended for UI use. |
| style (FontStyle = FontStyle.None) | Style of font, none is recommended. |
Sans
#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.
Parameters:
| size (FontSize = FontSize.Normal) | Size of font. 10 is recommended for UI use. |
| style (FontStyle = FontStyle.None) | Style of font, none is recommended. |
Script
#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.
Parameters:
| size (FontSize = FontSize.Normal) | Size of font. |
| style (FontStyle = FontStyle.None) | Style of font. |
Serif
#The default serif font to use. Do not dispose this font as it may be shared amongst many instances.
Parameters:
| size (FontSize = FontSize.Normal) | |
| style (FontStyle = FontStyle.None) |
SetMonoCascade
#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.
Parameters:
| families (params string[]) | Font family names to use (in order of most preferred to least preferred) for the monospaced fonts in Grasshopper. |
SetSansSerifCascade
#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.
Parameters:
| families (params string[]) | Font family names to use (in order of most preferred to least preferred) for the sans-serif fonts in Grasshopper. |
SetScriptCascade
#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.
Parameters:
| families (params string[]) | Font family names to use (in order of most preferred to least preferred) for the script fonts in Grasshopper. |
SetSerifCascade
#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.
Parameters:
| families (params string[]) | Font family names to use (in order of most preferred to least preferred) for the serif fonts in Grasshopper. |