Class Fonts
- Namespace
- ScottPlot
- Assembly
- ScottPlot.dll
Cross-platform tools for working with fonts
public static class Fonts
- Inheritance
-
Fonts
- Inherited Members
Properties
Default
This font is used for almost all text rendering.
public static string Default { get; set; }
Property Value
DefaultFontStyle
public static SKTypeface? DefaultFontStyle { get; set; }
Property Value
DefaultSlant
public static FontSlant? DefaultSlant { get; set; }
Property Value
DefaultWeight
public static FontWeight? DefaultWeight { get; set; }
Property Value
DefaultWidth
public static FontSpacing? DefaultWidth { get; set; }
Property Value
FontResolvers
Collection of font resolvers that return typefaces from font names and style information
public static List<IFontResolver> FontResolvers { get; }
Property Value
Monospace
Name of a monospace font present on the system
public static string Monospace { get; set; }
Property Value
Sans
Name of a sans-serif font present on the system
public static string Sans { get; set; }
Property Value
Serif
Name of a serif font present on the system
public static string Serif { get; set; }
Property Value
System
Default system font name
public static string System { get; }
Property Value
Methods
AddFontFile(string, string, bool, bool)
Add a font resolver that creates a typeface from a TTF file
public static void AddFontFile(string name, string path, bool bold = false, bool italic = false)
Parameters
ConvertStringToTextElements(string)
public static List<string> ConvertStringToTextElements(string textString)
Parameters
textStringstring
Returns
ConvertTextElementToUtf32CodePoints(string)
Take a single text element ("grapheme cluster") as input, and return one or more Unicode code points. The code points are represented with signed ints since that is idiomatic for C#, even though they are always unsigned values.
public static List<int> ConvertTextElementToUtf32CodePoints(string textElement)
Parameters
textElementstring
Returns
CountMissingGlyphs(string, List<int>)
public static int CountMissingGlyphs(string fontName, List<int> standaloneCodePoints)
Parameters
Returns
Detect(string)
Use the characters in the string to determine an installed system font most likely to support this character set. Returns the system Default font if an ideal font cannot be determined.
public static string Detect(string text)
Parameters
textstring
Returns
Exists(string)
[Obsolete("To determine if a font exists, call GetTypeface() and check for null", true)]
public static bool Exists(string fontName)
Parameters
fontNamestring
Returns
Exists(string, bool, bool)
[Obsolete("To determine if a font exists, call GetTypeface() and check for null", true)]
public static bool Exists(string fontName, bool bold, bool italic)
Parameters
Returns
GetCandidateFontsForString(List<int>)
public static List<string> GetCandidateFontsForString(List<int> standaloneCodePoints)
Parameters
Returns
GetDefaultFontFamily()
public static string GetDefaultFontFamily()
Returns
GetStandaloneCodePoints(IEnumerable<List<int>>)
public static List<int> GetStandaloneCodePoints(IEnumerable<List<int>> codePointLists)
Parameters
codePointListsIEnumerable<List<int>>
Returns
GetStandaloneCodePoints(string)
public static List<int> GetStandaloneCodePoints(string inputText)
Parameters
inputTextstring
Returns
GetTypeface(string, FontWeight, FontSlant, FontSpacing)
Returns a typeface for the requested font name and style. A cached typeface will be used if it exists, otherwise one will be created, cached, and returned.
public static SKTypeface GetTypeface(string fontName, FontWeight weight, FontSlant slant, FontSpacing spacing)
Parameters
fontNamestringweightFontWeightslantFontSlantspacingFontSpacing
Returns
GetTypeface(string, bool, bool)
Returns a typeface for the requested font name and style. A cached typeface will be used if it exists, otherwise one will be created, cached, and returned.
public static SKTypeface GetTypeface(string fontName, bool bold, bool italic)
Parameters
Returns
GetTypeface(string, bool, bool, FontSpacing)
public static SKTypeface GetTypeface(string fontName, bool bold, bool italic, FontSpacing width)
Parameters
fontNamestringboldboolitalicboolwidthFontSpacing
Returns
Reset()
public static void Reset()