blob: 8dd0108e97dd87e4b4c89b930dbe066da4ab45ae [file] [log] [blame]
<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">
<!-- ========================================================================= -->
<!-- Copyright (C) The Apache Software Foundation. All rights reserved. -->
<!-- -->
<!-- This software is published under the terms of the Apache Software License -->
<!-- version 1.1, a copy of which has been included with this distribution in -->
<!-- the LICENSE file. -->
<!-- ========================================================================= -->
<!-- ========================================================================= -->
<!-- author vincent.hardy@eng.sun.com -->
<!-- version $Id$ -->
<!-- ========================================================================= -->
<document>
<header>
<title>Font Converter Utility</title>
<subtitle>Creating SVG fonts</subtitle>
<authors>
<person name="Vincent Hardy" email="vincent.hardy@eng.sun.com"/>
</authors>
</header>
<body>
<s1 title="Introduction">
<!-- <figure src="images/ttf2svgBanner.jpg" alt="Batik SVG Rasterizer" /> -->
<p>The True Type Font to SVG (<code>ttf2svg</code>) application lets you convert
some character ranges from the True Type Font format to the SVG Font format.</p>
<p>This page describes:</p>
<ul>
<li><link href="#runningTheApplication">How to run the application</link></li>
<li><link href="#useCases">Usecases</link></li>
</ul>
</s1>
<anchor id="runningTheApplication" />
<s1 title="Running the Font Converter">
<p>If you are using the Batik binary distribution, type the following at the command line:<br/><br />
<code>java -jar batik-ttf2svg.jar [options]</code><br /><br />
If you are using the Batik developer distribution, type the following at the command line:<br/><br />
<code>build ttf2svg [options]</code><br /><br />
In both cases, the options are the same:<br /><br />
<code>Options: &lt;ttf-path&gt; [-l &lt;range-begin&gt;] [-h &lt;range-end&gt;] [-ascii] [-id &lt;id&gt;] [-o &lt;output-path&gt;] [-testcard]</code><br /><br />
Where:<br /></p>
<ul>
<li><code>&lt;ttf-path&gt;</code> specifies the True Type Font file containing the characters to be converted</li>
<li><code>[-l &lt;range-begin&gt;] [-h &lt;range-end&gt;]</code> specify the low and high value of the range of characters to be
converted to SVG.</li>
<li><code>[-ascii]</code> forces usage of the ASCII character map</li>
<li><code>[-id &lt;id&gt;]</code> specifies the value for the generated <code>&lt;font&gt;</code> element.</li>
<li><code>[-o &lt;output-path&gt;]</code> specifies the path for the generated SVG Font file</li>
<li><code>[-testcard]</code> specifies that a set of SVG <code>&lt;text&gt;</code> element should be appended to
the SVG Font file to visualize and test the characters in the SVG Font. This provides an easy way to
validate the generated SVG Font file visually</li>
</ul>
<p>For example:<br /><br />
<code>java -jar batik-ttf2svg.jar /usr/home/myFont.ttf -l 48 -h 57 -id MySVGFont -o mySVGFont.svg -testcard</code><br /><br />
Will convert characters 48 to 57, i.e., '0' to '9', in the <code>myFont.ttf</code> file into their SVG equivalent in the <code>mySVGFont.svg</code> file, appending a test card so that the font can be visualized easily.</p>
</s1>
<anchor id="useCases" />
<s1 title="Use Cases">
<p>The True Type 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.</p>
<p>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. True Type Font files contain a flag that defines the 'embeddability' of a font and there are
tools for checking that flag.</p>
</s1>
</body>
</document>