org.apache.batik.svggen.font

Class SVGFont

public class SVGFont extends Object implements XMLConstants, SVGConstants, ScriptTags, FeatureTags

Converts a TrueType font to an SVG embedded font.
Field Summary
static StringARG_KEY_ASCII
static StringARG_KEY_AUTO_RANGE
static StringARG_KEY_CHAR_RANGE_HIGH
static StringARG_KEY_CHAR_RANGE_LOW
static StringARG_KEY_ID
static StringARG_KEY_OUTPUT_PATH
static charARG_KEY_START_CHAR
static StringARG_KEY_TESTCARD
Method Summary
protected static StringencodeEntities(String s)
protected static StringgetContourAsSVGPathData(Glyph glyph, int startIndex, int count)
protected static StringgetGlyphAsSVG(Font font, Glyph glyph, int glyphIndex, int defaultHorizAdvanceX, String attrib, String code)
protected static StringgetGlyphAsSVG(Font font, Glyph glyph, int glyphIndex, int defaultHorizAdvanceX, SingleSubst arabInitSubst, SingleSubst arabMediSubst, SingleSubst arabTermSubst, String code)
protected static StringgetKerningPairAsSVG(KerningPair kp, PostTable post)
protected static StringgetSVGFontFaceElement(Font font)
static voidmain(String[] args)
Starts the application.
protected static voidwriteFontAsSVGFragment(PrintStream ps, Font font, String id, int first, int last, boolean autoRange, boolean forceAscii)
Returns a <font>...</font> block, defining the specified font.
protected static voidwriteSvgBegin(PrintStream ps)
protected static voidwriteSvgDefsBegin(PrintStream ps)
protected static voidwriteSvgDefsEnd(PrintStream ps)
protected static voidwriteSvgEnd(PrintStream ps)
protected static voidwriteSvgTestCard(PrintStream ps, String fontFamily)

Field Detail

ARG_KEY_ASCII

public static final String ARG_KEY_ASCII

ARG_KEY_AUTO_RANGE

public static final String ARG_KEY_AUTO_RANGE

ARG_KEY_CHAR_RANGE_HIGH

public static final String ARG_KEY_CHAR_RANGE_HIGH

ARG_KEY_CHAR_RANGE_LOW

public static final String ARG_KEY_CHAR_RANGE_LOW

ARG_KEY_ID

public static final String ARG_KEY_ID

ARG_KEY_OUTPUT_PATH

public static final String ARG_KEY_OUTPUT_PATH

ARG_KEY_START_CHAR

public static final char ARG_KEY_START_CHAR

ARG_KEY_TESTCARD

public static final String ARG_KEY_TESTCARD

Method Detail

encodeEntities

protected static String encodeEntities(String s)

getContourAsSVGPathData

protected static String getContourAsSVGPathData(Glyph glyph, int startIndex, int count)

getGlyphAsSVG

protected static String getGlyphAsSVG(Font font, Glyph glyph, int glyphIndex, int defaultHorizAdvanceX, String attrib, String code)

getGlyphAsSVG

protected static String getGlyphAsSVG(Font font, Glyph glyph, int glyphIndex, int defaultHorizAdvanceX, SingleSubst arabInitSubst, SingleSubst arabMediSubst, SingleSubst arabTermSubst, String code)

getKerningPairAsSVG

protected static String getKerningPairAsSVG(KerningPair kp, PostTable post)

getSVGFontFaceElement

protected static String getSVGFontFaceElement(Font font)

main

public static void main(String[] args)
Starts the application.

Parameters: args an array of command-line arguments

writeFontAsSVGFragment

protected static void writeFontAsSVGFragment(PrintStream ps, Font font, String id, int first, int last, boolean autoRange, boolean forceAscii)
Returns a <font>...</font> block, defining the specified font.

Parameters: font The TrueType font to be converted to SVG id An XML id attribute for the font element first The first character in the output range last The last character in the output range forceAscii Force the use of the ASCII character map

writeSvgBegin

protected static void writeSvgBegin(PrintStream ps)

writeSvgDefsBegin

protected static void writeSvgDefsBegin(PrintStream ps)

writeSvgDefsEnd

protected static void writeSvgDefsEnd(PrintStream ps)

writeSvgEnd

protected static void writeSvgEnd(PrintStream ps)

writeSvgTestCard

protected static void writeSvgTestCard(PrintStream ps, String fontFamily)
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.