| 1 |
Command Line Arguments |
| 2 |
====================== |
| 3 |
|
| 4 |
.. highlight:: shell |
| 5 |
|
| 6 |
:: |
| 7 |
|
| 8 |
$ fontforge [-options] [filenames] |
| 9 |
$ fontforge [-script] scriptfile [arguments] |
| 10 |
$ fontforge -c script-string [arguments] |
| 11 |
|
| 12 |
The filenames may specify any number of files in one of the font formats that |
| 13 |
FontForge recognizes (various postscript formats, truetype, opentype, mac |
| 14 |
resource, bitmap, svg, etc.). |
| 15 |
|
| 16 |
Some files (.ttc or mac resource) may contain more than one outline font. You |
| 17 |
may pick which font you want by following the filename with the fontname in |
| 18 |
parentheses, thus: |
| 19 |
|
| 20 |
:: |
| 21 |
|
| 22 |
$ fontforge "gulim.ttc(GulimChe)" |
| 23 |
|
| 24 |
will select the font GulimChe out of the font file gulim.ttc. |
| 25 |
|
| 26 |
FontForge recognizes the following options: |
| 27 |
|
| 28 |
.. program:: fontforge |
| 29 |
|
| 30 |
.. option:: -allglyphs |
| 31 |
|
| 32 |
Load all glyphs from the 'glyf' table of a ttc file, rather than the subset |
| 33 |
used in the selected font. (Note that if a ttc file contains multiple 'glyf' |
| 34 |
tables, only one will be loaded, but that one will be completely loaded). |
| 35 |
|
| 36 |
.. option:: -c script-string |
| 37 |
|
| 38 |
If FontForge's first (or second, if the first is -lang) argument is "-c" then |
| 39 |
the argument that follows will be treated as a string containing scripting |
| 40 |
commands, and those commands will be executed. All remaining arguments will |
| 41 |
be passed to the script. |
| 42 |
|
| 43 |
:: |
| 44 |
|
| 45 |
$ fontforge -c 'Open($1); Generate($2)' foo.sfd foo.ttf |
| 46 |
|
| 47 |
Will read a font from "foo.sfd" and then generate a truetype font from it |
| 48 |
called "foo.ttf" |
| 49 |
|
| 50 |
.. option:: -display name |
| 51 |
|
| 52 |
Specifies the name of the display on which FontForge will open its windows |
| 53 |
|
| 54 |
.. option:: -help |
| 55 |
|
| 56 |
Bring up a :doc:`browser </ui/menus/helpmenu>` looking at this documentation. |
| 57 |
|
| 58 |
.. option:: -lang={py|ff} |
| 59 |
-lang {py|ff} |
| 60 |
|
| 61 |
Specifies whether the script should be interpreted as a python script or a |
| 62 |
fontforge script. |
| 63 |
|
| 64 |
.. option:: -version |
| 65 |
|
| 66 |
Prints out the source version and exits. |
| 67 |
|
| 68 |
.. option:: -last |
| 69 |
|
| 70 |
Opens the last sfd file closed. If used more than once will open the last |
| 71 |
several sfd files. |
| 72 |
|
| 73 |
.. option:: -new |
| 74 |
|
| 75 |
Creates a new font. |
| 76 |
|
| 77 |
.. option:: -nosplash |
| 78 |
|
| 79 |
FontForge will not display its splash screen on startup (for slow |
| 80 |
connections) |
| 81 |
|
| 82 |
.. option:: -open |
| 83 |
|
| 84 |
Bring up an open font dialog |
| 85 |
|
| 86 |
.. option:: -quit |
| 87 |
|
| 88 |
Exit fontforge (only useful if -unique is passed as well, in which case the |
| 89 |
master fontforge will be asked to exit) |
| 90 |
|
| 91 |
.. option:: -recover type |
| 92 |
|
| 93 |
Where type may be: |
| 94 |
|
| 95 |
.. object:: none |
| 96 |
|
| 97 |
Do not attempt any automatic file recovery |
| 98 |
|
| 99 |
.. object:: clean |
| 100 |
|
| 101 |
Clean out the directory containing files to be recovered |
| 102 |
|
| 103 |
.. object:: auto |
| 104 |
|
| 105 |
recover any files which have been changed but which fontforge crashed on |
| 106 |
before saving. |
| 107 |
|
| 108 |
.. option:: -script script-file |
| 109 |
|
| 110 |
If FontForge's first argument is "-script" then the argument that follows |
| 111 |
will be treated as a :doc:`script file </scripting/scripting>` and all the remaining |
| 112 |
arguments will be passed as arguments to that file. (The "-script" argument |
| 113 |
may be omitted, and if the first argument is an executable file which whose |
| 114 |
first line starts with "#!" and contains "fontforge". This means that |
| 115 |
fontforge may be used as an interpreter. Ie. you can create a fontforge |
| 116 |
script file and type its name to your shell and fontforge will be invoked to |
| 117 |
process that file as a script file (passing any arguments to it)). |
| 118 |
|
| 119 |
.. option:: -skippyfile |
| 120 |
|
| 121 |
Do not execute python init scripts. These can be run later using the |
| 122 |
:py:meth:`fontforge.runInitScripts` Python method. |
| 123 |
|
| 124 |
.. option:: -skippyplug |
| 125 |
|
| 126 |
Do not load (enabled) Python plugins. These can be loaded later via the |
| 127 |
:doc:`Configure Plugins dialog </techref/plugins>` or the |
| 128 |
:py:meth:`fontforge.loadPlugins` Python method. |
| 129 |
|
| 130 |
.. option:: -sync |
| 131 |
|
| 132 |
Do synchronous screen drawing. Slows things down, makes some things easier to |
| 133 |
debug. |
| 134 |
|
| 135 |
.. option:: -unique |
| 136 |
|
| 137 |
If there is already a fontforge running on this screen, then the current |
| 138 |
version will pass its arguments to the already existing one for it to open, |
| 139 |
and then the current version will exit. So it looks more like a Mac/Windows |
| 140 |
app. |
| 141 |
|
| 142 |
.. option:: -usage |
| 143 |
|
| 144 |
Display a brief description of the options |
| 145 |
|
| 146 |
|
| 147 |
.. _cliargs.Environment: |
| 148 |
|
| 149 |
Environment Variables |
| 150 |
--------------------- |
| 151 |
|
| 152 |
FontForge examines the following environment variables: |
| 153 |
|
| 154 |
.. envvar:: BROWSER |
| 155 |
|
| 156 |
Specifies the name of a browser program for examining documentation (must be |
| 157 |
able to read a local or remote html file and display it reasonably). On |
| 158 |
CygWin systems browsers that work in the windows world (as opposed to the |
| 159 |
cygwin sub-system) must be specified by a full path spec. |
| 160 |
|
| 161 |
.. envvar:: AUTOTRACE |
| 162 |
|
| 163 |
Specifies the name and location of the autotrace program. (if not specified |
| 164 |
FontForge will try to find it in the user's path) |
| 165 |
|
| 166 |
.. envvar:: POTRACE |
| 167 |
|
| 168 |
Specifies the name and location of the potrace program. |
| 169 |
|
| 170 |
.. envvar:: MF |
| 171 |
|
| 172 |
Specifies the name and location of the metafont program. (if not specified |
| 173 |
FontForge will try to find it in the user's path) |
| 174 |
|
| 175 |
.. envvar:: FONTFORGE_VERBOSE |
| 176 |
|
| 177 |
Turns on verbose mode in script execution (the script will be printed to |
| 178 |
stdout as it is executed). |
| 179 |
|
| 180 |
.. envvar:: FONTFORGE_LOADPREFS |
| 181 |
|
| 182 |
Controls loading of preference items. If set to "Always" then preferences |
| 183 |
will be loaded even for scripts. If set to "Never" then preferences will not |
| 184 |
be loaded unless explicitly requested. If unset (or if set to any other |
| 185 |
value) then preferences will be loaded when ff starts up with a user |
| 186 |
interface, and will not be loaded if ff starts up executing a script. |
| 187 |
|
| 188 |
.. envvar:: FONTFORGE_LANGUAGE |
| 189 |
|
| 190 |
Provides a default interpreter to use when executing a script. Must be either |
| 191 |
"py" or "ff"/"pe". |
| 192 |
|
| 193 |
-------------------------------------------------------------------------------- |
| 194 |
|
| 195 |
.. envvar:: LANG, LC_ALL, etc. |
| 196 |
|
| 197 |
To determine the current locale, etc. |
| 198 |
|
| 199 |
.. envvar:: PATH |
| 200 |
|
| 201 |
Used when looking for Autotrace or mf programs |
| 202 |
|
| 203 |
.. envvar:: TMPDIR |
| 204 |
|
| 205 |
Temporary directory. Used for temporary files for which I need a filename |
| 206 |
(ie. to pass to autotrace, etc.) |
| 207 |
|
| 208 |
.. envvar:: HOME |
| 209 |
|
| 210 |
Used to figure out where to put the .FontForge directory which includes user |
| 211 |
preferences and the recovery files. |
| 212 |
|
| 213 |
.. envvar:: USER |
| 214 |
|
| 215 |
Used to create comments in new fonts about who created the font, or who saved |
| 216 |
it. |