SVG Font Converter
The TrueType Font to SVG (ttf2svg) application lets you convert a range of characters from a TrueType Font into the SVG font format.
Running the font converter
If you are using the Batik binary distribution, type the following at the command line:
java -jar batik-ttf2svg.jar OPTIONS
If you are using the Batik source distribution, type the following at the command line:
build ttf2svg OPTIONS
In both cases, the options are the same:
ttf-path [-l range-begin] [-h range-end] [-ascii] [-id id] [-o output-path] [-testcard]
where:
For example:
java -jar batik-ttf2svg.jar /usr/home/myFont.ttf -l 48 -h 57 -id MySVGFont -o mySVGFont.svg -testcard
will convert characters 48 to 57, i.e., '0' to '9', in the myFont.ttf file into their SVG equivalent in the mySVGFont.svg file, appending a test card so that the font can be visualized.
Use cases
The TrueType Font converter application is helpful to be able to embed font definitions in SVG files. This will ensure that the SVG document will look exactly the same on all platform by not relying on system fonts.
Note that users of the tool should make sure that they have the right to embed the font before embedding it in an SVG file and should refer to the font license for information. Note that TrueType Font files contain a flag that defines the “embeddability” of a font and there are tools for checking that flag.