Skip to content

Commit

Permalink
Fix feature writers list
Browse files Browse the repository at this point in the history
Add missing GdefFeatureWriter, and remove unneeded mode option from
KernFeatureWriter since we now always add insertion marker comment to
always generate kern feature even if a manual feature exists.
  • Loading branch information
khaledhosny committed Aug 1, 2023
1 parent 5d3cdd8 commit 66509dc
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Lib/glyphsLib/builder/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,15 @@
UFO2FT_COLOR_LAYERS_KEY = "com.github.googlei18n.ufo2ft.colorLayers"

UFO2FT_META_TABLE_KEY = PUBLIC_PREFIX + "openTypeMeta"
# ufo2ft KernFeatureWriter default to "skip" mode (i.e. do not write features
# if they are already present), while Glyphs.app always adds its automatic
# kerning to any user written kern lookups. So we need to pass custom "append"
# mode for the ufo2ft KernFeatureWriter whenever the GSFont contain a non-automatic
# 'kern' feature.
# See https://glyphsapp.com/tutorials/contextual-kerning

DEFAULT_FEATURE_WRITERS = [
{"class": "KernFeatureWriter", "options": {"mode": "append"}},
{"class": "KernFeatureWriter"},
{
"module": "glyphsLib.featureWriters.markFeatureWriter",
"class": "ContextualMarkFeatureWriter",
"options": {"mode": "skip"},

This comment has been minimized.

Copy link
@anthrotype

anthrotype Aug 1, 2023

Member

mode="skip" is already default so you don't need to override "options" here

This comment has been minimized.

Copy link
@khaledhosny

khaledhosny Aug 1, 2023

Author Collaborator

There was this comment that was removed earlier by Simon:

# NOTE: Even though we use the default "skip" mode for the MarkFeatureWriter,
# we still must include it this custom featureWriters list, as this is used
# instead of the default ufo2ft list of feature writers.
# This also means that if ufo2ft adds new writers to that default list, we
# would need to update this accordingly... :-/

From c792de7

This comment has been minimized.

Copy link
@anthrotype

anthrotype Aug 1, 2023

Member

yeah but the comment refers to the need to add an entry for the writer, not to add 'options' key, that one can be omitted if you are not overriding any default options for that specific writer

},
{"class": "GdefFeatureWriter"},
{"class": "CursFeatureWriter"},
]

Expand Down

0 comments on commit 66509dc

Please sign in to comment.