blob: 5919fb13f77c853c61415d0a8b47134d995dded0 [file] [log] [blame]
<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">
<!--
Copyright 2001-2003 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- ========================================================================= -->
<!-- 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 <link href="install.html#distributions">binary distribution</link>, 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 <link href="install.html#distributions">source distribution</link>, 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 and should refer to the font license for information. Note that 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>