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, writeEncoding
public 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 glyphIOException
protected abstract void writeWidths(double[] widths) throws IOException
IOException
protected void openGlyphs() throws IOException
IOException
protected void closeGlyphs() throws IOException
IOException
protected abstract void closeEmbedFont() throws IOException
IOException
protected 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
FontIncluder
includeFont
in class FontIncluder
font
- The font to includename
- The name under which this font is addressed within the
document (can be retrieved by getFontName())IOException
Copyright © 2014. All rights reserved.