Generate Glyphs»

Font > Generate Glyphs is used for creating new glyphs when any of the following situations apply:

  1. You want to add a glyph with a custom or arbitrary name.
  2. You have base Latin glyphs and diacritical marks (accents) and you want the quickly build the combined accented glyphs, and you want more control than is offered by Add Glyphs
  3. You have two (or more) base glyphs and you want to add a ligature that refers to them.
  4. You want to create a set of alternates (small caps or some other set of glyphs) for OpenType layout.
  5. You know the standard glyph name you need, and do not want to search for it in Codepages, Encodings, etc.

If you want to add glyphs that correspond to standard Unicode characters, especially if there are many of them, Add Glyphs may be the right option instead.

With Generate Glyphs, you can choose whether the resulting glyphs should be simple, composite or auto glyphs).

Controlling the result of glyph generation»

There are several options in the left portion of the Generate Glyphs dialog:

Use anchors will make use of any Anchors you have created in the source glyphs to position them together. This is usually desirable, and is most commonly used for better positioning of diacritical marks (accents).

Link as references will create the generated glyphs using References to the Elements in the original glyphs. This too is commonly used for accented glyphs, and sometimes for ligatures as long as no changes are needed to the elements.

Rebuild existing glyphs will cause FontLab to overwrite existing glyphs, if the new glyphs have the same names.

Create auto layers will generate the glyphs as auto glyphs: elements will be added as references, anchors will be used to position them if present in the primary glyphs, the advance width will be inherited from the base glyphs, and the contents of the generated glyphs will automatically fill and update over time as you add new base and mark glyphs. The recipes that you’ve used to generate the auto glyphs will be copied into the glyph recipe field of the glyphs’ auto layers.

Use legacy (FLS5) code (in “Custom” tab only): when turned on, FontLab VI will expect the glyph recipes to be written using the “legacy” syntax that was used in the “Generate Glyphs” dialog of FontLab Studio 5. When turned off, FontLab VI will expect the glyph recipes to be written using a syntax that is largely compatible with the GlyphConstruction syntax. When Create auto layers is turned on, you can use only the “legacy” glyph recipe syntax.

All masters vs Active master only: choose to generate the glyphs in all masters or only in the current master.

Open new glyphs for editing: when turned on, FontLab will generate the requested glyphs and then immediately open them for editing in a new Glyph window. When turned off, FontLab will just generate the glyphs.

Flag new glyphs (at bottom left) allows you to color-code the cells for your newly-generated glyphs, so you can distinguish them more clearly/easily from others.

There are five tabs under Generate Glyphs: Characters, Ligature, Variants, Precomposed and Custom. The first four tabs work based on a selection in the Font Window or the Glyph Window. The Custom tab allows you to type or paste your own glyph recipes using a special syntax.

Selection-based glyph generation»

If you select glyphs or empty glyph cells in the Font Window, or if you select some glyphs or characters (including those that don’t exist in the font yet) in a Glyph Window, you can use Generate Glyphs to build a series of Unicode characters, a ligature, a series of glyph variants or a precomposed glyph. To use the selection-based glyph generation, before you invoke Generate Glyphs:

  1. If you’re in the Font Window, select some glyph cells in the Font Window. You can include empty (gray) glyph cells in your selection if you have a particular encoding or codepage active in the Font Window.
  2. If you’re in the Glyph Window, do one of the following:
    • type or paste arbitrary text using the Text tool
    • type or paste text or glyphtext (using the /glyphname and \uXXXX notation) into the text field in the content sidebar
    • choose a text from the Text dropdown menu in the content sidebar
    • choose a text from the Pairs and Phrases panel.

When the Text tool is active in the Glyph Window, you can optionally select some portion of the text visible in the Glyph Window. If another tool is active, the entire text visible in the Glyph Window will be treated as the selection.

The glyphs or text that you have selected will be treated as the input selection for the Generate Glyphs dialog, and depending on the Generate Glyph tab, FontLab will use different methods to interpret the input selection. When you have a selection, choose Font > Generate Glyphs. Now you can use one of the four tabs in the Generate Glyphs dialog to choose the glyph generation method:

Characters: this method will treat the input selection as a string of Unicode characters, so for every character in your input selection, FontLab will try to generate a new glyph. This method is most useful if you have a pre-existing text that contains various Unicode characters, and you’ve pasted that text into the Glyph Window (remember, you can always select just a portion of the text using the Text tool before invoking Generate Glyphs). Using the Characters tab is a very easy method to generate all glyphs required to render a particular Unicode text. So if your input selection was the text fön, FontLab will try to generate the glyphs f, odieresis and n.

Ligature: this method will form a ligature. It will generate exactly one glyph which horizontally combines the glyphs from the input selection. The advance width of the resulting glyph will be the sum of the advance widths of the input selection. So if your input selection was the text fön, FontLab will try to generate the glyph f_odieresis_n. This method works sensibly if you type in some text in the Glyph Window and then select a few characters using the Text tool.

Variants: this method will generate a series of glyphs that are intended to be variants of the glyphs from the input selection. This method works well if you made your input selection in the Glyph Window or in the Font Window. For each selected glyph, FontLab VI will try to generate a new glyph with identical contents and metrics, but adding a suffix to each glyph’s name. You can specify the suffix in the left portion of the dialog. So if your input selection was the text fön and you specify the suffix ss01, FontLab will try to generate the glyphs f.ss01, odieresis.ss01 and n.ss01.

Precomposed: this method will generate exactly one glyph which overlays all glyphs from the input selection into one glyph. The advance width of the new glyph will be equal to the width of the first glyph from the input selection. This method will position the overlaid glyphs using Anchors if they are present in the source glyphs.

Custom glyph generation»

The last tab of the Generate Glyphs dialog, Custom, allows you to enter (type or paste) your own glyph generation code using a special syntax. If you just enter a glyphname, FontLab will look up its built-in glyph generation database and try to build the glyph from existing glyphs. You can also use the GlyphConstruction syntax to describe the glyph generation code.

With the Use legacy (FLS5) code checkbox enabled, the glyph generation code consists of space-separated or comma-separated entries (one per target glyph), and each entry uses the “legacy” syntax that was used in FontLab Studio 5:

[result glyph name] or [glyph recipe]=[result glyph name]

Built-in glyph recipes»

FontLab has a built-in alias.dat database that, for a number of “known” glyph names includes recipes that define how a given glyph should be generated from component glyphs. If you place your own alias.dat file in the Data subfolder inside FontLab’s user data folder, FontLab will use that instead.

If your glyph generation code only includes the [result glyph name], FontLab will use in the alias.dat file to try to find the recipe that describes the generation of the glyph that uses that name.

For example, when you generate the Agrave (“À”) glyph, FontLab will look up alias.dat for a glyph recipe for Agrave. If it finds one or more such recipes, it will:

  • Find the first recipe, and then will find the A base glyph, then find the the grave.case mark glyph, and insert them as components into Agrave glyph. The Agrave glyph will get the advance width of A since that is the base glyph.
  • If any of the component glyphs cannot be found in the font, FontLab will attempt a fallback recipe, which is to insert the A glyph and the gravecomb glyph. If those are not found, it will try A and grave.
  • If none of the recipes give the full result, FontLab will use the last recipe and build the glyph using as many component glyphs as it can find.

Custom glyph recipes»

If FontLab’s or your own alias.dat doesn’t know how to generate your glyph, or if you use a different glyph naming scheme, or if you’d like to provide some positioning clues for your component glyphs, you can use custom glyph recipes. These recipes use a special syntax that tells FontLab which components it should add to the glyph, and provides clues where to place them. FontLab VI can use one of two syntaxes for custom glyph recipes:

  • The “legacy” syntax which is compatible with FontLab Studio 5 and can be used in the Generate Glyphs dialog box, in alias.dat and in auto layers.
  • The GlyphConstruction syntax which can only be used in Font > Generate Glyphs > Custom, but not in auto layers.

When using the legacy syntax, the glyph generation code consists of a series of entries in the form of [glyph recipe]=[result glyph name]. Each entry must be separated by a space, comma, semicolon or a newline.

Attachment operators»

Each glyph recipe consists of one or more base component glyph names separated by attachment operators. Two attachment operators are defined:

_ (underscore) – spacing attachment

The spacing attachment operator appends the following glyph to the right of the preceding glyph and extends the resulting glyph’s width by its own advance width. Note: you can surround glyph names with single quotes (') if they already use _ in their glyph name. Examples:

f_l=fl, f_i=fi, c_t=ct, 'f_f'_i=f_f_i

+ (plus) – non-spacing attachment

The non-spacing attachment operator treats the following glyph as a mark so it attaches it to the preceding glyph but does not modify the advance width.

For example:

C+caron=Ccaron A+dieresis=Adieresis

Positioning suboperators»

In the recipe, the + operator may be optionally followed by one or two positioning suboperators:

horizontal positioning
| place the following glyph at the origin point of the preceding glyph
< align the following glyph to the left of the bounding box of the preceding glyph
> align the following glyph to the right of the bounding box of the preceding glyph
(no suboperator) center following glyph horizontally over the bounding box of the preceding glyph
vertical positioning
~ place the following glyph at the baseline
^ shift the following glyph by the difference between the font’s caps height and x-height
(no suboperator) shift or do not shift the following glyph, depending on whether the preceding glyph is an uppercase or a lowercase character

For example:

A+^>dotaccentcomb=Adotaccent

Add a number after alignment suboperator to additionally shift the component (the number must be an integer number in per-mille of the UPM size, i.e. 500 is always “half the current UPM size”). For example:

A+|-200~50acutecomb=Aacute

will place acutecomb component on the origin point of the A component, then shift it horizontally by -200‰ of the UPM, and shift it vertically by 50‰ of the UPM.

Special operators»

At the end of the recipe, you may optionally include the “decompose” operator:

% (percent) – “decompose” (force unlinking references)

When used, the resulting glyph will have references unlinked (so the elements will be independent). This is useful when you intend to modify the glyph heavily after you’ve generated it.

If FontLab cannot find a component required by a recipe, it will still generate the auto layer, but will print warning in the Output panel. If one glyph’s recipe refers to itself or to a second glyph which in turn refers to the first glyph, FontLab will not generate an auto layer and print a “circular references” error.

Comments in glyph recipes»

In alias.dat, the Custom tab of Generate Glyphs and in the auto layer glyph recipe field, you can follow any glyph recipe with a comment prefixed with #. Anything that follows the # character will be interpreted as the comment.

When the glyph is generated, the comment is placed into the glyph’s Note.

In Generate Glyphs > Custom, you use comments and provide recipes for multiple glyphs by separating them with newlines rather than spaces, semicolons or commas.

Custom glyph recipes in auto layers»

You can use the legacy syntax in the recipe text field next to the Auto layer toggle to specify a custom recipe for that auto layer. Then, FontLab will not look up the glyph name in alias.dat but instead, it will interpret the custom auto layer recipe specified in that text field.

When you’ve used custom recipes to build auto layers in Generate Glyphs, FontLab will automatically insert the recipes you’ve used into the auto layer recipe field.

Example: If the Agrave glyph has an auto layer with an empty recipe field, it will use the alias.dat recipe, as described above. But if you enter A+uni0300 in that field, FontLab will use that recipe instead, and build the auto layer from as many component glyphs as it can find in the font.

Anchors in generated glyphs»

If a custom recipe is used to generate an auto layer or if Use anchors is turned on in Generate Glyphs, the positioning suboperators will only be used if the base and mark glyphs don’t have corresponding anchors.

If the component glyphs have corresponding anchors, those anchors will be used for positioning.

Example: If the A base glyph has a top anchor placed somewhere above the letterform, and either the grave.case or the gravecomb mark glyph has a _top anchor placed somewhere below the letterform, then in Agrave, FontLab will position the _top anchor of the mark glyph in the same location as the top anchor of the base glyph.

You can use any anchor names as long as the anchor in the mark glyph uses the same name as the one in the base glyph, but with a _ prefix. If the glyphs don’t have matching anchors, FontLab will use the positioning clues encoded in the glyph recipe, which in this case will be “horizontally center the grave.case glyph” or “horizontally center the gravecomb glyph and raise it by the difference of the font master’s caps height and x-height”.

Auto layers and composite glyph layers inherit anchors from all component glyphs used to generate the layer, but without duplicated anchors. When FontLab generates the Aringacute manual or auto layer using the A+ringcomb+acutecomb recipe, and all three component glyphs have a top anchor, the final glyph will get the top anchor from acutecomb, placed accordingly. Anchors not present in acutecomb will be inherited from ringcomb, and finally, those not present there, from A.