Instances: Combine, manipulate and replace glyphs on export

I’m trying to create a 3D color-font (multiple layers) which also works as normal font (one layer) that provides a few different combinations (e.g. by just changing the contour direction of the inner parts).
I would like to be abel to export those variations without building them manually (incl. the outline if possible).
I thought of the instances as the place to do such things…

In other words - these are the things i’m trying to figure out:

  • Combining glyphs on export OR How to minimize the amount of layers/glyphs for multiple use?
  • Apply GlyphsFilterOffsetCurve filter only on certain glyphs (*.outline) OR How to reuse glyphs of another instance?
  • Reverse Glyph Contours on export

Below you can find some “Custom Parameters” for instances mixed with pseudo code (bold) to show what I intend to do:

Instance 1 (simple single-layer-font):
Rename Glyphs = “A.inner1 + A.inner2=A” [DOES NOT WORK THAT WAY]

Instance 2 (multi-layer-font: outline):
Rename Glyphs = “A.inner1 + A.inner2=A” [DOES NOT WORK THAT WAY]
Filter = "GlyphsFilterRemoveOverlap;"
Filter = “GlyphsFilterOffsetCurve;15;15;0;0;0;”

Instance 3 (multi-layer-font: inner1):
Rename Glyphs = “A.inner1=A”

Instance 4 (multi-layer-font: inner2):
Rename Glyphs = “A.inner2=A”

Instance 5 (multi-layer-font: visual fix 1 - in case outline color = inner1 color ):
Rename Glyphs = “A.fix1=A”

Instance 6 (multi-layer-font: visual fix 2 - in case outline color = inner2 color ):
Rename Glyphs = “A.fix2=A”

Instance 7a (single-layer-font: full version 1):
Rename Glyphs = “A.inner1 + A.inner2=A.outline” [DOES NOT WORK THAT WAY]
Filter = "GlyphsFilterRemoveOverlap;"
Filter = “GlyphsFilterOffsetCurve;15;15;0;0;0;” *# only the .outline glyphs should be affected or use glyphs from “outline” instance…?
Rename Glyphs = “A.outline + A.inner1 + A.inner2 + A.fix1=A” [DOES NOT WORK THAT WAY]

Instance 7b (single-layer-font: full version 2 - inverted):
Rename Glyphs = “A.inner1 + A.inner2=A.outline” [DOES NOT WORK THAT WAY]
Filter = "GlyphsFilterRemoveOverlap;"
Filter = “GlyphsFilterOffsetCurve;15;15;0;0;0;” *# only the .outline glyphs should be affected or use glyphs from “outline” instance…?
Reverse Glyph Contours = “A.inner1,A.inner2” [DOES NOT EXIST AFAIK]
Rename Glyphs = “A.outline + A.inner1 + A.inner2 + A.fix2=A” [DOES NOT WORK THAT WAY]

Summary of the above steps and the idea behind them:

  • Rename Glyphs (trying to combine two glyphs while renaming, which is not supported)
  • Filter = “GlyphsFilterRemoveOverlap;” (actually combine the two paths to get a clean single path for the GlyphsFilterOffsetCurve filter)
  • Filter = “GlyphsFilterOffsetCurve;15;15;0;0;0;” (I’m looking for a way to create the outline on export but reusing the result somehow. Applying GlyphsFilterOffsetCurve only on certain glyphs would work too)
  • Reverse Glyph Contours (not supported - I wish I could change the contour directions)

Maybe I’m on the completely wrong path here and you can easily point me in the right direction but that’s the best I could think of based on what I currently believe to know :wink:

I just hope you get the idea and why I want to do something like this.
Thank you in advance for your feedback.

all wrongs reserved

There combination of glyphs is currently not possible but should be easy to implement by a custom filter.

this is possible. Add a “include:A,B” at the end of the filter string. This is explained in the help page that you can open by clicking the (?) button in the instance settings.

this might be possible with mekkablues LayerGeek filter, or by a custom filter.

Thank you for the fast feedback.
I’m glad my idea is not completely off :wink:

And thank you for the hint with “include:A,B” - didn’t notice.

LayerGeek looks promising and gives a lot of new options for manipulations. Some may even help in this matter (removing first component [outline] in order to get the simple single-layer-font). A shame “Reverse Contours” seems not to be available yet. I might ask @mekkablue (via github?) to add this to his awesome filter. Hopefully this means only to add this function to the interface because it’s already possible via GUI.

Combining glyphs:
I don’t really know how to create such a filter for glyphsapp (yet). I do write some python scripts by now but mostly by playing with existing ones and adapting/learning from them.
But this looks like some Xcode OSX-app-knowledge is required.

There are Python templates with step-by-step instructions, and there is extensive documentation of the Python API. For what you want to do, I would say that it will really pay off for you if you intensify your Python.

Shoot! I’m sorry for my very late response. I managed not to submit my old response I’ve already typed :see_no_evil:

However, I almost finish my plugin which now (almost) supports the required functionality to finish my font as well as all possible methods the GSLayer provides (incl. LSB etc.).

The following methods will be available via this Plugin (+/-):

  • addComponents* (can be used to combine multiple glyphs)
  • removeComponents* (can be used to remove parts of a glyph)
  • removeAllComponentsBut*
  • decomposeComponents* (extended version of GSLayer.decomposeComponents() that allows you to decompose all or some components)
  • reversePaths (reverse all path directions – whatever the current direction is)
  • reversePathsClockwise (make all path directions clockwise)
  • reversePathsCounterClockwise (make all path directions couter clockwise)
  • reverseComponents* (reverse all path directions of all or some components – whatever the current direction is)
  • reverseComponentsClockwise* (make all path directions of all or some components clockwise)
  • reverseComponentsCounterClockwise* (make all path directions of all or some components couter clockwise)
  • disableComponentAlignment* (disable auto alignment of all or some component – required at least once when rebuilding an entire glyph – otherwise all components will be placed beside of each other
  • enableComponentAlignment* (enable auto alignment of all or some component)

* allows wildcard input for filtering (P.S. wildcards will NOT be available for include/exclude list)


Config options

  • setSearchConfig (wildcard search handling – change default config before and/or between different manipulations)
  • resetSearchConfig (resets the stored value to the default [0] –> less picky)


BUT, after I kind of finished the plugin I’ve found a major problem:
The plugin itself works just fine in Edit View, but if the plugin is called as custom filter of an instance, all glyphs are already decomposed.
For this problem and a few other things i’ve created a new post: Filter-Plugin export problem and more.

If I’m abel to find a solution for this problem I will post the link to the plugin here – in case somebody else is looking for such functionality.

best regards