类 Font.Builder
java.lang.Object
com.google.typography.font.sfntly.Font.Builder
- 封闭类:
Font
A builder for a font object. The builder allows the for the creation of
immutable
Font
objects. The builder is a one use non-thread safe
object and cnce the Font
object has been created it is no longer
usable. To create a further Font
object new builder will be
required.- 作者:
- Stuart Gill
-
字段概要
字段修饰符和类型字段说明private Map<Header,
WritableFontData> private byte[]
private int
private int
private int
private int
private int
private Map<Integer,
Table.Builder<? extends Table>> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()
Build theFont
.private Map<Integer,
Table.Builder<? extends Table>> buildAllTableBuilders
(Map<Header, WritableFontData> tableData) buildTablesFromBuilders
(Font font, Map<Integer, Table.Builder<? extends Table>> builderMap) void
Clear all table builders.(专用程序包) static final Font.Builder
(专用程序包) static final Font.Builder
getOTFBuilder
(WritableFontData wfd, int offsetToOffsetTable) (专用程序包) static final Font.Builder
Table.Builder<? extends Table>
getTableBuilder
(int tag) Get the table builder for the given tag.private Table.Builder<? extends Table>
getTableBuilder
(Header header, WritableFontData data) boolean
hasTableBuilder
(int tag) Does this font builder have the specified table builder.private static void
interRelateBuilders
(Map<Integer, Table.Builder<? extends Table>> builderMap) private void
loadFont
(WritableFontData wfd, int offsetToOffsetTable) private void
loadFont
(InputStream is) private Map<Header,
WritableFontData> loadTableData
(SortedSet<Header> headers, FontInputStream is) private Map<Header,
WritableFontData> loadTableData
(SortedSet<Header> headers, WritableFontData fd) Table.Builder<? extends Table>
newTableBuilder
(int tag) Creates a new empty table builder for the table type given by the table id tag.Table.Builder<? extends Table>
newTableBuilder
(int tag, ReadableFontData srcData) Creates a new table builder for the table type given by the table id tag.readHeader
(ReadableFontData fd, int offset) boolean
Is the font ready to build?Table.Builder<? extends Table>
removeTableBuilder
(int tag) Remove the specified table builder from the font builder.void
setDigest
(byte[] digest) Set a unique fingerprint for the font object.private int
int
Get the number of table builders in the font builder.Map<Integer,
Table.Builder<? extends Table>> Get a map of the table builders in this font builder accessed by table tag.
-
字段详细资料
-
tableBuilders
-
sfntVersion
private int sfntVersion -
numTables
private int numTables -
searchRange
private int searchRange -
entrySelector
private int entrySelector -
rangeShift
private int rangeShift -
dataBlocks
-
digest
private byte[] digest
-
-
构造器详细资料
-
Builder
private Builder()
-
-
方法详细资料
-
loadFont
- 抛出:
IOException
-
loadFont
- 抛出:
IOException
-
getOTFBuilder
- 抛出:
IOException
-
getOTFBuilder
static final Font.Builder getOTFBuilder(WritableFontData wfd, int offsetToOffsetTable) throws IOException - 抛出:
IOException
-
getOTFBuilder
-
readyToBuild
public boolean readyToBuild()Is the font ready to build?- 返回:
- true if ready to build; false otherwise
-
build
Build theFont
. After this call this builder will no longer be usable.- 返回:
- a
Font
-
setDigest
public void setDigest(byte[] digest) Set a unique fingerprint for the font object.- 参数:
digest
- a unique identifier for the font
-
clearTableBuilders
public void clearTableBuilders()Clear all table builders. -
hasTableBuilder
public boolean hasTableBuilder(int tag) Does this font builder have the specified table builder.- 参数:
tag
- the table builder tag- 返回:
- true if there is a builder for that table; false otherwise
-
getTableBuilder
Get the table builder for the given tag. If there is no builder for that tag then return a null.- 参数:
tag
- the table builder tag- 返回:
- the builder for the tag; null if there is no builder for that tag
-
newTableBuilder
Creates a new empty table builder for the table type given by the table id tag. This new table will be added to the font and will replace any existing builder for that table.- 参数:
tag
-- 返回:
- new empty table of the type specified by tag; if tag is not known then a generic OpenTypeTable is returned
-
newTableBuilder
Creates a new table builder for the table type given by the table id tag. It makes a copy of the data provided and uses that copy for the table. This new table has been added to the font and will replace any existing builder for that table.- 参数:
tag
-srcData
-- 返回:
- new empty table of the type specified by tag; if tag is not known then a generic OpenTypeTable is returned
-
tableBuilderMap
Get a map of the table builders in this font builder accessed by table tag.- 返回:
- an unmodifiable view of the table builders in this font builder
-
removeTableBuilder
Remove the specified table builder from the font builder.- 参数:
tag
- the table builder to remove- 返回:
- the table builder removed
-
tableBuilderCount
public int tableBuilderCount()Get the number of table builders in the font builder.- 返回:
- the number of table builders
-
sfntWrapperSize
private int sfntWrapperSize() -
buildAllTableBuilders
private Map<Integer,Table.Builder<? extends Table>> buildAllTableBuilders(Map<Header, WritableFontData> tableData) -
getTableBuilder
-
buildTablesFromBuilders
-
interRelateBuilders
-
readHeader
- 抛出:
IOException
-
loadTableData
private Map<Header,WritableFontData> loadTableData(SortedSet<Header> headers, FontInputStream is) throws IOException - 抛出:
IOException
-
readHeader
-
loadTableData
-