java.lang.Object
io.sf.carte.echosvg.svggen.font.SVGFont
All Implemented Interfaces:
XMLConstants, FeatureTags, ScriptTags, CSSConstants, SVGConstants

public class SVGFont extends Object implements SVGConstants, ScriptTags, FeatureTags
Converts a TrueType font to an SVG embedded font.
  • Field Details

  • Constructor Details

    • SVGFont

      public SVGFont()
  • Method Details

    • encodeEntities

      protected static String encodeEntities(String s)
    • getContourAsSVGPathData

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

      protected static String getSVGFontFaceElement(Font font)
    • writeFontAsSVGFragment

      protected static void writeFontAsSVGFragment(PrintStream ps, Font font, String id, int first, int last, boolean autoRange, boolean forceAscii) throws Exception
      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
      Throws:
      Exception
    • 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)
    • 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)
    • main

      public static void main(String[] args)
      Starts the application.
      Parameters:
      args - an array of command-line arguments