Class GlyfTable
java.lang.Object
org.docx4j.fonts.fop.fonts.truetype.GlyfTable
public class GlyfTable
extends java.lang.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.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.Integer>composedGlyphsAll the glyphs that are composed, but do not appear in the subset.protected java.util.Map<java.lang.Integer,java.lang.Integer>subset -
Constructor Summary
Constructors Constructor Description GlyfTable(FontFileReader in, OFMtxEntry[] metrics, OFDirTabEntry dirTableEntry, java.util.Map<java.lang.Integer,java.lang.Integer> glyphs) -
Method Summary
Modifier and Type Method Description protected voidaddAllComposedGlyphsToSubset()Adds to the subset, all the glyphs that are composed by a glyph, but do not appear themselves in the subset.booleanisComposite(int indexInOriginal)protected voidpopulateGlyphsWithComposites()Populates the map of subset glyphs with all the glyphs that compose the glyphs in the subset.java.util.Set<java.lang.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 Details
-
subset
protected final java.util.Map<java.lang.Integer,java.lang.Integer> subset -
composedGlyphs
protected java.util.Set<java.lang.Integer> composedGlyphsAll the glyphs that are composed, but do not appear in the subset.
-
-
Constructor Details
-
GlyfTable
public GlyfTable(FontFileReader in, OFMtxEntry[] metrics, OFDirTabEntry dirTableEntry, java.util.Map<java.lang.Integer,java.lang.Integer> glyphs) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
populateGlyphsWithComposites
protected void populateGlyphsWithComposites() throws java.io.IOExceptionPopulates 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:
java.io.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 java.io.IOException- Throws:
java.io.IOException
-
retrieveComposedGlyphs
public java.util.Set<java.lang.Integer> retrieveComposedGlyphs(int indexInOriginal) throws java.io.IOExceptionReads 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:
java.io.IOException- an I/O error
-