类 GlyphRenumberer

java.lang.Object
com.google.typography.font.tools.subsetter.GlyphRenumberer

public class GlyphRenumberer extends Object
A utility class for applying a mapping to glyph number references within a TrueType composite glyph object.
作者:
Raph Levien
  • 构造器详细资料

    • GlyphRenumberer

      public GlyphRenumberer()
  • 方法详细资料

    • renumberGlyph

      public static ReadableFontData renumberGlyph(ReadableFontData glyph, Map<Integer,Integer> mapping)
      Apply a renumbering referenced glyphs in TrueType glyph data. Note that this method has a low level interface (bytes) for efficiency, as, in many cases the glyph data does not need to be fully parsed. We should benchmark this implementation against one written in terms of a higher level interface and measure the actual performance gain - if not significant, this implementation should be scrapped in favor of the higher level one.
      参数:
      glyph -
      mapping -
      返回:
      renumbered glyph data
    • isCompositeGlyph

      private static boolean isCompositeGlyph(ReadableFontData glyph)
      Determine whether the glyph data is a composite glyph. Should always give the same answer as parsedGlyph instanceof GlyphTable.CompositeGlyph, but faster.
      参数:
      glyph -
      返回:
      true if glyph is composite
    • renumberCompositeGlyph

      private static ReadableFontData renumberCompositeGlyph(ReadableFontData glyph, Map<Integer,Integer> mapping)
    • compositeReferenceSize

      private static int compositeReferenceSize(int flags)
      Compute the size, in bytes, of a single composite reference.