Table of Contents

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

string

FontResolvers

Collection of font resolvers that return typefaces from font names and style information

public static List<IFontResolver> FontResolvers { get; }

Property Value

List<IFontResolver>

Monospace

Name of a monospace font present on the system

public static string Monospace { get; set; }

Property Value

string

Sans

Name of a sans-serif font present on the system

public static string Sans { get; set; }

Property Value

string

Serif

Name of a serif font present on the system

public static string Serif { get; set; }

Property Value

string

System

Default system font name

public static string System { get; }

Property Value

string

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

name string
path string
bold bool
italic bool

ConvertStringToTextElements(string)

public static List<string> ConvertStringToTextElements(string textString)

Parameters

textString string

Returns

List<string>

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

textElement string

Returns

List<int>

CountMissingGlyphs(string, List<int>)

public static int CountMissingGlyphs(string fontName, List<int> standaloneCodePoints)

Parameters

fontName string
standaloneCodePoints List<int>

Returns

int

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

text string

Returns

string

Exists(string)

[Obsolete("To determine if a font exists, call GetTypeface() and check for null", true)]
public static bool Exists(string fontName)

Parameters

fontName string

Returns

bool

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

fontName string
bold bool
italic bool

Returns

bool

GetCandidateFontsForString(List<int>)

public static List<string> GetCandidateFontsForString(List<int> standaloneCodePoints)

Parameters

standaloneCodePoints List<int>

Returns

List<string>

GetDefaultFontFamily()

public static string GetDefaultFontFamily()

Returns

string

GetStandaloneCodePoints(IEnumerable<List<int>>)

public static List<int> GetStandaloneCodePoints(IEnumerable<List<int>> codePointLists)

Parameters

codePointLists IEnumerable<List<int>>

Returns

List<int>

GetStandaloneCodePoints(string)

public static List<int> GetStandaloneCodePoints(string inputText)

Parameters

inputText string

Returns

List<int>

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

fontName string
bold bool
italic bool

Returns

SKTypeface