Package org.apache.fontbox.ttf
Class SubstitutingCmapLookup
- java.lang.Object
-
- org.apache.fontbox.ttf.SubstitutingCmapLookup
-
- All Implemented Interfaces:
CmapLookup
public class SubstitutingCmapLookup extends java.lang.Object implements CmapLookup
A cmap lookup that performs substitution via the 'GSUB' table.
-
-
Field Summary
Fields Modifier and Type Field Description private CmapSubtable
cmap
private java.util.List<java.lang.String>
enabledFeatures
private GlyphSubstitutionTable
gsub
-
Constructor Summary
Constructors Constructor Description SubstitutingCmapLookup(CmapSubtable cmap, GlyphSubstitutionTable gsub, java.util.List<java.lang.String> enabledFeatures)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Integer>
getCharCodes(int gid)
Returns all possible character codes for the given gid, or null if there is none.int
getGlyphId(int characterCode)
Returns the GlyphId linked with the given character code.
-
-
-
Field Detail
-
cmap
private final CmapSubtable cmap
-
gsub
private final GlyphSubstitutionTable gsub
-
enabledFeatures
private final java.util.List<java.lang.String> enabledFeatures
-
-
Constructor Detail
-
SubstitutingCmapLookup
public SubstitutingCmapLookup(CmapSubtable cmap, GlyphSubstitutionTable gsub, java.util.List<java.lang.String> enabledFeatures)
-
-
Method Detail
-
getGlyphId
public int getGlyphId(int characterCode)
Description copied from interface:CmapLookup
Returns the GlyphId linked with the given character code.- Specified by:
getGlyphId
in interfaceCmapLookup
- Parameters:
characterCode
- the given character code to be mapped- Returns:
- glyphId the corresponding glyph id for the given character code
-
getCharCodes
public java.util.List<java.lang.Integer> getCharCodes(int gid)
Description copied from interface:CmapLookup
Returns all possible character codes for the given gid, or null if there is none.- Specified by:
getCharCodes
in interfaceCmapLookup
- Parameters:
gid
- glyph id- Returns:
- a list with all character codes the given gid maps to
-
-