fop 2.0

org.apache.fop.fonts
Interface CIDSet

All Known Implementing Classes:
CIDFull, CIDSubset

public interface CIDSet

Declares methods to retrieve font information (glyph indices, widths, unicode values) from a CID font.


Method Summary
 char[] getChars()
          Returns a char array containing all Unicode characters that are in the subset.
 java.util.BitSet getGlyphIndices()
          Returns a BitSet with bits set for each available glyph index in the subset.
 java.util.Map<java.lang.Integer,java.lang.Integer> getGlyphs()
          Returns an unmodifiable Map of the font subset.
 int getNumberOfGlyphs()
          Returns the number of glyphs in the subset.
 int getOriginalGlyphIndex(int index)
          Returns the original index of the glyph inside the (non-subset) font's glyph list.
 char getUnicode(int index)
          Returns the Unicode value for a subset index (character selector).
 int[] getWidths()
          Return the array of widths.
 int mapChar(int glyphIndex, char unicode)
          Maps a character to a character selector for a font subset.
 

Method Detail

getOriginalGlyphIndex

int getOriginalGlyphIndex(int index)
Returns the original index of the glyph inside the (non-subset) font's glyph list. This index can be used to access the character width information, for example.

Parameters:
index - the subset index (character selector) to access the glyph
Returns:
the original index (or -1 if no glyph index is available for the subset index)

getUnicode

char getUnicode(int index)
Returns the Unicode value for a subset index (character selector). If there's no such Unicode value, the "NOT A CHARACTER" (0xFFFF) is returned.

Parameters:
index - the subset index (character selector)
Returns:
the Unicode value or "NOT A CHARACTER" (0xFFFF)

mapChar

int mapChar(int glyphIndex,
            char unicode)
Maps a character to a character selector for a font subset. If the character isn't in the subset, yet, it is added and a new character selector returned. Otherwise, the already allocated character selector is returned from the existing map/subset.

Parameters:
glyphIndex - the glyph index of the character
unicode - the Unicode index of the character
Returns:
the subset index

getGlyphs

java.util.Map<java.lang.Integer,java.lang.Integer> getGlyphs()
Returns an unmodifiable Map of the font subset. It maps from glyph index to character selector (i.e. the subset index in this case).

Returns:
Map Map<Integer, Integer> of the font subset

getChars

char[] getChars()
Returns a char array containing all Unicode characters that are in the subset.

Returns:
a char array with all used Unicode characters

getNumberOfGlyphs

int getNumberOfGlyphs()
Returns the number of glyphs in the subset.

Returns:
the number of glyphs in the subset

getGlyphIndices

java.util.BitSet getGlyphIndices()
Returns a BitSet with bits set for each available glyph index in the subset.

Returns:
a BitSet indicating available glyph indices

getWidths

int[] getWidths()
Return the array of widths.

This is used to get an array for inserting in an output format. It should not be used for lookup.

Returns:
an array of widths

fop 2.0

Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved.