diff --git a/font-src/gen/build-font.js b/font-src/gen/build-font.js index c5ea118b4..ff05e948c 100644 --- a/font-src/gen/build-font.js +++ b/font-src/gen/build-font.js @@ -28,6 +28,6 @@ module.exports = function (para) { } } - finalizeFont(para, gs.glyphStore, excludeChars, font); - return { font, glyphStore: gs.glyphStore }; + const finalGs = finalizeFont(para, gs.glyphStore, excludeChars, font); + return { font, glyphStore: finalGs }; }; diff --git a/font-src/gen/finalize/index.js b/font-src/gen/finalize/index.js index faf0a3ec5..bca7ed624 100644 --- a/font-src/gen/finalize/index.js +++ b/font-src/gen/finalize/index.js @@ -10,7 +10,9 @@ const gcFont = require("./gc"); module.exports = function finalizeFont(para, glyphStore, excludedCodePoints, font) { glyphStore = forceMonospaceIfNeeded(para, glyphStore); glyphStore = gcFont(glyphStore, excludedCodePoints, font, {}); - extractGlyfCmap(regulateGlyphStore(para, glyphStore), font); + glyphStore = regulateGlyphStore(para, glyphStore); + extractGlyfCmap(glyphStore, font); + return glyphStore; }; function forceMonospaceIfNeeded(para, glyphStore) { diff --git a/font-src/glyphs/auto-build/accents.ptl b/font-src/glyphs/auto-build/accents.ptl index e59d0ae1c..52cacfdb6 100644 --- a/font-src/glyphs/auto-build/accents.ptl +++ b/font-src/glyphs/auto-build/accents.ptl @@ -104,6 +104,15 @@ glyph-block AutoBuild-Accents : begin set foundDecompositions.(glyphName) { glyphName code parts } local s_parts nothing + + define [recursivelyDecompose g sink] : begin + local decomposition : CvDecompose.get g + if decomposition : foreach gnPart [items-of decomposition] : begin + local g : query-glyph gnPart + if g : recursivelyDecompose g sink + : else : begin + sink.push : glyphStore.queryNameOf g + define construction : glyph-proc include s_parts.0 AS_BASE ALSO_METRICS foreach part [items-of : s_parts.slice 1] : if part : begin @@ -111,7 +120,10 @@ glyph-block AutoBuild-Accents : begin if (part.markAnchors && part.markAnchors.bottomright) : begin eject-contour 'serifRB' if [AnyDerivingCv.query s_parts.0] : begin - CvDecompose.set currentGlyph [s_parts.map : lambda [x] : glyphStore.queryNameOf x] + local decomposeParts { } + foreach part [items-of s_parts] : begin + recursivelyDecompose part decomposeParts + CvDecompose.set currentGlyph decomposeParts define [RootGlyphProc goalName code parts] : begin set s_parts parts