类 FontFactory
java.lang.Object
com.google.typography.font.sfntly.FontFactory
The font factory. This is the root class for the creation and loading of
fonts.
- 作者:
- Stuart Gill
-
嵌套类概要
嵌套类修饰符和类型类说明private static enum
Offsets to specific elements in the underlying data. -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static boolean
private static boolean
private static Font[]
private static Font[]
private static Font.Builder[]
private static Font.Builder[]
static Font[]
loadFonts
(byte[] b) Load the font(s) from the byte array.static Font[]
loadFonts
(InputStream is) Load the font(s) from the input stream.static Font.Builder[]
Load the font(s) from the input stream into font builders.private static Font
private static Font
private static Font.Builder
loadSingleOTFForBuilding
(WritableFontData wfd, int offsetToOffsetTable) private static Font.Builder
static Font.Builder
Get an empty font builder for creating a new font from scratch.static void
serializeFont
(Font font, OutputStream os) Serialize the font to the output stream.static void
serializeFont
(Font font, OutputStream os, List<Integer> tableOrdering) Serialize the font to the output stream.
-
字段详细资料
-
LOOKAHEAD_SIZE
private static final int LOOKAHEAD_SIZE- 另请参阅:
-
-
构造器详细资料
-
FontFactory
private FontFactory()Constructor.
-
-
方法详细资料
-
loadFonts
Load the font(s) from the input stream. The current settings on the factory are used during the loading process. One or more fonts are returned if the stream contains valid font data. Some font container formats may have more than one font and in this case multiple font objects will be returned. If the data in the stream cannot be parsed or is invalid an array of size zero will be returned.- 参数:
is
- the input stream font data- 返回:
- one or more fonts
- 抛出:
IOException
-
loadFontsForBuilding
Load the font(s) from the input stream into font builders. The current settings on the factory are used during the loading process. One or more font builders are returned if the stream contains valid font data. Some font container formats may have more than one font and in this case multiple font builder objects will be returned. If the data in the stream cannot be parsed or is invalid an array of size zero will be returned.- 参数:
is
- the input stream font data- 返回:
- one or more font builders
- 抛出:
IOException
-
loadSingleOTF
- 抛出:
IOException
-
loadCollection
- 抛出:
IOException
-
loadSingleOTFForBuilding
- 抛出:
IOException
-
loadCollectionForBuilding
- 抛出:
IOException
-
isCollection
- 抛出:
IOException
-
loadFonts
Load the font(s) from the byte array. The current settings on the factory are used during the loading process. One or more fonts are returned if the stream contains valid font data. Some font container formats may have more than one font and in this case multiple font objects will be returned. If the data in the stream cannot be parsed or is invalid an array of size zero will be returned.- 参数:
b
- the font data- 返回:
- one or more fonts
- 抛出:
IOException
-
loadSingleOTF
- 抛出:
IOException
-
loadCollection
- 抛出:
IOException
-
loadSingleOTFForBuilding
private static Font.Builder loadSingleOTFForBuilding(WritableFontData wfd, int offsetToOffsetTable) throws IOException - 抛出:
IOException
-
loadCollectionForBuilding
- 抛出:
IOException
-
isCollection
-
serializeFont
Serialize the font to the output stream.- 参数:
font
- the font to serializeos
- the destination stream for the font- 抛出:
IOException
-
serializeFont
public static void serializeFont(Font font, OutputStream os, List<Integer> tableOrdering) throws IOException Serialize the font to the output stream.- 参数:
font
- the font to serializeos
- the destination stream for the fonttableOrdering
-- 抛出:
IOException
-
newFontBuilder
Get an empty font builder for creating a new font from scratch.- 返回:
- an empty font builder
-