|
1 | | -Python scripts |
2 | | -========================= |
3 | | -Assortment of scripts that run on the command line, i.e. **Terminal** on Mac OS X, and **Command Prompt** on Windows. |
| 1 | +# Python scripts |
4 | 2 |
|
5 | | -Installation |
6 | | ------ |
7 | | -**Mac OS X**: A version of Python is already installed. |
| 3 | +Assortment of scripts that run on the command line, i.e. *Terminal* on Mac OS X, and *Command Prompt* on Windows. |
8 | 4 |
|
| 5 | +## Description |
| 6 | + |
| 7 | +### `buildAll.py` |
| 8 | +For a given directory, this script goes through every subfolder and runs `makeOTF` for each font source file (`.ufo`, `.pfa`) found. |
| 9 | + |
| 10 | +`makeOTF` is run with the following options: |
| 11 | +`-r`: release mode |
| 12 | + * subroutinization turned on |
| 13 | + * strict error-reporting |
| 14 | + * GlyphOrderAndAliasDB is applied |
| 15 | + |
| 16 | +`-gs`: glyphs not listed in the GlyphOrderAndAliasDB are removed from the resulting font file |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +### `checkAll.py` |
| 21 | + |
| 22 | +Run `checkOutlines -e` to remove overlaps in all source files (`.ufo`, `.pfa`) contained in a given directory tree. |
| 23 | + |
| 24 | +`-e`: This option results in changes to outlines. For a PFA file means that overlapping glyphs will be replaced by new ones (therefore may be lost). In a UFO file, new glyphs are written to a new `glyphs.com.adobe.type.processedGlyphs` layer, which does not interfere with the foreground, and is used by `makeotf` to generate font binaries. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +### `hintAll.py` |
| 29 | + |
| 30 | +Run `autohint -q` to add hints to all glyphs in in all source files (`.ufo`, `.pfa`) contained in a given directory tree. |
| 31 | + |
| 32 | +`-q`: quiet operation |
| 33 | + |
| 34 | +In a UFO file, hinted glyphs are written to a new `glyphs.com.adobe.type.processedGlyphs` layer, which does not interfere with the foreground, and is used by `makeotf` to generate font binaries. |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +### `generateAllKernFiles.py` |
| 39 | + |
| 40 | +For each source file in a given directory tree, generate a `kern.fea` file, which can be referenced in a `features` file (as expected by `makeOTF`). |
| 41 | +The `kern.fea` file contains only raw kern data made of groups and lookups, and must be wrapped in feature tags by way of a `include` statement. |
| 42 | +It may look like this: |
| 43 | + |
| 44 | + feature kern { |
| 45 | + include (kern.fea); |
| 46 | + } kern; |
| 47 | + |
| 48 | +It is possible to change settings for generating kern files (such as minimum kerning value, writing of subtables, etc.) directly in the script file. |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +### `generateOneKernFile.py` |
| 53 | + |
| 54 | +Generate a single `kern.fea` file for a given UFO. The resulting file can be used in the same way as explained above. This script’s options can also be changed as explained above. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +### `generateAllMarkFiles.py` |
| 59 | + |
| 60 | +For each font source file in a given directory tree, generates `mark.fea`, `markclasses.fea`, and `mkmk.fea` files, which can be used in a `features` file (as expected by `makeOTF`). |
| 61 | +The `m*.fea` files contain only raw mark data, and must be wrapped in feature tags by way of an `include` statement. It may look like this: |
| 62 | + |
| 63 | + include (markclasses.fea); |
| 64 | + |
| 65 | + feature mark { |
| 66 | + include (mark.fea); |
| 67 | + } mark; |
| 68 | + |
| 69 | + feature mkmk { |
| 70 | + include (mkmk.fea); |
| 71 | + } mkmk; |
| 72 | + |
| 73 | + |
| 74 | +This script can also create `abvm.fea` and `blwm.fea` files for Indic scripts. More information in the script file itself. |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +### `generateOneMarkFiles.py` |
| 79 | + |
| 80 | +Generate mark files (as explained above) for a single UFO. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +### `ufo2pfa.py` |
| 85 | +Convert all UFO files in a given directory tree to PFA (PostScript Type 1) files, using `tx`. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +### `ufo2txt.py` |
| 90 | +Convert all UFO files in a given directory tree to TXT files, using `tx`. |
| 91 | +TXT files are decrypted PostScript Type 1 (PFA) files. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +### `pfa2txt.py` |
| 96 | +Converts all PFA files in a given directory tree to TXT files, using `tx`. |
| 97 | +TXT files are decrypted PostScript Type 1 (PFA) files. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +### `UFOInstanceGenerator.py` |
| 102 | +(Deprecated workflow, but a great starter for interpolation). |
| 103 | +Generate UFO instances from two or more masters, in a one- or two axis MultipleMaster setup. Requires a settings file called `instances`, the contents of which are better described within the script itself. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +## Installation |
| 110 | + |
| 111 | +**Mac OS X**: A version of Python is already installed. |
9 | 112 | **Windows**: You will need to install one of the 2.x versions available at [python.org](http://www.python.org/getit/). |
10 | 113 |
|
11 | | -Dependencies |
12 | | ------ |
| 114 | +## Dependencies |
| 115 | + |
13 | 116 | Some of the scripts may require additional Python packages or depend on certain tools being installed and appropriately configured to run on the command line. |
14 | 117 | Here is a list of the locations from which you may need to get the extra tools and packages: |
15 | 118 |
|
16 | 119 | * [Adobe Font Development Kit for OpenType (AFDKO)](http://www.adobe.com/devnet/opentype/afdko.html) |
17 | | - * makeotf |
18 | | - * autohint |
19 | | - * tx |
20 | | - * ttx |
21 | | - * detype1 |
22 | | - * spot |
| 120 | + * makeotf |
| 121 | + * autohint |
| 122 | + * tx |
| 123 | + * ttx |
| 124 | + * detype1 |
| 125 | + * spot |
23 | 126 |
|
24 | 127 | * [FontTools](http://sourceforge.net/projects/fonttools/) |
25 | 128 |
|
26 | 129 | * [RoboFab](http://www.robofab.org/) |
27 | 130 |
|
28 | | -* [Type Supply](http://code.typesupply.com/) |
29 | | - * defcon |
30 | | - * ufo2fdk |
31 | | - * woffTools |
| 131 | +* [Type Supply Tools](http://code.typesupply.com/) |
| 132 | + * defcon |
| 133 | + * ufo2fdk |
| 134 | + * woffTools |
| 135 | + |
| 136 | +## General usage information |
32 | 137 |
|
33 | | -Using the scripts |
34 | | ------ |
35 | 138 | 1. Download the [ZIP package](https://github.com/adobe-type-tools/python-scripts/archive/master.zip) and unzip it. |
36 | 139 | 2. |
37 | 140 | * Most of the scripts will run by simply typing `python ` followed by the file name of the script, e.g. `python theScript.py`. |
38 | | - * If the script is in a different directory from which you are trying to run it, you will need to provide the full path to the script's file, e.g. `python /Users/myself/foldername/theScript.py`. |
| 141 | + * If the script is in a different directory from which you are trying to run it, you will need to provide the full path to the script’s file, e.g. `python /Users/myself/foldername/theScript.py`. |
39 | 142 | * Some scripts may allow you to use options, or require that you provide input files. To learn how to use those scripts, open them in a text editor app (e.g. TextEdit, Notepad) and read the documentation near the top of the file. |
0 commit comments