类 FontData

java.lang.Object
com.google.typography.font.sfntly.data.FontData
直接已知子类:
ReadableFontData

public abstract class FontData extends Object
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.
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final ByteArray<? extends ByteArray<?>>
    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
     
  • 构造器概要

    构造器
    限定符
    构造器
    说明
    protected
    FontData(ByteArray<? extends ByteArray<?>> ba)
    Constructor.
    protected
    FontData(FontData data, int offset)
    Constructor.
    protected
    FontData(FontData data, int offset, int length)
    Constructor.
  • 方法概要

    修饰符和类型
    方法
    说明
    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
    Gets the length of the data.
    int
    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.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • GROWABLE_SIZE

      protected static final int GROWABLE_SIZE
      另请参阅:
    • array

      protected final ByteArray<? extends ByteArray<?>> array
      The internal data.
    • boundOffset

      private int boundOffset
      Offset to apply as a lower bound on the internal byte array.
    • boundLength

      private int boundLength
      The length of the bound on the internal byte array.
  • 构造器详细资料

    • FontData

      protected FontData(ByteArray<? extends ByteArray<?>> ba)
      Constructor.
      参数:
      ba - the byte array to use for the backing data
    • FontData

      protected FontData(FontData data, int offset, int length)
      Constructor.
      参数:
      data - the data to wrap
      offset - the offset to start the wrap from
      length - the length of the data wrapped
    • FontData

      protected FontData(FontData data, int offset)
      Constructor.
      参数:
      data - the data to wrap
      offset - 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 bounds
      length - 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

      public abstract FontData slice(int offset, int length)
      Makes a slice of this FontData. The returned slice will share the data with the original FontData.
      参数:
      offset - the start of the slice
      length - the number of bytes in the slice
      返回:
      a slice of the original FontData
    • slice

      public abstract FontData slice(int offset)
      Makes a bottom bound only slice of this array. The returned slice will share the data with the original FontData.
      参数:
      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 at
      length - the length to get the bound compensated length for
      返回:
      the bound compensated length
    • boundsCheck

      protected final boolean boundsCheck(int offset, int length)