Class Type1Font
java.lang.Object
com.sun.pdfview.font.PDFFont
com.sun.pdfview.font.OutlineFont
com.sun.pdfview.font.Type1Font
- Direct Known Subclasses:
BuiltinFont
A representation, with parser, of an Adobe Type 1 font.
- Author:
- Mike Wessler
-
Constructor Summary
ConstructorsConstructorDescriptionType1Font(String baseName, PDFObject src, PDFFontDescriptor descriptor) create a new Type1Font based on a font data stream and an encoding. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 namefloatGet the width of a given character This method is overridden to work if the width array hasn't been populated (as for one of the 14 base fonts)protected voidparseFont(byte[] font, int start, int len) Read a font from it's data, start position and lengthMethods inherited from class OutlineFont
getCharCount, getDefaultWidth, getFirstChar, getGlyph, getLastCharMethods inherited from class PDFFont
equals, getBaseFont, getCachedGlyph, getDescriptor, getEncoding, getFont, getGlyphs, getSubtype, getUnicodeMap, hashCode, setBaseFont, setDescriptor, setEncoding, setSubtype, setUnicodeMap, toString
-
Constructor Details
-
Type1Font
create a new Type1Font based on a font data stream and an encoding.- Parameters:
baseName- the postscript name of this fontsrc- the Font object as a stream with a dictionarydescriptor- the descriptor for this font- Throws:
IOException
-
-
Method Details
-
parseFont
protected void parseFont(byte[] font, int start, int len) Read a font from it's data, start position and length -
getWidth
Get the width of a given character This method is overridden to work if the width array hasn't been populated (as for one of the 14 base fonts)- Overrides:
getWidthin classOutlineFont
-
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
-