Font filters, components and glyph metrics in FontLab VI 6.1
FontLab VI 6.1 is a major free update to FontLab VI that brings a large number of improvements. This article gives a detailed description of the improvements in these areas:
- Components as a standards-compliant way to build glyphs from other glyphs
- Font filters and Font window sidebar for better filtering of and navigating within your glyph set
- Nonspacing components and elements for a more intuitive spacing experience of composite glyphs
- Metrics expressions for faster and easier linking of glyph metrics across glyphs and layers
- For a general overview of the FontLab VI 6.1 improvements, see the FontLab VI 6.1 blog post.
- For a complete description of the improvements and bug fixes in FontLab VI 6.1, see the Release Notes.
Components in FontLab VI 6.1»
FontLab VI 6.1 (re-)introduces Components as a standards-compliant way to build glyphs from other glyphs.
Components in FontLab VI 6.1 work very much like components in FontLab Studio 5, UFO or in TrueType-flavored OpenType fonts. They point to a source glyph and have a transformation (usually shift, optionally also scale, rotation or slant). That’s it. If you’ve used Components any other font editor, you’ll find yourself at home easily.
To start using Components:
- Open a TTF, VFB or UFO if Preferences > Open Fonts > Use Components is on.
- Open a VFC or VFJ, select all glyphs in the Font window, and choose Element > Element Reference > References to Components. Repeat this for each master.
In previous versions of FontLab VI, you could use Element References to work with repeatable shapes across a font. Element References work great when you want to re-use a design pieces such as a stem, a serif or other glyph fragments (contours or images) across multiple glyphs in the same layer, and maintain a link between all the places where you’ve placed it. All Element References are equal. There is no source glyph to which they point to — they all link to each other. Element References have no knowledge about glyph metrics or anchors. In a way, they’re very similar to subroutines used in PostScript-flavored (CFF) OpenType fonts.
Previous versions of FontLab VI simulated components using Element References, by locking some references and dynamically finding the best candidate glyph for a component source. But this was never a fully satisfying experience, so we’ve decided to add support for real Components.
Element References are great if you link between pieces of glyphs, or even between pieces within the same glyph. Components are great if you build composite glyphs from other glyphs. So FontLab VI 6.1 has both mechanisms, each to fit its purpose.
You can build composite glyphs from Components in one or all masters — via Generate Glyphs, Add Component, Copy-Paste or Auto Layers. You can mix Components and simple contours in one layer. You can use nested Components that point to glyphs that are made of Components (for example, you can build a
dieresiscomb glyph from two
dotaccentcomb Components, and then build
Adieresis from the Components
FontLab VI will keep your Component structure when it exports your font to a format that supports components (TTF, VFB, UFO), and will decompose Components as needed when a format does not support components at all, or does not support some aspects such as rotated Components or Components mixed with contours.
Start using Components»
You can decide to use Components or keep using Element References in FontLab VI. For that, in Preferences > Open Fonts > Composite glyphs, choose:
- Use components and FontLab VI will prefer to use Components.
- Convert components to element references and FontLab VI will prefer to use Element References.
Opening FontLab VI files (VFC, VFJ)»
When you open a font in the
.vfc or .
vfj format, FontLab will keep your Element References as Element References, and will keep your Components as Components. If you wish, you can convert Element References to Components at any time (see below).
The exception is Auto Layers, since FontLab builds them dynamically: if Use components is on, FontLab will use Components, and if Convert components to element references is on, FontLab will use Element References to dynamically build your Auto Layers.
Opening font formats that support components»
When you open a font in a format that supports components (
.glyphs, and their derivatives such as
- if Use components is on, FontLab will import the Components exactly as they are in the font
- if Convert components to element references is on, FontLab will convert the components to Element References
Opening font formats that don’t support components»
If you turn on Preferences > Open Fonts > Detect composites and open a font in a format that does not support components (e.g.
.otf or Type 1), FontLab will build Element References between repeating contours across the font. If Use components is on, FontLab will then convert Element References to Components (see below).
Converting Element References to Components»
To convert existing Element References to Components, select all (or some) glyphs in the Font window, and choose Element > Element Reference > References to Components. Repeat this for each master.
- If the font has a glyph where a referenced Element is used by itself, FontLab will use it as the source glyph for the Components, and will convert all other Element References into Components.
- If the font has is more than one glyph where a referenced Element is used by itself, FontLab will use the glyph as source where the referenced Element is unlocked and is “least transformed”, i.e. it is placed closest to the origin point (0, 0) and has no other transformations applied.
- If the font does not have a glyph that can be used as the source glyph for the Components, FontLab will keep Element References as they were.
If you’ve created some “helper glyphs” that hold your design parts like serifs or stems, then Element References to those glyphs will be converted to Components.
If you use Element > Element Reference > References to Components in the Glyph window, FontLab will attempt to convert all Element References in the current layer into Components using the just-described mechanism.
Automatically adding components»
If Use components is on, FontLab will use Components:
- when you use Font > Generate Glyphs
- when you turn on Glyph > Auto Layer for a glyph layer or turn on the Auto layer button in the Layers & Masters panel
- when you have Preferences > Operations > New glyphs > fill created glyphs with content when available turned on and you double-click on an empty glyph cell in the Font window
- when you perform Font > Detect Composites (will use them if it can)
If Convert components to element references is on, FontLab will use Element References instead (and the menu item will be Font > Detect Element References).
Tip: To quickly replace your manually-constructed composite glyph master with an automatically generated glyph master that will use the “correct” components (if it’s in FontLab’s
alias.dat database), turn on Glyph > Auto Layer. If you want to correct the placement of the components, turn Glyph > Auto Layer off.
Manually adding components»
Glyph > Add Component…»
Choose Glyph > Add Component… in the Glyph window (or right-click and choose it from the context menu) to add a component to the current master or all masters of your current glyph. Or use it in the Font window to add the same component to multiple glyphs at once.
In the Add Component dialog, start typing the glyph name of the component you want to add, and you’ll see a list of results. When the Find glyph name synonyms toggle is on, FontLab will also find
Decyr if you type in
uni0414 or vice-versa. By default, FontLab will insert the first glyph on the list but you can pick a different one.
At the bottom of the dialog, you can decide where to place the inserted component:
- If you leave the X and Y fields empty, FontLab will:
- use matching anchors if available (e.g.
topin the current glyph and
_topin the component glyph)
- otherwise it will center the inserted component horizontally, and will shift the component upwards by the difference of caps height and x‑height if you’re adding a mark component to an uppercase letter, but will do no vertical shift if the mark’s name ends with
.capor if you’re adding a component that isn’t a mark
- use matching anchors if available (e.g.
- You can enter a numeric value into either X or Y or both, then FontLab will use the value for the specified coordinate, but if a field is blank, FontLab will use the above procedure for that coordinate (so you can enter
0in Y and leave X blank, and you’ll get a horizontally centered component with no vertical shift)
- You can enter an anchor name into either field — if the current glyph and the component have several matching anchors, the specified anchor will be used
- You can also mix anchor-based and absolute positioning, e.g. enter
0into X and
topinto Y will place the component at the origin point horizontally but use the specified anchor for vertical positioning
Use the Flip horizontally and Flip vertically buttons to mirror the inserted component.
Choose whether the current glyph should keep its metrics, or whether the advance width should be replaced by the width of the inserted component.
Use the Apply to all masters toggle to insert the component into the current master or to all masters.
In Font window, select one glyph cell and choose Edit > Copy. Then select one or more glyph cells and choose Edit > Paste Components, and FontLab will insert the copied glyph as a component into all selected glyphs in all masters.
In Font window, select more than one glyph cells and choose Edit > Copy. Then select one ore more glyph cells and choose Edit > Paste Components, and then FontLab will insert the first copied glyph as a component into the first selected glyph, the second copied glyph as a component into the second selected glyph, and so on — again, in all masters.
Components in FontLab VI 6.1 are special Elements which are “glyph filters”. So you can use the Element tool to move components (but you can also use the Contour tool). You can use most of the Element menu and the Elements panel to work with Components. For example:
- Use the
>keys to switch between Components in the current glyph.
- To open the Component’s source glyph for editing next to your current glyph, double-click a Component, or when a Component is active, press CtrlE, or right-click and choose Edit Element, or choose Element > Element Reference > Edit Element.
- To make a Component “first”, choose Element > Arrange > Send to Back or drag the Component to the bottom of the components list in the Elements panel.
- Align components and other elements within the glyph layer with the the Element > Align menu items.
- Use Element > Group if you want to always move several components in a glyph together, and Ungroup them if you don’t.
Replace a Component»
When you use the Contour or the Element tool and a Component is active, the Glyph window property bar will show an underlined C: icon, and a text field that shows the name of the component’s source glyph.
Type a different glyph name (or a synonym) into the text field, or click on the C: icon and type it in the Replace Component dialog, and press Enter — and the current component will be replaced in the current master with a component that points to a different glyph.
You can also replace a component in the current master by typing a new glyph name in the Glyph name field of the Elements panel (use the Show element properties to show the field).
To replace a component in all layers, you need to perform the replacement in each layer.
When a Component is active in the Glyph window, you can click on the Decompose button in the Glyph window property bar on in the Elements panel, and the component will be decomposed in the current layer, i.e. its contours and guidelines will be inserted into the current glyph.
To Decompose all components in the current layer, choose Glyph > Decompose or right-click in the Glyph window and choose Decompose from the context menu. However, if you’re in the Element tool and you Shift-click one or more Components, Glyph > Decompose and Decompose context menu item will decompose only the selected component(s).
When decomposing Components, FontLab will combine the contours of the decomposed Components and contours that pre-existed in the glyph into one single element — unless the source glyphs used different strokes or color fills.
- Element > Expand Filters will decompose a Component and remove any other Filters that exist in the source glyphs (for example Power Brush)
- Glyph > Flatten Glyph will decompose, remove filters and combine the decomposed elements into a single Element if possible
- Element > Separate Contours to Elements and Element > Optically Separate will also decompose, and then perform the separation
Convert Component to Element Reference»
Use Element > Element Reference > Component to Reference to convert a Component to an Element Reference. This is useful, for example, if you wish to apply some filters or change the fill color.
When you delete a glyph that is used as a source of Components in other glyphs, FontLab will convert the affected Components into Element References.
Nonspacing components and elements in FontLab VI 6.1»
FontLab VI now lets you declare some components or elements as nonspacing. Nonspacing components/elements don’t change the advance width of the glyph, but they change the way FontLab calculates and shows sidebearing values inside the app.
Unicode has a concept of “nonspacing characters” and OpenType fonts have “nonspacing glyphs”. During typesetting, nonspacing glyphs don’t contribute to the metrics of a line. They are positioned in relation to the preceding glyphs (the spacing glyphs) but their own metrics are ignored — so in the typesetting process, nonspacing glyphs have “invisible” metrics.
FontLab’s new Nonspacing components and elements perform a similar function when you build a glyph: they are visible, they are exported into the final font, and they don’t change the advance width of the glyph in any way, but inside FontLab VI they are “invisible” to the metrics engine. FontLab will ignore the Nonspacing components or elements when it shows the numerical values for the width and the sidebearings, when you copy metrics across glyphs using Paste Special, or when linked metrics are calculated using metrics expressions.
FontLab has a special guide called the “Measurement Line”. When you turn on View > Measurement Line, FontLab shows sidebearing values calculated at the intersection of the Measurement Line and glyph’s “ink”. This still works the same way. When you turn the Measurement Line off, the sidebearing values are calculated based on the bounding box of the entire glyph layer. With Nonspacing elements, you can exclude certain elements or components from that bounding box for the purposes of calculating the sidebearings. Of course when you export your font into a final format, FontLab will write the correct “absolute” metrics into the font.
Example: in the “ī” (
imacron) glyph, you can make the
macron component Nonspacing and then set the LSB and RSB to
macron component will be ignored when the final
imacron sidebearings are calculated, so it’s easier to link the
imacron metrics to those of
Using Nonspacing components and elements»
When you click a component using the Contour or Element tool in the Glyph window, or you click an element using the Element tool, a Nonspacing toggle appears in the Property bar. Use that toggle to set or unset the Nonspacing property of a component or element, or use the toggles in the Nonspacing column in the Elements panel.
When you turn on Preferences > Open Fonts > Automatically assign nonspacing property to accent components and you open any font, FontLab will assign the Nonspacing property to those components where their source glyph or its default variant (without glyph name suffix):
- has the glyph name
- or has the Unicode U+02B9 – 02BD, U+02C6 – 02CF, U+02EC,
- or is in the Unicode “Nonspacing Mark” or “Modifier Symbol” category,
- or has the OT Glyph Definition Class “Mark”
When this preference is on, FontLab will also use the above method to assign the Nonspacing property to components in Auto layers.
When you use Element > Nonspacing > Detect Nonspacing in the Font window, FontLab will use the above method to assign the Nonspacing property to components in the current layer of the selected glyphs. To do it for all layers, use Tools > Actions > Metrics > Nonspacing > Detect nonspacing.
If you use Element > Nonspacing > Detect Nonspacing in the glyph window, FontLab will use the above method to assign the Nonspacing property to the current element or to selected elements (so only the components that fit the criteria will become Nonspacing).
To unset the Nonspacing property in all masters, i.e. make all components and elements spacing, use Tools > Actions > Metrics > Nonspacing > Clear nonspacing. To do it in current layer only, use Element > Nonspacing > Clear Nonspacing.
If you do not want to use Nonspacing components or elements, use Tools > Actions > Metrics > Nonspacing > Clear nonspacing on All Masters and entire font, and turn off Preferences > Open Fonts > Automatically assign nonspacing property to accent components.