类 FontData
java.lang.Object
com.google.typography.font.sfntly.data.FontData
- 直接已知子类:
ReadableFontData
An abstract base for font data in the TrueType / OpenType spec.
- 作者:
- Stuart Gill
-
嵌套类概要
嵌套类修饰符和类型类说明static enum
Note: Enum names intended to match the names used in the OpenType and sfnt specs. -
字段概要
字段修饰符和类型字段说明The internal data.private int
The length of the bound on the internal byte array.private int
Offset to apply as a lower bound on the internal byte array.protected static final int
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
bound
(int offset) Sets limits on the size of the FontData.boolean
bound
(int offset, int length) Sets limits on the size of the FontData.protected final int
boundLength
(int offset, int length) Gets the length in the underlying data taking into account any bounds on the data.protected final int
boundOffset
(int offset) Gets the offset in the underlying data taking into account any bounds on the data.protected final boolean
boundsCheck
(int offset, int length) final int
Returns the offset in the underlying data taking into account any bounds on the data.int
length()
Gets the length of the data.int
size()
Gets the maximum size of the FontData.abstract FontData
slice
(int offset) Makes a bottom bound only slice of this array.abstract FontData
slice
(int offset, int length) Makes a slice of this FontData.
-
字段详细资料
-
GROWABLE_SIZE
protected static final int GROWABLE_SIZE- 另请参阅:
-
array
The internal data. -
boundOffset
private int boundOffsetOffset to apply as a lower bound on the internal byte array. -
boundLength
private int boundLengthThe length of the bound on the internal byte array.
-
-
构造器详细资料
-
FontData
Constructor.- 参数:
ba
- the byte array to use for the backing data
-
FontData
Constructor.- 参数:
data
- the data to wrapoffset
- the offset to start the wrap fromlength
- the length of the data wrapped
-
FontData
Constructor.- 参数:
data
- the data to wrapoffset
- the offset to start the wrap from
-
-
方法详细资料
-
bound
public boolean bound(int offset, int length) Sets limits on the size of the FontData. The FontData is then only visible within the bounds set.- 参数:
offset
- the start of the new boundslength
- the number of bytes in the bounded array- 返回:
- true if the bounding range was successful; false otherwise
-
bound
public boolean bound(int offset) Sets limits on the size of the FontData. This is an offset bound only so if the FontData is writable and growable then there is no limit to that growth from the bounding operation.- 参数:
offset
- the start of the new bounds which must be within the current size of the FontData- 返回:
- true if the bounding range was successful; false otherwise
-
slice
Makes a slice of this FontData. The returned slice will share the data with the originalFontData
.- 参数:
offset
- the start of the slicelength
- the number of bytes in the slice- 返回:
- a slice of the original FontData
-
slice
Makes a bottom bound only slice of this array. The returned slice will share the data with the originalFontData
.- 参数:
offset
- the start of the slice- 返回:
- a slice of the original FontData
-
length
public int length()Gets the length of the data.- 返回:
- the length of the data
-
size
public int size()Gets the maximum size of the FontData. This is the maximum number of bytes that the font data can hold and all of it may not be filled with data or even fully allocated yet.- 返回:
- the maximum size of this font data
-
dataOffset
public final int dataOffset()Returns the offset in the underlying data taking into account any bounds on the data.- 返回:
-
boundOffset
protected final int boundOffset(int offset) Gets the offset in the underlying data taking into account any bounds on the data.- 参数:
offset
- the offset to get the bound compensated offset for- 返回:
- the bound compensated offset
-
boundLength
protected final int boundLength(int offset, int length) Gets the length in the underlying data taking into account any bounds on the data.- 参数:
offset
- the offset that the length is being used atlength
- the length to get the bound compensated length for- 返回:
- the bound compensated length
-
boundsCheck
protected final boolean boundsCheck(int offset, int length)
-