• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.Fonts
      • ColorFontSupport
      • Font
      • FontCollection
      • FontDescription
      • FontFamily
      • FontFamilyCollectionExtensions
      • FontInstance
      • FontRectangle
      • FontStyle
      • Glyph
      • GlyphColor
      • GlyphInstance
      • GlyphMetric
      • GlyphRendererParameters
      • GlyphType
      • HorizontalAlignment
      • IColorGlyphRenderer
      • IFontCollection
      • IFontInstance
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • IReadOnlyFontCollection
      • IReadonlyFontCollectionExtensions
      • RendererOptions
      • SystemFonts
      • TextMeasurer
      • TextRenderer
      • VerticalAlignment
    • SixLabors.Fonts.Exceptions
      • FontException
      • FontFamilyNotFoundException
      • GlyphMissingException
      • InvalidFontFileException
      • InvalidFontTableException
      • MissingFontTableException

    Class FontCollection

    Provides a collection of fonts.

    Inheritance
    Object
    FontCollection
    Implements
    IFontCollection
    IReadOnlyFontCollection
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: SixLabors.Fonts
    Assembly: SixLabors.Fonts.dll
    Syntax
    public sealed class FontCollection : IFontCollection, IReadOnlyFontCollection

    Constructors

    | Improve this Doc View Source

    FontCollection()

    Initializes a new instance of the FontCollection class.

    Declaration
    public FontCollection()

    Properties

    | Improve this Doc View Source

    Families

    Gets the collection of FontFamily objects associated with this FontCollection in the invariant culture.

    Declaration
    public IEnumerable<FontFamily> Families { get; }
    Property Value
    Type Description
    IEnumerable<FontFamily>

    The families.

    Methods

    | Improve this Doc View Source

    FamiliesByCulture(CultureInfo)

    Gets the collection of FontFamily objects associated with this FontCollection.

    Declaration
    public IEnumerable<FontFamily> FamiliesByCulture(CultureInfo culture)
    Parameters
    Type Name Description
    CultureInfo culture

    The culture to use while getting the family name from the installed set of fonts.

    Returns
    Type Description
    IEnumerable<FontFamily>

    The set of fonts families using the fonts culture aware font name

    | Improve this Doc View Source

    Find(String)

    Finds the specified font family using the invariant culture font family name.

    Declaration
    public FontFamily Find(string fontFamily)
    Parameters
    Type Name Description
    String fontFamily

    The font family.

    Returns
    Type Description
    FontFamily

    The family if installed otherwise throws FontFamilyNotFoundException

    | Improve this Doc View Source

    Find(String, CultureInfo)

    Finds the specified font family.

    Declaration
    public FontFamily Find(string fontFamily, CultureInfo culture)
    Parameters
    Type Name Description
    String fontFamily

    The font family.

    CultureInfo culture

    The culture to use while getting the family name from the installed set of fonts.

    Returns
    Type Description
    FontFamily

    The family if installed otherwise throws FontFamilyNotFoundException

    | Improve this Doc View Source

    Install(Stream)

    Installs the specified font stream.

    Declaration
    public FontFamily Install(Stream fontStream)
    Parameters
    Type Name Description
    Stream fontStream

    The font stream.

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(Stream, out FontDescription)

    Installs the specified font stream.

    Declaration
    public FontFamily Install(Stream fontStream, out FontDescription fontDescription)
    Parameters
    Type Name Description
    Stream fontStream

    The font stream.

    FontDescription fontDescription

    The font description of the installed font.

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(Stream, CultureInfo)

    Installs the specified font stream.

    Declaration
    public FontFamily Install(Stream fontStream, CultureInfo culture)
    Parameters
    Type Name Description
    Stream fontStream

    The font stream.

    CultureInfo culture

    The culture of the retuend font family

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(Stream, CultureInfo, out FontDescription)

    Installs the specified font stream.

    Declaration
    public FontFamily Install(Stream fontStream, CultureInfo culture, out FontDescription fontDescription)
    Parameters
    Type Name Description
    Stream fontStream

    The font stream.

    CultureInfo culture

    The culture of the retuend font family

    FontDescription fontDescription

    The font description of the installed font.

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(String)

    Installs a font from the specified path.

    Declaration
    public FontFamily Install(string path)
    Parameters
    Type Name Description
    String path

    The path.

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(String, out FontDescription)

    Installs a font from the specified path.

    Declaration
    public FontFamily Install(string path, out FontDescription fontDescription)
    Parameters
    Type Name Description
    String path

    The path.

    FontDescription fontDescription

    The font description of the installed font.

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(String, CultureInfo)

    Installs a font from the specified path.

    Declaration
    public FontFamily Install(string path, CultureInfo culture)
    Parameters
    Type Name Description
    String path

    The path.

    CultureInfo culture

    The culture of the retuend font family

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    Install(String, CultureInfo, out FontDescription)

    Installs a font from the specified path.

    Declaration
    public FontFamily Install(string path, CultureInfo culture, out FontDescription fontDescription)
    Parameters
    Type Name Description
    String path

    The path.

    CultureInfo culture

    The culture of the retuend font family

    FontDescription fontDescription

    The font description of the installed font.

    Returns
    Type Description
    FontFamily

    the description of the font just loaded.

    | Improve this Doc View Source

    InstallCollection(Stream, out IEnumerable<FontDescription>)

    Installs a true type font collection (.ttc) from the specified font collection stream.

    Declaration
    public IEnumerable<FontFamily> InstallCollection(Stream fontCollectionStream, out IEnumerable<FontDescription> fontDescriptions)
    Parameters
    Type Name Description
    Stream fontCollectionStream

    The font stream.

    IEnumerable<FontDescription> fontDescriptions

    The descriptions of fonts installed from the collection.

    Returns
    Type Description
    IEnumerable<FontFamily>

    The font descriptions of the installed fonts.

    | Improve this Doc View Source

    InstallCollection(Stream, CultureInfo, out IEnumerable<FontDescription>)

    Installs a true type font collection (.ttc) from the specified font collection stream.

    Declaration
    public IEnumerable<FontFamily> InstallCollection(Stream fontCollectionStream, CultureInfo culture, out IEnumerable<FontDescription> fontDescriptions)
    Parameters
    Type Name Description
    Stream fontCollectionStream

    The font stream.

    CultureInfo culture

    The culture of the retuend font families

    IEnumerable<FontDescription> fontDescriptions

    The descriptions of fonts installed from the collection.

    Returns
    Type Description
    IEnumerable<FontFamily>

    The font descriptions of the installed fonts.

    | Improve this Doc View Source

    InstallCollection(String)

    Installs a true type font collection (.ttc) from the specified font collection stream.

    Declaration
    public IEnumerable<FontFamily> InstallCollection(string fontCollectionPath)
    Parameters
    Type Name Description
    String fontCollectionPath

    The font collection path (should be typically a .ttc file like simsun.ttc).

    Returns
    Type Description
    IEnumerable<FontFamily>

    The font descriptions of the installed fonts.

    | Improve this Doc View Source

    InstallCollection(String, out IEnumerable<FontDescription>)

    Installs a true type font collection (.ttc) from the specified font collection stream.

    Declaration
    public IEnumerable<FontFamily> InstallCollection(string fontCollectionPath, out IEnumerable<FontDescription> fontDescriptions)
    Parameters
    Type Name Description
    String fontCollectionPath

    The font collection path (should be typically a .ttc file like simsun.ttc).

    IEnumerable<FontDescription> fontDescriptions

    The descriptions of fonts installed from the collection.

    Returns
    Type Description
    IEnumerable<FontFamily>

    The font descriptions of the installed fonts.

    | Improve this Doc View Source

    InstallCollection(String, CultureInfo)

    Installs a true type font collection (.ttc) from the specified font collection stream.

    Declaration
    public IEnumerable<FontFamily> InstallCollection(string fontCollectionPath, CultureInfo culture)
    Parameters
    Type Name Description
    String fontCollectionPath

    The font collection path (should be typically a .ttc file like simsun.ttc).

    CultureInfo culture

    The culture of the retuend font families

    Returns
    Type Description
    IEnumerable<FontFamily>

    The font descriptions of the installed fonts.

    | Improve this Doc View Source

    InstallCollection(String, CultureInfo, out IEnumerable<FontDescription>)

    Installs a true type font collection (.ttc) from the specified font collection stream.

    Declaration
    public IEnumerable<FontFamily> InstallCollection(string fontCollectionPath, CultureInfo culture, out IEnumerable<FontDescription> fontDescriptions)
    Parameters
    Type Name Description
    String fontCollectionPath

    The font collection path (should be typically a .ttc file like simsun.ttc).

    CultureInfo culture

    The culture of the retuend font families

    IEnumerable<FontDescription> fontDescriptions

    The descriptions of fonts installed from the collection.

    Returns
    Type Description
    IEnumerable<FontFamily>

    The font descriptions of the installed fonts.

    | Improve this Doc View Source

    TryFind(String, out FontFamily)

    Finds the specified font family using the invariant culture font family name.

    Declaration
    public bool TryFind(string fontFamily, out FontFamily family)
    Parameters
    Type Name Description
    String fontFamily

    The font family to find.

    FontFamily family

    The found family.

    Returns
    Type Description
    Boolean

    true if a font of that family has been installed into the font collection.

    | Improve this Doc View Source

    TryFind(String, CultureInfo, out FontFamily)

    Finds the specified font family.

    Declaration
    public bool TryFind(string fontFamily, CultureInfo culture, out FontFamily family)
    Parameters
    Type Name Description
    String fontFamily

    The font family to find.

    CultureInfo culture

    The culture to use while getting the family name from the installed set of fonts.

    FontFamily family

    The found family.

    Returns
    Type Description
    Boolean

    true if a font of that family has been installed into the font collection.

    Implements

    IFontCollection
    IReadOnlyFontCollection

    Extension Methods

    IReadonlyFontCollectionExtensions.CreateFont(IReadOnlyFontCollection, String, Single, FontStyle)
    IReadonlyFontCollectionExtensions.CreateFont(IReadOnlyFontCollection, String, Single)
    IReadonlyFontCollectionExtensions.CreateFont(IReadOnlyFontCollection, String, CultureInfo, Single, FontStyle)
    IReadonlyFontCollectionExtensions.CreateFont(IReadOnlyFontCollection, String, CultureInfo, Single)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX