|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.freehep.graphicsio.font.FontIncluder
org.freehep.graphicsio.font.FontEmbedder
public abstract class FontEmbedder
A FontIncluder that also embeds all glyphs. Subclasses must implement the
writeGlyph method which is called for all defined (up to 256)
characters and the notdefined character. These method calls are bracketed by
openGlyphs() and closeGlyph(). All invocations of
methods that are abstract in this class succeed the method calls of the
superclass FontIncluder (especially closeIncludeFont()!)
All of these calls are again succeeded by closeEmbedFont.
The abstract methods are called in the following order:
Field Summary | |
---|---|
static String |
NOTDEF
|
Fields inherited from class org.freehep.graphicsio.font.FontIncluder |
---|
FONT_SIZE |
Constructor Summary | |
---|---|
FontEmbedder(FontRenderContext context)
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.freehep.graphicsio.font.FontIncluder |
---|
closeIncludeFont, getCharName, getContext, getEncodingTable, getFont, getFontBBox, getFontName, getNODefinedChars, getUndefinedWidth, getUnicode, getUnicode, openIncludeFont, writeEncoding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NOTDEF
Constructor Detail |
---|
public FontEmbedder(FontRenderContext context)
Method Detail |
---|
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 glyph
IOException
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |