Class FolderFontSource
Contents
[
Hide
]FolderFontSource class
Represents the folder that contains TrueType font files.
public class FolderFontSource : FontSourceBase
Constructors
Name | Description |
---|---|
FolderFontSource(string, bool) | Ctor. |
Properties
Name | Description |
---|---|
FolderPath { get; } | Path to fonts folder. |
ScanSubFolders { get; } | Determines whether or not to scan the subfolders. |
override Type { get; } | Returns the type of the font source. |
Examples
[C#]
namespace Demos
{
using Aspose.Cells;
using System;
public class FolderFontSourceDemo
{
public static void FolderFontSourceExample()
{
// 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
- class FontSourceBase
- namespace Aspose.Cells
- assembly Aspose.Cells