FontSourceType

Inheritance: java.lang.Object

public class FontSourceType

Specifies the type of a 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

FieldDescription
FONTS_FOLDERA FolderFontSource object that represents folder with font files.
FONT_FILEA FileFontSource object that represents single font file.
FONT_STREAMA StreamFontSource object that represents a stream with font data.
MEMORY_FONTA MemoryFontSource object that represents single font in memory.
SYSTEM_FONTSA SystemFontSource object that represents all fonts installed to the system.
length

Methods

MethodDescription
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:

ParameterTypeDescription
fontSourceTypeNamejava.lang.String

Returns: int

getName(int fontSourceType)

public static String getName(int fontSourceType)

Parameters:

ParameterTypeDescription
fontSourceTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int fontSourceType)

public static String toString(int fontSourceType)

Parameters:

ParameterTypeDescription
fontSourceTypeint

Returns: java.lang.String