Package org.openpdf.renderer.font
Class OutlineFont
java.lang.Object
org.openpdf.renderer.font.PDFFont
org.openpdf.renderer.font.OutlineFont
- Direct Known Subclasses:
NativeFont,TTFFont,Type1CFont,Type1Font
Supports width operations for Type1, Type1C, TrueType and Type3 fonts
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOutlineFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) Creates a new instance of OutlineFont -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of charactersintGet the default width in text spaceintGet the first character codeprotected PDFGlyphGet the glyph for a given character code and name The preferred method of getting the glyph should be by name.intGet the last character codeprotected abstract GeneralPathgetOutline(char src, float width) Get a glyph outline by character code Note this method must always return an outlineprotected abstract GeneralPathgetOutline(String name, float width) Get a glyph outline by namefloatGet the width of a given characterMethods inherited from class org.openpdf.renderer.font.PDFFont
equals, getBaseFont, getCachedGlyph, getDescriptor, getEncoding, getFont, getGlyphs, getSubtype, getUnicodeMap, hashCode, setBaseFont, setDescriptor, setEncoding, setSubtype, setUnicodeMap, toString
-
Field Details
-
firstChar
private int firstCharthe first character code -
lastChar
private int lastCharthe last character code -
widths
private float[] widthsthe widths for each character code
-
-
Constructor Details
-
OutlineFont
public OutlineFont(String baseFont, PDFObject fontObj, PDFFontDescriptor descriptor) throws IOException Creates a new instance of OutlineFont- Throws:
IOException
-
-
Method Details
-
getFirstChar
public int getFirstChar()Get the first character code -
getLastChar
public int getLastChar()Get the last character code -
getDefaultWidth
public int getDefaultWidth()Get the default width in text space -
getCharCount
public int getCharCount()Get the number of characters -
getWidth
Get the width of a given character -
getGlyph
Get the glyph for a given character code and name The preferred method of getting the glyph should be by name. If the name is null or not valid, then the character code should be used. If the both the code and the name are invalid, the undefined glyph should be returned. Note this method must *always* return a glyph. -
getOutline
Get a glyph outline by name- 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- Parameters:
src- the character code of the desired glyph- Returns:
- the glyph outline
-