| 1 |
<?xml version="1.0"?> |
| 2 |
|
| 3 |
<!-- |
| 4 |
|
| 5 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 6 |
contributor license agreements. See the NOTICE file distributed with |
| 7 |
this work for additional information regarding copyright ownership. |
| 8 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 9 |
(the "License"); you may not use this file except in compliance with |
| 10 |
the License. You may obtain a copy of the License at |
| 11 |
|
| 12 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 13 |
|
| 14 |
Unless required by applicable law or agreed to in writing, software |
| 15 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 16 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 |
See the License for the specific language governing permissions and |
| 18 |
limitations under the License. |
| 19 |
|
| 20 |
--> |
| 21 |
|
| 22 |
<!-- ========================================================================= --> |
| 23 |
<!-- author [email protected] --> |
| 24 |
<!-- version $Id$ --> |
| 25 |
<!-- ========================================================================= --> |
| 26 |
|
| 27 |
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd"> |
| 28 |
<document> |
| 29 |
<header> |
| 30 |
<title>SVG Font Converter</title> |
| 31 |
</header> |
| 32 |
|
| 33 |
<body> |
| 34 |
<p> |
| 35 |
The TrueType Font to SVG (<code>ttf2svg</code>) application lets you |
| 36 |
convert a range of characters from a TrueType Font into the SVG font |
| 37 |
format. |
| 38 |
</p> |
| 39 |
|
| 40 |
<section id="running"> |
| 41 |
<title>Running the font converter</title> |
| 42 |
<p> |
| 43 |
If you are using the Batik binary distribution, type the following at |
| 44 |
the command line: |
| 45 |
</p> |
| 46 |
<source>java -jar batik-ttf2svg.jar <em>OPTIONS</em></source> |
| 47 |
<p> |
| 48 |
If you are using the Batik source distribution, type the following at |
| 49 |
the command line: |
| 50 |
</p> |
| 51 |
<source>build ttf2svg <em>OPTIONS</em></source> |
| 52 |
<p> |
| 53 |
In both cases, the options are the same: |
| 54 |
</p> |
| 55 |
<source><em>ttf-path</em> <em>[</em><strong>-l</strong> <em>range-begin] [</em><strong>-h</strong> <em>range-end] [</em><strong>-autorange</strong><em>] [</em><strong>-ascii</strong><em>] [</em><strong>-id</strong> <em>id] [</em><strong>-o</strong> <em>output-path] [</em><strong>-testcard</strong><em>]</em></source> |
| 56 |
<p> |
| 57 |
where: |
| 58 |
</p> |
| 59 |
<dl class="options"> |
| 60 |
<dt><em>ttf-path</em></dt> |
| 61 |
<dd> |
| 62 |
<p>specifies the TrueType Font file containing the characters to be |
| 63 |
converted,</p> |
| 64 |
</dd> |
| 65 |
<dt><strong>-l</strong> <em>range-begin</em> <strong>-h</strong> <em>range-end</em></dt> |
| 66 |
<dd> |
| 67 |
<p>specifies the range of characters (by codepoint, in decimal) to be |
| 68 |
converted,</p> |
| 69 |
</dd> |
| 70 |
<dt><strong>-autorange</strong></dt> |
| 71 |
<dd> |
| 72 |
<p>automatically determines the available character range, instead of using the |
| 73 |
default, ASCII printable characters (ranging from 32 to 126),</p> |
| 74 |
</dd> |
| 75 |
<dt><strong>-ascii</strong></dt> |
| 76 |
<dd> |
| 77 |
<p>forces usage of the ASCII character map in the font, instead of the |
| 78 |
Unicode character map,</p> |
| 79 |
</dd> |
| 80 |
<dt><strong>-id</strong> <em>id</em></dt> |
| 81 |
<dd> |
| 82 |
<p>specifies the value for the <code>id</code> attribute of the generated |
| 83 |
<code>font</code> element,</p> |
| 84 |
</dd> |
| 85 |
<dt><strong>-o</strong> <em>output-path</em></dt> |
| 86 |
<dd> |
| 87 |
<p>specifies the pathname of the output SVG document containing the |
| 88 |
generated SVG font, and</p> |
| 89 |
</dd> |
| 90 |
<dt><strong>-testcard</strong></dt> |
| 91 |
<dd> |
| 92 |
<p>specifies that a sequence of SVG <code>text</code> elements should be |
| 93 |
appended to the output SVG file to test the characters in the SVG |
| 94 |
font, providing an easy way to validate that generated SVG |
| 95 |
font visually.</p> |
| 96 |
</dd> |
| 97 |
</dl> |
| 98 |
<p> |
| 99 |
For example: |
| 100 |
</p> |
| 101 |
<source>java -jar batik-ttf2svg.jar /usr/home/myFont.ttf -l 48 -h 57 -id MySVGFont -o mySVGFont.svg -testcard</source> |
| 102 |
<p> |
| 103 |
will convert characters 48 to 57, i.e., <code>'0'</code> to |
| 104 |
<code>'9'</code>, in the <code>myFont.ttf</code> file into their SVG |
| 105 |
equivalent in the <code>mySVGFont.svg</code> file, appending a test |
| 106 |
card so that the font can be visualized. |
| 107 |
</p> |
| 108 |
</section> |
| 109 |
|
| 110 |
<anchor id="useCases" /> |
| 111 |
|
| 112 |
<section id="use-cases"> |
| 113 |
<title>Use cases</title> |
| 114 |
<p> |
| 115 |
The TrueType Font converter application is helpful to be able to embed |
| 116 |
font definitions in SVG files. This will ensure that the SVG document |
| 117 |
will look exactly the same on all platform by not relying on system |
| 118 |
fonts. |
| 119 |
</p> |
| 120 |
<p> |
| 121 |
Note that users of the tool should make sure that they have the right |
| 122 |
to embed the font before embedding it in an SVG file and should refer |
| 123 |
to the font license for information. Note that TrueType Font files |
| 124 |
contain a flag that defines the “embeddability” of a font and there are |
| 125 |
tools for checking that flag. |
| 126 |
</p> |
| 127 |
</section> |
| 128 |
</body> |
| 129 |
</document> |