diff --git a/axisregistry/Lib/axisregistry/__init__.py b/axisregistry/Lib/axisregistry/__init__.py index 30278fa91..09f8a3024 100644 --- a/axisregistry/Lib/axisregistry/__init__.py +++ b/axisregistry/Lib/axisregistry/__init__.py @@ -437,6 +437,7 @@ def build_static_name_table(ttFont, family_name, style_name): name_table = ttFont["name"] name_table.removeNames(platformID=1) existing_name = ttFont["name"].getBestFamilyName() + removed_names = {} names = {} is_ribbi = ( @@ -455,6 +456,7 @@ def build_static_name_table(ttFont, family_name, style_name): 21, 22, ): + removed_names[name_id] = name_table.getDebugName(name_id) name_table.removeNames(nameID=name_id) else: style_tokens = style_name.split() @@ -477,8 +479,23 @@ def build_static_name_table(ttFont, family_name, style_name): names[(NameID.TYPOGRAPHIC_SUBFAMILY_NAME, 3, 1, 0x409)] = style_name # we do not use WWS names since we use the RIBBI naming schema for name_id in (21, 22): + removed_names[name_id] = name_table.getDebugName(name_id) name_table.removeNames(nameID=name_id) + # If STAT table was using any removed names, add then back with a new ID + if "STAT" in ttFont and removed_names: + if ttFont["STAT"].table.AxisValueArray: + for av in ttFont["STAT"].table.AxisValueArray.AxisValue: + if av.ValueNameID in removed_names: + av.ValueNameID = name_table.addMultilingualName( + {"en": removed_names[av.ValueNameID]} + ) + for av in ttFont["STAT"].table.DesignAxisRecord.Axis: + if av.AxisNameID in removed_names: + av.AxisNameID = name_table.addMultilingualName( + {"en": removed_names[av.AxisNameID]} + ) + names[(NameID.UNIQUE_FONT_IDENTIFIER, 3, 1, 0x409)] = _updateUniqueIdNameRecord( ttFont, {k[0]: v for k, v in names.items()}, (3, 1, 0x409) ) diff --git a/axisregistry/Lib/axisregistry/data/bleed.textproto b/axisregistry/Lib/axisregistry/data/bleed.textproto new file mode 100644 index 000000000..ed8abb81a --- /dev/null +++ b/axisregistry/Lib/axisregistry/data/bleed.textproto @@ -0,0 +1,16 @@ +# BLED based on https://github.com/jenskutilek/homecomputer-fonts +tag: "BLED" +display_name: "Bleed" +min_value: 0 +default_value: 0 +max_value: 100 +precision: 0 +fallback { + name: "Default" + value: 0.0 +} +fallback_only: false +description: + "Bleed adjusts the overall darkness in the typographic color of strokes or other forms, without" + " any changes in overall width, line breaks, or page layout. Negative values make the font appearance" + " lighter, while positive values make it darker, similarly to ink bleed or dot gain on paper." diff --git a/axisregistry/Lib/axisregistry/data/scanlines.textproto b/axisregistry/Lib/axisregistry/data/scanlines.textproto new file mode 100644 index 000000000..15a809b7b --- /dev/null +++ b/axisregistry/Lib/axisregistry/data/scanlines.textproto @@ -0,0 +1,16 @@ +# SCAN based on https://github.com/jenskutilek/homecomputer-fonts +tag: "SCAN" +display_name: "Scanlines" +min_value: -100 +default_value: 0 +max_value: 100 +precision: 0 +fallback { + name: "Default" + value: 0 +} +fallback_only: false +description: + "Break up shapes into horizontal segments without any changes in overall width," + " letter spacing, or kerning, so there are no line breaks or page layout changes." + " Negative values make the scanlines thinner, and positive values make them thicker." diff --git a/axisregistry/Lib/axisregistry/data/shadow_length.textproto b/axisregistry/Lib/axisregistry/data/shadow_length.textproto new file mode 100644 index 000000000..45a46ae20 --- /dev/null +++ b/axisregistry/Lib/axisregistry/data/shadow_length.textproto @@ -0,0 +1,15 @@ +# SHLN based on https://github.com/EkType/Honk +tag: "SHLN" +display_name: "Shadow Length" +min_value: 0.0 +default_value: 50.0 +max_value: 100.0 +precision: -1 +fallback { + name: "Default" + value: 50.0 +} +fallback_only: false +description: + "Adjusts the font's shadow length from no shadow visible (0 %)" + " to a maximum shadow applied (100%) relative to each family design." diff --git a/axisregistry/Lib/axisregistry/data/sharpness.textproto b/axisregistry/Lib/axisregistry/data/sharpness.textproto index c12217ad9..6b12c33ee 100644 --- a/axisregistry/Lib/axisregistry/data/sharpness.textproto +++ b/axisregistry/Lib/axisregistry/data/sharpness.textproto @@ -1,4 +1,4 @@ -#SHRP based on https://github.com/monokromskriftforlag/geologisk/ +#SHRP based on https://github.com/googlefonts/geologica tag: "SHRP" display_name: "Sharpness" min_value: 0