|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.font.Subset
public class Subset
Keeps track of which glyphs are included in a subset, and provides methods to convert indexes back and forth between the original complete font and the subset font.
Design Note: Although the internals of this class will only handle 16-bit font indexes, the API deliberately uses ints (31 unsigned bits) instead of chars. This way the internals can be expanded in the future if necessary, without changing the API.
Constructor Summary | |
---|---|
Subset(ConsumerFont4a consumerFont)
Constructor. |
Method Summary | |
---|---|
int |
decodeSubsetIndex(int subsetGlyphIndex)
Get the full font glyph index (not subsetted) that corresponds to subsetGlyphIndex. |
int |
encodeSubsetIndex(int fontGlyphIndex)
Get the subsetted font glyph index that corresponds to fontGlyphIndex, creating a subset glyph index if necessary. |
org.apache.commons.logging.Log |
getLogger()
Returns the logger. |
boolean |
glyphUsed(int originalGlyphIndex)
Indicates whether a given glyph is in this subset. |
int |
numGlyphsUsed()
Returns the number of glyphs in this subset. |
void |
sortUsedGlyphs()
Sorts the subset by underlying Unicode codepoint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Subset(ConsumerFont4a consumerFont)
consumerFont
- The parent ConsumerFont instance.Method Detail |
---|
public int encodeSubsetIndex(int fontGlyphIndex)
fontGlyphIndex
- The index into the full font (not subsetted)
glyphs.
public int decodeSubsetIndex(int subsetGlyphIndex)
subsetGlyphIndex
- The index into the subset font glyphs.
Character.MAX_VALUE
if the input is not valid.public void sortUsedGlyphs()
public int numGlyphsUsed()
public boolean glyphUsed(int originalGlyphIndex)
originalGlyphIndex
- The original (full font) glyph index that is
being checked.
public org.apache.commons.logging.Log getLogger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |