public class FontSourceType
extends java.lang.Object
Examples:
Shows how to use a font file in the local file system as a font source.
FileFontSource fileFontSource = new FileFontSource(getMyDir() + "Alte DIN 1451 Mittelschrift.ttf", 0);
Document doc = new Document();
doc.setFontSettings(new FontSettings());
doc.getFontSettings().setFontsSources(new FontSourceBase[]{fileFontSource});
Assert.assertEquals(getMyDir() + "Alte DIN 1451 Mittelschrift.ttf", fileFontSource.getFilePath());
Assert.assertEquals(FontSourceType.FONT_FILE, fileFontSource.getType());
Assert.assertEquals(0, fileFontSource.getPriority());
| Modifier and Type | Field and Description |
|---|---|
static int |
FONT_FILE
A
FileFontSource object that represents single font file. |
static int |
FONT_STREAM
A
StreamFontSource object that represents a stream with font data. |
static int |
FONTS_FOLDER
A
FolderFontSource object that represents folder with font files. |
static int |
length |
static int |
MEMORY_FONT
A
MemoryFontSource object that represents single font in memory. |
static int |
SYSTEM_FONTS
A
SystemFontSource object that represents all fonts installed to the system. |
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String fontSourceTypeName) |
static java.lang.String |
getName(int fontSourceType) |
static int[] |
getValues() |
static java.lang.String |
toString(int fontSourceType) |
public static int FONT_FILE
FileFontSource object that represents single font file.public static int FONTS_FOLDER
FolderFontSource object that represents folder with font files.public static int MEMORY_FONT
MemoryFontSource object that represents single font in memory.public static int SYSTEM_FONTS
SystemFontSource object that represents all fonts installed to the system.public static int FONT_STREAM
StreamFontSource object that represents a stream with font data.public static int length