FontSourceType
Contents
[
Hide
]Inheritance: java.lang.Object
public class FontSourceType
Specifies the type of font source.
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());
Fields
Field | Description |
---|---|
FONTS_FOLDER | A FolderFontSource object that represents folder with font files. |
FONT_FILE | A FileFontSource object that represents single font file. |
FONT_STREAM | A StreamFontSource object that represents a stream with font data. |
MEMORY_FONT | A MemoryFontSource object that represents single font in memory. |
SYSTEM_FONTS | A SystemFontSource object that represents all fonts installed to the system. |
length |
Methods
Method | Description |
---|---|
fromName(String fontSourceTypeName) | |
getName(int fontSourceType) | |
getValues() | |
toString(int fontSourceType) |
FONTS_FOLDER
public static int FONTS_FOLDER
A FolderFontSource object that represents folder with font files.
FONT_FILE
public static int FONT_FILE
A FileFontSource object that represents single font file.
FONT_STREAM
public static int FONT_STREAM
A StreamFontSource object that represents a stream with font data.
MEMORY_FONT
public static int MEMORY_FONT
A MemoryFontSource object that represents single font in memory.
SYSTEM_FONTS
public static int SYSTEM_FONTS
A SystemFontSource object that represents all fonts installed to the system.
length
public static int length
fromName(String fontSourceTypeName)
public static int fromName(String fontSourceTypeName)
Parameters:
Parameter | Type | Description |
---|---|---|
fontSourceTypeName | java.lang.String |
Returns: int
getName(int fontSourceType)
public static String getName(int fontSourceType)
Parameters:
Parameter | Type | Description |
---|---|---|
fontSourceType | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int fontSourceType)
public static String toString(int fontSourceType)
Parameters:
Parameter | Type | Description |
---|---|---|
fontSourceType | int |
Returns: java.lang.String