org.apache.fop.fonts.truetype

## Class GlyfTable

- java.lang.Object
- - org.apache.fop.fonts.truetype.GlyfTable

-     public class GlyfTable
      extends Object

  This "glyf" table in a TrueType font file contains information that describes the glyphs. This class is responsible for creating a subset of the "glyf" table given a set of glyph indices.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GlyfTable.GlyfFlags`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Set<Integer>` | `composedGlyphs` All the glyphs that are composed, but do not appear in the subset.
    `protected Set<Integer>` | `compositeGlyphs` All the composite glyphs that appear in the subset.
    `protected Map<Integer,Integer>` | `subset`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GlyfTable(FontFileReader in, OFMtxEntry[] metrics, OFDirTabEntry dirTableEntry, Map<Integer,Integer> glyphs)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addAllComposedGlyphsToSubset()` Adds to the subset, all the glyphs that are composed by a glyph, but do not appear themselves in the subset.
    `boolean` | `isComposite(int indexInOriginal)`
    `protected void` | `populateGlyphsWithComposites()` Populates the map of subset glyphs with all the glyphs that compose the glyphs in the subset.
    `Set<Integer>` | `retrieveComposedGlyphs(int indexInOriginal)` Reads a composite glyph at a given index and retrieves all the glyph indices of contingent composed glyphs.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### subset

          protected final Map<Integer,Integer> subset

    - #### compositeGlyphs

          protected Set<Integer> compositeGlyphs

      All the composite glyphs that appear in the subset.

    - #### composedGlyphs

          protected Set<Integer> composedGlyphs

      All the glyphs that are composed, but do not appear in the subset.

  - ### Constructor Detail

    - #### GlyfTable

          public GlyfTable(FontFileReader in,
                           OFMtxEntry[] metrics,
                           OFDirTabEntry dirTableEntry,
                           Map<Integer,Integer> glyphs)
                    throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### populateGlyphsWithComposites

          protected void populateGlyphsWithComposites()
                                               throws IOException

      Populates the map of subset glyphs with all the glyphs that compose the glyphs in the subset. This also re-maps the indices of composed glyphs to their new index in the subset font.
      Throws:
        `IOException` - an I/O error

    - #### addAllComposedGlyphsToSubset

          protected void addAllComposedGlyphsToSubset()

      Adds to the subset, all the glyphs that are composed by a glyph, but do not appear themselves in the subset.

    - #### isComposite

          public boolean isComposite(int indexInOriginal)
                              throws IOException

      Throws:
        `IOException`

    - #### retrieveComposedGlyphs

          public Set<Integer> retrieveComposedGlyphs(int indexInOriginal)
                                              throws IOException

      Reads a composite glyph at a given index and retrieves all the glyph indices of contingent composed glyphs.
      Parameters:
        `indexInOriginal` - the glyph index of the composite glyph
      Returns:
        the set of glyph indices this glyph composes
      Throws:
        `IOException` - an I/O error

Copyright © 2025 Apache Software Foundation. All rights reserved.