public abstract class FontEmbedder extends FontIncluder
| Modifier and Type | Field and Description |
|---|---|
static String |
NOTDEF |
FONT_SIZE| Constructor and Description |
|---|
FontEmbedder(FontRenderContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
closeEmbedFont() |
protected void |
closeGlyphs()
Called after the glyph loop ends.
|
protected double |
getAdvanceWidth(int character) |
protected double[] |
getAdvanceWidths() |
protected Shape |
getGlyph(int i) |
protected GlyphMetrics |
getGlyphMetrics(int i) |
void |
includeFont(Font font,
CharTable charTable,
String name)
Embed this font to the file.
|
protected void |
openGlyphs()
Called before the glyph loop starts.
|
protected abstract void |
writeGlyph(String unicodeName,
Shape glyph,
GlyphMetrics glyphMetrics)
Writes a single glyph to the file.
|
protected abstract void |
writeWidths(double[] widths)
Writes the character widths to the file.
|
closeIncludeFont, getCharName, getContext, getEncodingTable, getFont, getFontBBox, getFontName, getNODefinedChars, getUndefinedWidth, getUnicode, getUnicode, openIncludeFont, writeEncodingpublic static final String NOTDEF
public FontEmbedder(FontRenderContext context)
protected abstract void writeGlyph(String unicodeName, Shape glyph, GlyphMetrics glyphMetrics) throws IOException
unicodeName - the character's name according to the unicode standardglyph - the shape that represents this glyphglyphMetrics - the metrics of this glyphIOExceptionprotected abstract void writeWidths(double[] widths)
throws IOException
IOExceptionprotected void openGlyphs()
throws IOException
IOExceptionprotected void closeGlyphs()
throws IOException
IOExceptionprotected abstract void closeEmbedFont()
throws IOException
IOExceptionprotected double[] getAdvanceWidths()
protected double getAdvanceWidth(int character)
protected Shape getGlyph(int i)
protected GlyphMetrics getGlyphMetrics(int i)
public void includeFont(Font font, CharTable charTable, String name) throws IOException
FontIncluderincludeFont in class FontIncluderfont - The font to includename - The name under which this font is addressed within the
document (can be retrieved by getFontName())IOExceptionCopyright © 2014. All rights reserved.