Skip to main content
All docs
V25.1
  • DXFontRepository.GetFonts() Method

    Returns a list of all fonts in DXFontRepository.

    Namespace: DevExpress.Drawing

    Assembly: DevExpress.Drawing.v25.1.dll

    NuGet Package: DevExpress.Drawing

    Declaration

    public IList<DXFontData> GetFonts()

    Returns

    Type Description
    IList<DXFontData>

    A list of DXFontData objects that contain information about fonts in the repository.

    Example

    The following code sample retrieves the names of all fonts in the repository and displays this information in the console window:

    using DevExpress.Drawing;
    using System;
    using System.Collections.Generic;
    // ...
    
    if (DXFontRepository.Instance.IsEmpty)
        Console.WriteLine("Font repository is empty.");
    else
    {
        Console.WriteLine("Font repository contains the following fonts:");
        IList<DXFontData> fonts = DXFontRepository.Instance.GetFonts();
        for (int i = 0; i < fonts.Count; i++)
        {
            Console.WriteLine($"  \u002A {fonts[i].Name}");
        }
    }
    

    The following image demonstrates a sample console output:

    Console Output

    See Also