fix: remove erroneous GSUB substitutions from halt/palt/vhal/vpal (kanji switching to Chinese glyphs) - #12
fix: remove erroneous GSUB substitutions from halt/palt/vhal/vpal (kanji switching to Chinese glyphs)#12halken wants to merge 4 commits into
Conversation
The `halt` (Alternate Half Widths) and `palt` (Proportional Alternate Widths) features—together with their vertical counterparts `vhal` and `vpal`—were defined as GSUB substitution lookups instead of GPOS metric adjustments. These lookups contained hundreds of ideograph substitutions copied from the traditional-forms (`trad`), JIS78/JIS90 (`jp78`/`jp04`) and vertical (`vert`/`vrt2`) features, including many Japanese shinjitai-to-traditional conversions (e.g. 亜→亞, 医→醫, 円→圓). As a result, enabling `halt`/`palt` for width adjustment in Figma or via CSS `font-feature-settings` unexpectedly switched Japanese kanji to Chinese (traditional) glyph forms. This defect was present from the initial import of the Glyphs source and affects all four weights (Thin/Regular/Bold/ExtraBold). Fix: clear the substitution code from `halt`/`palt`/`vhal`/`vpal` in all four `fontinfo.plist` sources so these features no longer alter glyphs. Glyph-form switching remains available through the dedicated `trad`, `jp78` and `jp04` features, which are left untouched. Verification: - hb-shape: `halt=1`/`palt=1` no longer change kanji glyphs; `trad=1` still converts to traditional forms. - GSUB: halt/palt/vhal/vpal substitution counts are 0 in all weights; trad (309) and jp78 (299) are preserved. - fontspector (googlefonts profile): identical results before and after (PASS 313 / WARN 98 / FAIL 25 / ERROR 4); no new failures introduced. Note: this change only stops the incorrect glyph substitution. Proper half-/proportional-width GPOS metrics for halt/palt are out of scope and can be added separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The build job only uploads the github-pages artifact on the main branch, but the deploy job ran unconditionally. On PR branches the deploy job tried to deploy a non-existent artifact and failed. Add the same main-branch guard to the deploy job so it is skipped on non-main branches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The shaping/regression check was SKIPped because no test directory was declared, so nothing guarded against the class of bug fixed in 34ca0c2: metric features (halt/palt/vhal/vpal) carrying GSUB substitutions. Declare the test directory in fontspector.toml and wire --configuration into `make test`, so both local runs and CI pick it up. The tests cover all four features that were cleaned up, plus trad as a positive control. Every case was chosen so that it actually discriminates: run against the currently published Google Fonts binaries, 5 of the 6 cases fail; run against this branch, all 6 pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Google Fonts needs the version to increase before it can ship the halt/palt fix: the published binaries are byte-for-byte the same versions as our sources were (Thin 1.008, Regular 1.003, Bold 1.010, ExtraBold 1.015), and fontspector's googlefonts/version_bump failed with `same-version`. The four weights were also versioned independently, which opentype/family/equal_font_versions reported as a mismatch. Unify them on 1.016 instead of bumping each one separately: it is higher than every published weight, so the update is unambiguous, and the family now carries a single version going forward. Both checks now pass on all four weights. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fontspector review of this PRFollowing the suggestion to run Fontspector before submission, here is what we checked and what we found. Tool: fontspector 1.7.3, Summary: against a fresh build of To be precise about the claim: LINE Seed JP still has pre-existing FAILs (listed in section 4). What we verified is that this PR resolves three problems and touches none of the others. 1. Full before/afterBoth builds checked with the same command (
Every one of the six differences:
No other check changed status or status code, in either direction. That the substitution removal itself is behaviour-neutral is expected: 2. The bug is now covered by a machine check
The cases were chosen so that they actually discriminate — 5 of the 6 fail on The
3. Version bumpThe published binaries carry exactly the versions our sources had (Thin 1.008, Regular 1.003, Bold 1.010, ExtraBold 1.015), so We unified all four weights on 1.016 — higher than every published weight, so the update is unambiguous, and the family carries a single version from here on. 4. Pre-existing FAILs, untouched by this PRFor transparency, the 14 remaining FAILs — none related to this change:
There are also 4 5. Origin of the bugWorth noting for the record: this was not introduced in this repository. We traced the whole git history and the very first commit (2023-11-27) already had Reproducingrm -rf LINESeedJP/sources/instance_ufos build.stamp # gftools caches these
make build
make testThe |
Summary
Enabling
halt(Alternate Half Widths) orpalt(Proportional Alternate Widths) in Figma or via CSSfont-feature-settingsunexpectedly switched some Japanese kanji to Chinese (traditional) glyph forms (e.g. 亜→亞, 医→醫, 円→圓, 辺→邊).Root cause:
halt/palt— and their vertical counterpartsvhal/vpal— were defined as GSUB substitution lookups instead of GPOS metric adjustments.Each contained hundreds of ideograph substitutions copied from the traditional-forms (
trad), JIS78/JIS90 (jp78/jp04) and vertical (vert/vrt2) features, so a feature meant only to adjust glyph width also changed the glyph shape.The defect has existed since the initial import of the Glyphs source and affects all four weights (Thin / Regular / Bold / ExtraBold).
Changes
halt,palt,vhalandvpalin all fourfontinfo.plistsources so these features no longer substitute glyphs.trad,jp78andjp04features.Verification
halt=1/palt=1, kanji glyphs no longer change; withtrad=1, traditional-form conversion still works as expected.trad(309) andjp78(299) are preserved.Notes
halt/paltis out of scope and can be done in a follow-up.gftools buildercachesLINESeedJP/sources/instance_ufos/.Remove that directory (and
build.stamp) before rebuilding, otherwise source changes to feature code may not be reflected in the output fonts.