|
||||||||||
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 java.lang.String |
NOTDEF
|
Fields inherited from class org.freehep.graphicsio.font.FontIncluder |
---|
FONT_SIZE |
Constructor Summary | |
---|---|
FontEmbedder(java.awt.font.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 java.awt.Shape |
getGlyph(int i)
|
protected java.awt.font.GlyphMetrics |
getGlyphMetrics(int i)
|
void |
includeFont(java.awt.Font font,
CharTable charTable,
java.lang.String name)
Embed this font to the file. |
protected void |
openGlyphs()
Called before the glyph loop starts. |
protected abstract void |
writeGlyph(java.lang.String unicodeName,
java.awt.Shape glyph,
java.awt.font.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 java.lang.String NOTDEF
Constructor Detail |
---|
public FontEmbedder(java.awt.font.FontRenderContext context)
Method Detail |
---|
protected abstract void writeGlyph(java.lang.String unicodeName, java.awt.Shape glyph, java.awt.font.GlyphMetrics glyphMetrics) throws java.io.IOException
unicodeName
- the character's name according to the unicode standardglyph
- the shape that represents this glyphglyphMetrics
- the metrics of this glyph
java.io.IOException
protected abstract void writeWidths(double[] widths) throws java.io.IOException
java.io.IOException
protected void openGlyphs() throws java.io.IOException
java.io.IOException
protected void closeGlyphs() throws java.io.IOException
java.io.IOException
protected abstract void closeEmbedFont() throws java.io.IOException
java.io.IOException
protected double[] getAdvanceWidths()
protected double getAdvanceWidth(int character)
protected java.awt.Shape getGlyph(int i)
protected java.awt.font.GlyphMetrics getGlyphMetrics(int i)
public void includeFont(java.awt.Font font, CharTable charTable, java.lang.String name) throws java.io.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())
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |