Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

77 lines
2.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<xml>
<include src="settings/generic.xml" />
<synopsis name="Generate Fonts" description="how to generate fonts with RoboFab in FontLab." keywords="font, howto" />
<title>How to: Generate Fonts</title>
<div class="content">
<h1>Generating Fonts</h1>
<p>
A RFont object in FontLab can call FontLab to generate fonts. Generating fonts can be time consuming, even when all the right parameters are set. So this is a nice candidate for automation. First of all a generator script will give you consistency between generations and versions. But also it means you can set a machine to work to generate batches of fonts and focus on more creative tasks.
</p>
<p>
Note: the generate method only calls on FontLab to generate the fonts in a particular format. It does not prepare the font data for that specific format, i.e. for example when you're generating for PC Truetype, generate() won't select the appropriate encodings or special windows flags. You need to do that.
</p>
<h3>RFont.generate(outputType, path=None)</h3>
<p>
Generate the font. outputType is the type of font to output. An overview of available output Types in FontLab:
</p>
<ul>
<li>
<strong>pctype1</strong>:PC Type 1 font (binary/PFB)
</li>
<li>
<strong>pcmm</strong>: PC MultipleMaster font (PFB)
</li>
<li>
<strong>pctype1ascii</strong>: PC Type 1 font (ASCII/PFA)
</li>
<li>
<strong>pcmmascii</strong>: PC MultipleMaster font (ASCII/PFA)
</li>
<li>
<strong>mactype1</strong>:Mac Type 1 font (generates suitcase and LWFN file)
</li>
<li>
<strong>otfcff</strong>: PS OpenType (CFF-based) font (OTF)
</li>
<li>
<strong>otfttf</strong>: PC TrueType/TT OpenType font (TTF)
</li>
<li>
<strong>macttf</strong>: Mac TrueType font (generates suitcase)
</li>
<li>
<strong>macttdfont</strong>: Mac TrueType font (generates suitcase with resources in data fork)
</li>
<li>
(doc adapted from http://dev.fontlab.net/flpydoc/)
</li>
</ul>
<h3>Notes</h3>
<p>
<strong>path</strong> can be a directory or a directory file name combo:
</p>
<ul>
<li>
path="DirectoryA/DirectoryB"
</li>
<li>
path="DirectoryA/DirectoryB/MyFontName"
</li>
<li>
path="DirectoryA/DirectoryB/ &lt; filename &gt;"
</li>
</ul>
<p>
If no <strong>path</strong> is given, the file will be output in the same directory as the vfb file. If no <strong>filename</strong> is given, the filename will be the vfb file name with the appropriate suffix.
</p>
<h2>Examples</h2>
<p>
FontLab can generate many different formats for different platforms. Please refer to the FontLab manual for specifics. Some formats generate several files, others only one. Some formats are not available in all versions of FontLab.
</p>
<pythonsource src="examples/usageGeneratefonts.py"/>
</div>
</xml>