Class Type1CFont
java.lang.Object
com.sun.pdfview.font.PDFFont
com.sun.pdfview.font.OutlineFont
com.sun.pdfview.font.Type1CFont
A representation, with parser, of an Adobe Type 1C font.
- Author:
- Mike Wessler
-
Constructor Summary
ConstructorsConstructorDescriptionType1CFont(String baseFont, PDFObject src, PDFFontDescriptor descriptor) create a new Type1CFont based on a font data stream and a descriptor -
Method Summary
Modifier and TypeMethodDescriptionintcalcoffset(int base) calculate an offset code for a dictionary.intgetIndexSize(int loc) get the size of the dictionary located within the stream at some offset.protected GeneralPathgetOutline(char src, float width) Get a glyph outline by character code Note this method must always return an outlineprotected GeneralPathgetOutline(String name, float width) Get a glyph outline by namegetSID(int id) get the name associated with an ID.intgetTableLength(int loc) return the number of entries in an Index table.voidreadFNum()read the next funky floating point number from the input stream. value gets put into the fnum field.Methods inherited from class OutlineFont
getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastChar, getWidthMethods inherited from class PDFFont
equals, getBaseFont, getCachedGlyph, getDescriptor, getEncoding, getFont, getGlyphs, getSubtype, getUnicodeMap, hashCode, setBaseFont, setDescriptor, setEncoding, setSubtype, setUnicodeMap, toString
-
Constructor Details
-
Type1CFont
create a new Type1CFont based on a font data stream and a descriptor- Parameters:
baseFont- the postscript name of this fontsrc- a stream containing the fontdescriptor- the descriptor for this font- Throws:
IOException
-
-
Method Details
-
readFNum
public void readFNum()read the next funky floating point number from the input stream. value gets put into the fnum field. -
getIndexSize
public int getIndexSize(int loc) get the size of the dictionary located within the stream at some offset.- Parameters:
loc- the index of the start of the dictionary- Returns:
- the size of the dictionary, in bytes.
-
getTableLength
public int getTableLength(int loc) return the number of entries in an Index table.- Parameters:
loc-- Returns:
-
calcoffset
public int calcoffset(int base) calculate an offset code for a dictionary. Uses the count of entries to determine what the offset should be.- Parameters:
base- the index of the start of the dictionary
-
getSID
get the name associated with an ID.- Parameters:
id- the index of the name- Returns:
- the name from the FontSupport.stdNames table augmented by the local name table
-
getOutline
Get a glyph outline by name- Specified by:
getOutlinein classOutlineFont- Parameters:
name- the name of the desired glyph- Returns:
- the glyph outline, or null if unavailable
-
getOutline
Get a glyph outline by character code Note this method must always return an outline- Specified by:
getOutlinein classOutlineFont- Parameters:
src- the character code of the desired glyph- Returns:
- the glyph outline
-