Class FontSourceBase

FontSourceBase class

This is an abstract base class for the classes that allow the user to specify various font sources

public abstract class FontSourceBase

Properties

NameDescription
abstract Type { get; }Returns the type of the font source.

Examples

// Called: FontConfigs.SetFontSources(new FontSourceBase[] { folderFontSource });
public static void Type_FontSourceBase()
        {
            // Create an instance of FolderFontSource
            string folderPath = @"C:\Fonts";
            bool scanSubfolders = true;
            FolderFontSource folderFontSource = new FolderFontSource(folderPath, scanSubfolders);

            // Accessing properties
            Console.WriteLine("Folder Path: " + folderFontSource.FolderPath);
            Console.WriteLine("Scan Subfolders: " + folderFontSource.ScanSubFolders);
            Console.WriteLine("Font Source Type: " + folderFontSource.Type);

            // Create a workbook and set the font sources
            Workbook workbook = new Workbook();
            FontConfigs.SetFontSources(new FontSourceBase[] { folderFontSource });

            // Save the workbook
            workbook.Save("FolderFontSourceExample.xlsx");
            workbook.Save("FolderFontSourceExample.pdf");
            return;
        }

See Also