FolderFontSource

FolderFontSource(string, bool)

Ctor.

public FolderFontSource(string folderPath, bool scanSubfolders)
ParameterTypBeskrivning
folderPathStringSökväg till mapp.
scanSubfoldersBooleanBestämmer om undermappar ska skannas eller inte.

Exempel

Visar hur man använder en lokal systemmapp som innehåller teckensnitt som teckensnittskälla.

// Skapa en teckensnittskälla från en mapp som innehåller teckensnittsfiler.
FolderFontSource folderFontSource = new FolderFontSource(FontsDir, false, 1);

Document doc = new Document();
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] {folderFontSource});

Assert.AreEqual(FontsDir, folderFontSource.FolderPath);
Assert.AreEqual(false, folderFontSource.ScanSubfolders);
Assert.AreEqual(FontSourceType.FontsFolder, folderFontSource.Type);
Assert.AreEqual(1, folderFontSource.Priority);

Se även


FolderFontSource(string, bool, int)

Ctor.

public FolderFontSource(string folderPath, bool scanSubfolders, int priority)
ParameterTypBeskrivning
folderPathStringSökväg till mapp.
scanSubfoldersBooleanBestämmer om undermappar ska skannas eller inte.
priorityInt32Teckensnittskällas prioritet. Se denPriority fastighetsbeskrivning för mer information.

Exempel

Visar hur man använder en lokal systemmapp som innehåller teckensnitt som teckensnittskälla.

// Skapa en teckensnittskälla från en mapp som innehåller teckensnittsfiler.
FolderFontSource folderFontSource = new FolderFontSource(FontsDir, false, 1);

Document doc = new Document();
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] {folderFontSource});

Assert.AreEqual(FontsDir, folderFontSource.FolderPath);
Assert.AreEqual(false, folderFontSource.ScanSubfolders);
Assert.AreEqual(FontSourceType.FontsFolder, folderFontSource.Type);
Assert.AreEqual(1, folderFontSource.Priority);

Se även