1The File Menu
2=============
3
4.. _filemenu.New:
5
6.. object:: New
7
8   Creates a new font with (by default) ISO 8859-1 (Latin1) encoding. The
9   default encoding may be changed in the preference dlg.
10
11.. _filemenu.Open:
12
13.. object:: Open
14
15   .. image:: /images/openfont.png
16      :align: right
17
18   Brings up a file chooser and allows you to open a font in any of the formats
19   FontForge understands.
20
21   If you open a truetype font containing bitmaps then you will be asked if you
22   want to load some of the bitmaps as well as the outlines.
23
24   By default this dialog will display all files with extensions of pfa, pfb,
25   pt3, sfd, ttf, otf, otb, t42, cef, cff, gsf, ttc, svg, ik, mf and bdf
26   (possibly others as FontForge comes to support more formats). You can change
27   this with the Filter pull down list -- there are several standard filters,
28   and you may define your own.
29
30   You may select multiple files (by holding down the shift or control keys when
31   clicking on them), and all selected files will be opened.
32
33   FontForge can open macbinary resource files containing postscript and
34   truetype fonts (it does not open bitmap fonts currently)
35
36   FontForge does not open Acorn RISC/OS files, but you can use
37   :doc:`acorn2sfd </fontutils/acorn2sfd>` to convert them into an sfd file which
38   FontForge can then open.
39
40   If you have `mf <http://www.tug.org/>`__ and
41   `autotrace <http://sourceforge.net/projects/autotrace/>`__ installed on
42   your machine FontForge will process metafont's mf files for you. But you
43   might want to use *pktrace, mftrace* or some other standalone program to do
44   the job.
45
46   When opening a TTC file, or a mac dfont -- files which potentially contain
47   several fonts -- you will be given a dlg showing a list of all fonts in the
48   file, you get to pick which you want to open. (FontForge does not provide a
49   way to open all fonts in a file at once). If you know the fontname you are
50   interested in you may append it to the filename in the open dlg as:
51   ``Helvetica.dfont(Helvetica Bold)`` or if you know the font index
52   ``Helvetica.dfont(0)`` (indeces start at 0, not 1).
53
54   When FontForge opens a pdb file (one that contains palm bitmap fonts) it will
55   open the first font it finds. In most formats it will list the available
56   fonts in a file and ask which you want, but palm fonts contain no fontname so
57   there is no way to identify them.
58
59   .. _filemenu.type3-import:
60
61   When importing a type3 font FontForge will ask you a few questions. It
62   shouldn't have to ask these questions, but this is an imperfect world and
63   FontForge an imperfect program. In some rare cases FontForge will crash if it
64   tries to do a remove overlap. The remove overlap functionality is important
65   for interpreting stroked paths so you really should have it on. But if a
66   crash happens then, turn it off (and the crash should not repeat, but some
67   functionality will be lost).
68
69   Not all font formats that fontforge supports have standard extensions. Mac
70   resource forks are one example, postscript cid, type0 and type3 fonts are
71   another. FontForge can still open these formats, even if it fails to display
72   the file. You can always type the file name in yourself if you don't see it
73   in the file list.
74
75   FontForge can also read (many) fonts out of a pdf file. FontForge usually
76   does not list pdf files (because they aren't really designed as mechanisms
77   for transporting fonts and most such fonts will be incomplete due to
78   subsetting and other optimizations), but you can always type in the name of
79   one directly (or use the [Filter] button to define a filter for pdf files).
80
81   You can also force fontforge to rename all the glyphs in the font being read
82   in to fit some standard naming convention. See the section on
83   :ref:`namelists <encodingmenu.namelist>` for more information.
84
85--------------------------------------------------------------------------------
86
87   The dialog has several buttons at the top, one takes you to your home
88   directory, one to the directory above the current one and the other two
89   produce menus. The bookmark menu allows you to pick a directory from your
90   list of bookmarks, and to add to or remove from your list of bookmarks, you
91   may also move backwards and forwards on your directory stack. The tools menu
92   allows you to rearrange how the dialog works. You may set it to show hidden
93   files (on unix files beginning with "." are "hidden"), you may set it so that
94   directories are displayed amid other files, in alphabetical order, so that
95   directories precede normal files, or so that there is a separate pane for
96   directories.
97
98.. _filemenu.Recent:
99
100.. object:: Recent
101
102   A submenu showing recently opened font files (it does not show the current
103   font).
104
105.. _filemenu.Close:
106
107.. object:: Close
108
109   Closes the current window.
110
111   If this is a font view and the font has been changed, then it will ask
112   whether you want to save the font. It will also close any outline glyph,
113   bitmap glyph or metrics views associated with the font.
114
115.. _filemenu.Save:
116
117.. object:: Save
118
119   Saves the current file. If it is associated with a spline font database it
120   will be saved there and a backup file will be created. If it is a new font,
121   or if the font has been read from a font file, then a Save As dialog will pop
122   up.
123
124   If you are editing a font "Ambrosia.sfd" then the backup file will be called
125   "Ambrosia.sfd~".
126
127.. _filemenu.SaveAs:
128
129.. object:: Save As...
130
131   Allows you to give a new name to the current spline font database. Pops up a
132   file picker.
133
134   Normally fonts are saved into "sfd" files (a single file containing all the
135   information needed to regenerate your font), but you may choose to save it
136   into a directory format where every glyph has its own file.
137
138.. _filemenu.SaveAll:
139
140.. object:: Save All
141
142   Saves all changed fonts. If any have not been named, it will pop up a Save As
143   file picker for that font.
144
145.. _filemenu.Generate:
146
147.. object:: Generate Fonts...
148
149   :doc:`This generates font files </ui/dialogs/generate>`, both outline and bitmap. You may
150   choose not to generate either, you may generate an afm file or a pfm file,
151   you may select the type of postscript output, you may select which pixelsizes
152   of bitmap to generate. (See :doc:`that page </ui/dialogs/generate>` for more info)
153
154.. _filemenu.GenerateMac:
155
156.. object:: Generate Mac Family...
157
158   This is only available if there are multiple fonts open in the same family,
159   and if the current font is the "Plain" style of that family. It generates a
160   mac FOND structure containing references to all family members, sfnt, and
161   POST resources for all selected faces. It brings up a
162   :ref:`dlg <generate.Mac-Family>` very similar to the Generate fonts dialog,
163   but one that includes a list of all potential faces for family members.
164
165.. _filemenu.GenerateTTC:
166
167.. object:: Generate TTC...
168
169   This is only available if there are multiple fonts open (they need not be the
170   same family). It opens a :ref:`dialog <generate.GenerateTTC>` similar to the
171   above listing all open fonts. You select which fonts go into the ttc file and
172   how they should be stored.
173
174.. _filemenu.Revert:
175
176.. object:: Revert
177
178   Rereads the font from the file on the disk. All changes are lost.
179
180.. _filemenu.RevertBackup:
181
182.. object:: Revert To Backup
183
184   Only available in the font view. When FontForge saves an sfd file (with the
185   :ref:`Save <filemenu.Save>` command, not the :ref:`Save As <filemenu.SaveAs>`
186   command) it creates a backup version of the file containing the old data
187   (this file has the same name as the main branch with a "~" character appended
188   to it). This command will revert to the backuped version of the file (if
189   there is one).
190
191.. _filemenu.RevertGlyph:
192
193.. object:: Revert Glyph
194
195   Only available in the font and outline views. Rereads the font from the sfd
196   file on the disk searching for a glyph in that file with the same name as the
197   current glyph. All changes to this glyph will be lost (but if the glyph has
198   references then any changes made to the glyphs being refered to will still be
199   visible), *this command may be undone.*
200
201   So if you have changed the name of the glyph this command will fail.
202
203   If the font did not come from an sfd file this command will fail.
204
205   If the font has been reencoded and the glyph has references this command may
206   fail.
207
208   If you have made a global change to the font (like scaling it to a new
209   em-size) then the results may not be appropriate.
210
211.. _filemenu.Export:
212
213.. object:: Export...
214
215   In the Outline view this allows you to export the splines that make up the
216   glyph into an encapsulated postscript (.eps), pdf, svg or xfig format (.fig
217   -- the conversion to fig format is not the best) file. You may also have the
218   glyph rasterized and output in either .xbm or .bmp (or png if you have that
219   library) formats (FontForge will prompt you for a pixelsize. bmp also allows
220   you to generate an anti-aliased image, and you will be prompted for bits per
221   pixel. 1 bit per pixel is a bitmap).
222
223   In the Bitmap view this allows you to export the current glyph as either a
224   .xbm or a .bmp (always as a bitmap) file.
225
226   This menu item is not available in the Font or Metrics Views.
227
228.. _filemenu.Import:
229
230.. object:: Import...
231
232   In the Font View this allows you to import one or several bitmap fonts (from
233   a .bdf file or a ttf/otf/ttc file, TeX pk (gf) file, an X11 .pcf file or a
234   mac dfont) and merge it into the list of bitmap sizes stored in the database.
235   You may also load one bitmap font into the backgrounds of the outline glyphs
236   (So "A" from the bitmap font goes into the background of the "A" outline
237   glyph), this is to make tracing glyphs easier. Be careful, you need to load a
238   big bitmap for autotrace to be useful.
239
240   .. note::
241
242      FontForge is unable to read an encoding from pk files, you will may need
243      to set it with "Force Encoding" after you've loaded the pk file.
244
245   You may also load images into the glyph backgrounds. There are two ways to do
246   this, you may either select several image files and they will be loaded
247   consecutively into selected glyphs, or you may select an image template and
248   all images whose filename match that template will be loaded into the
249   backgrounds of the appropriate glyphs. Image templates look like "uni*.png"
250   or "enc*.gif" or "cid*.tiff". You select the template by selecting a filename
251   which matches that template-- So if you select "uni1100.gif" then all image
252   files which start with "uni" and end with ".gif" and contain a valid unicode
253   number will be loaded and placed in the appropriate place. Files named "enc*"
254   or "cid*" are handled similarly except that they specify the current encoding
255   (and the number must be in decimal rather than hex).
256
257   If you are editing a :doc:`multi-layered font </ui/dialogs/multilayer>` then you can also
258   import an image into one of the foreground layers.
259
260   .. _filemenu.bitmapfiles:
261
262   :small:`FontForge does best when given bitmap images. It will grey out the foreground and make the background transparent. It will also compress them when it stores them in the sfd file. It will handle most other image formats but does not try to optimize them in anyway. Please use bitmaps here.`
263
264   You may load an encapsulated postscript file (or rather the sub-set of
265   postscript that FontForge understands) into the foreground of glyphs. As with
266   images above this may import either depending on the selection or a template.
267
268   If you have libxml2 on your system then FontForge will also be able to import
269   svg files. As with postscript, only a subset of svg is understood).
270
271   In the Outline View this allows you to import an image into the background
272   (see the above remark about :ref:`bitmaps <filemenu.bitmapfiles>`, or import
273   eps or fig files into the foreground (the xfig conversion is really bad, the
274   eps conversion is very limited).
275
276   In the Bitmap View this allows you to import a bitmap image into the glyph.
277
278   This menu item is not available in the Metrics View
279
280   In the font view you may select multiple files (by holding down the shift or
281   control keys when clicking on them), and all selected bitmap fonts will be
282   imported into the sfd.
283
284.. _filemenu.Merge-feature:
285
286.. object:: Merge Feature Info...
287
288   Only available in the font view window. This command will allow you to search
289   for an :doc:`adobe feature file </techref/featurefile>` (.fea) for feature/lookup
290   information or an afm, ofm, tfm, pfm or mac resource file containing kerning
291   pairs for the specified font. In many cases it will not be needed because
292   when FontForge opens a .pfa or .pfb font it will automagically search for an
293   appropriate .afm file in the same place. But sometimes afm files are stored
294   in other directories. And sometimes you want to import information from TeX,
295   from mac resource files or from windows pfm files.
296
297   .. note::
298
299      FontForge is unable to read an encoding from tfm/ofm files or from mac
300      resource files, it is your responsibility to ensure that the encoding of
301      your font matches that of the tfm file *BEFORE* merging kerning
302      information. This is unfortunate, sorry.
303
304   .. note::
305
306      When loading a postscript font from a mac resource file, the associated
307      kerning data will be found in the FOND stored with a bitmap font for this
308      face. FontForge can't guess the name of this file when loading the font.
309      You must figure it out yourself.
310
311.. _filemenu.Print:
312
313.. object:: Print...
314
315   Not available in the bitmap view. Allows you to print out all the glyphs in
316   the font, a text sample of the font, or specific glyphs at a very large
317   scale.
318
319   See the section on :doc:`printing </ui/dialogs/display>` for more information.
320
321.. _filemenu.Execute:
322
323.. object:: Execute Script...
324
325   Only in the font view. Brings up a dlg and allows you to enter a
326   :doc:`script </scripting/scripting>`, which could be just calling a prewritten script
327   file. There is a [Call] button in the dlg to help you locate any such files.
328   The default extension is "\*.pe" (postscript edit) but you can change that
329   with the [Filter] button if you use something else.
330
331.. _filemenu.ScriptMenu:
332
333.. object:: Script Menu
334
335   Only in the font view. You may define up to 10
336   :ref:`scripts <scripting.menu>` that you want to execute frequently and place
337   them in this menu. The scripts may also be invoked by short cut with the
338   first one being invoked by Control-Meta(Alt)-1, the second Control-Meta-2,
339   and the tenth by Control-Meta-0. The scripts are set in the
340   :ref:`preferences dialog <prefs.scripts>`
341
342.. _filemenu.prefs:
343
344.. object:: Preferences...
345
346   This pops up a
347   :doc:`dialog allowing you to configure various esoteric bits of fontforge </ui/dialogs/prefs>`.
348
349   A number of things, like the colors used in FontForge, that might be
350   controlled from a preference window are controlled by
351   :doc:`X Resources </ui/misc/xres>` below.
352
353.. _filemenu.ResEdit:
354
355.. object:: X Resource Editor...
356
357   :doc:`This dialog </ui/misc/resedit>` allows you to edit FontForge's X Resources, you
358   may either save them to a file for perminant storage, or change the current
359   settings for this use of FontForge.
360
361.. _filemenu.Quit:
362
363.. object:: Quit
364
365   Exits the program, prompting you whether to save any changed fonts.
366