Package com.adobe.fontengine.font
Class SubsetDefaultImpl
java.lang.Object
com.adobe.fontengine.font.SubsetDefaultImpl
- All Implemented Interfaces:
Subset
- Direct Known Subclasses:
NameKeyedSubset,OTSubset,Type1Subset
A default implementation for the
Subset interface.
This implementation is suitable for subclassing, if specific behaviour is needed beyond the correspondance between subset and full gids.
-
Constructor Summary
ConstructorsConstructorDescriptionSubsetDefaultImpl(int numGlyphs, boolean doSubset) Create a new subset for a font. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoSubset()intgetExistingSubsetGid(int fullGid) Return the currently esisting subset gid corresponding to a full gid, if there is one, without generating a new one.intgetFullGid(int subsetGid) Return the full gid corresponding to a subset gid.intReturn the number of glyphs in the subset.intgetSubsetGid(int fullGid) Return the subset gid corresponding to a full gid.
-
Constructor Details
-
SubsetDefaultImpl
public SubsetDefaultImpl(int numGlyphs, boolean doSubset) throws InvalidFontException, UnsupportedFontException Create a new subset for a font.- Parameters:
numGlyphs- the number of glyphs in the full fontdoSubset- whether to effectively subset- Throws:
InvalidFontExceptionUnsupportedFontException
-
-
Method Details
-
doSubset
public boolean doSubset() -
getNumGlyphs
public int getNumGlyphs()Description copied from interface:SubsetReturn the number of glyphs in the subset.- Specified by:
getNumGlyphsin interfaceSubset
-
getSubsetGid
Description copied from interface:SubsetReturn the subset gid corresponding to a full gid.- Specified by:
getSubsetGidin interfaceSubset- Parameters:
fullGid- the full gid, must be a legal gid for the full font.- Throws:
InvalidFontExceptionUnsupportedFontException
-
getFullGid
public int getFullGid(int subsetGid) Description copied from interface:SubsetReturn the full gid corresponding to a subset gid.- Specified by:
getFullGidin interfaceSubset- Parameters:
subsetGid- the subset gid, must be in the range [0..getNumGlyphs () [
-
getExistingSubsetGid
public int getExistingSubsetGid(int fullGid) Description copied from interface:SubsetReturn the currently esisting subset gid corresponding to a full gid, if there is one, without generating a new one. Return -1 if the full gid is not in the subset.- Specified by:
getExistingSubsetGidin interfaceSubset- Parameters:
fullGid- the full gid, must be a legal gid for the full font.
-