diff --git a/changes/14.0.2.md b/changes/15.0.0.md similarity index 58% rename from changes/14.0.2.md rename to changes/15.0.0.md index 95eda784b..872c6ce55 100644 --- a/changes/14.0.2.md +++ b/changes/15.0.0.md @@ -1,2 +1,3 @@ + * Add variant selector for dot and comma diacritics (#1309). * Fix enclosed glyphs' placement when having glyphs with different Y-shifting (#1310). \ No newline at end of file diff --git a/font-src/glyphs/auto-build/composite.ptl b/font-src/glyphs/auto-build/composite.ptl index 77d459598..b9dd50449 100644 --- a/font-src/glyphs/auto-build/composite.ptl +++ b/font-src/glyphs/auto-build/composite.ptl @@ -37,15 +37,26 @@ glyph-block Autobuild-Enclosure-Shared : begin glyph-block-export EnsureComponentGlyphT define [EnsureComponentGlyphT gidPart fnBuildup] : begin local rs : new Set + local linksGnMap : new Map + + # Build the original local gniPart : fnBuildup gidPart - local grs : AnyCv.query [query-glyph gidPart] - if (para.enableCvSs && grs) : foreach gr [items-of grs] : begin - local relatedGidPart : gr.get [query-glyph gidPart] + linksGnMap.set gidPart gniPart + + # Build the related, using a mesh query to find out all variants + local mesh : getGrMesh { gidPart } AnyCv query-glyph + foreach { gr { from } { relatedGidPart } } [items-of mesh] : begin local gniRelated : fnBuildup relatedGidPart - if [query-glyph gniPart] : begin - gr.set [query-glyph gniPart] gniRelated - if [query-glyph gniRelated] : begin - [query-glyph gniPart].tryBecomeMirrorOf [query-glyph gniRelated] rs + linksGnMap.set relatedGidPart gniRelated + + # Link relations + foreach { gr { from } { to } } [items-of mesh] : begin + local gniFrom : linksGnMap.get from + local gniTo : linksGnMap.get to + if (gniFrom && gniTo && [query-glyph gniFrom] && [query-glyph gniTo]) : begin + gr.set [query-glyph gniFrom] gniTo + [query-glyph gniFrom].tryBecomeMirrorOf [query-glyph gniTo] rs + return gniPart glyph-block-export getGlyphDefaultShift diff --git a/font-src/glyphs/auto-build/special-accented-letters.ptl b/font-src/glyphs/auto-build/special-accented-letters.ptl index 675d34e03..fbb1de294 100644 --- a/font-src/glyphs/auto-build/special-accented-letters.ptl +++ b/font-src/glyphs/auto-build/special-accented-letters.ptl @@ -10,7 +10,7 @@ glyph-block Autobuild-DCaron : begin glyph-block-import Mark-Shared-Metrics : markExtend glyph-block-import Letter-Latin-Lower-D - derive-glyphs 'dcaron' 0x10f 'd' : lambda [src sel] : glyph-proc + derive-glyphs 'dcaron' 0x10f 'd' : lambda [src gr] : glyph-proc include : refer-glyph "commaAbove" include : Translate (Width + (RightSB - SB) / 2 + markExtend / 2) 0 local f : Widen {src} 0.95 1 diff --git a/font-src/glyphs/auto-build/transformed.ptl b/font-src/glyphs/auto-build/transformed.ptl index d667f40fe..dc1a9ee88 100644 --- a/font-src/glyphs/auto-build/transformed.ptl +++ b/font-src/glyphs/auto-build/transformed.ptl @@ -44,7 +44,7 @@ glyph-block Autobuild-Transformed-Shared : begin local dstName : wrapName groupID srcName suggestMappedName targetNameMap srcName dstName - local tree : getGrTree srcName {DotlessOrNot AnyCv} query-glyph + local tree : getGrTree srcName { DotlessOrNot AnyCv } query-glyph foreach [{gr origSrcName relSrcName} : items-of tree] : if [query-glyph relSrcName] : begin local origDstName : suggestMappedName targetNameMap origSrcName [wrapName groupID origSrcName] local relDstName : suggestMappedName targetNameMap relSrcName [wrapName groupID relSrcName] @@ -507,7 +507,7 @@ glyph-block Autobuild-Transformed : begin list 0x1DEF 'esh' createMedievalBelowCombs : list - list 0x0359 'asterisk.midXH' + list 0x0359 'asterisk/sMid' list 0x1ABF 'w' list 0x1AC0 'turnw' list 0x1DCA 'r' diff --git a/font-src/glyphs/common/derivatives.ptl b/font-src/glyphs/common/derivatives.ptl index 2c31d8936..83d0a9f6a 100644 --- a/font-src/glyphs/common/derivatives.ptl +++ b/font-src/glyphs/common/derivatives.ptl @@ -1,13 +1,14 @@ $$include '../../meta/macros.ptl' import [mix linreg clamp fallback] from '../../support/utils' -import [Cv AnyCv AnyDerivingCv Dotless SvInheritableRelations CvDecompose] from '../../support/gr' +import [Cv AnyCv AnyDerivingCv Dotless SvInheritableRelations CvDecompose PseudoCvDecompose getGrMesh] from '../../support/gr' extern Map glyph-module glyph-block Common-Derivatives : begin + glyph-block-export ApplyCv define [ApplyCv g shapeFrom follow para] : begin foreach { kPrime prime } para.variants.primes : foreach h [prime.variants.values] : begin local suffix : h.resolveFor para follow @@ -19,6 +20,7 @@ glyph-block Common-Derivatives : begin [Cv h.tag h.rank].set g dstName if h.nonDeriving : [Cv h.tag h.rank].setPreventDeriving g + glyph-block-export select-variant define [select-variant] : params [name unicode [shapeFrom name] [follow name] [reduction null]] : begin if [not : glyph-is-needed name] : return nothing @@ -34,52 +36,89 @@ glyph-block Common-Derivatives : begin local v : gr.get [query-glyph (shapeFrom + '.' + variant)] if v : gr.set this v + glyph-block-export orthographic-italic define [orthographic-italic name unicode] : if para.isItalic alias name unicode (name + '.italic') alias name unicode (name + '.upright') + glyph-block-export orthographic-slanted define [orthographic-slanted name unicode] : if para.slopeAngle alias name unicode (name + '.slanted') alias name unicode (name + '.upright') + glyph-block-export glyph-is-needed define [glyph-is-needed name] : [not pickHash] || pickHash.(name) + glyph-block-export query-glyph define [query-glyph id] : return : glyphStore.queryByName id + glyph-block-export refer-glyph define [refer-glyph id] : lambda [copyAnchors copyWidth] : begin local goal : query-glyph id if [not goal] : throw : new Error "Cannot find glyph '\(id)'" this.includeGlyph goal copyAnchors copyWidth + glyph-block-export DeriveMeshT + define [DeriveMeshT gnSources Query Fn] : begin + local linksGnMap : new Map + + # Build principal + local gndSource : Fn gnSources null null + linksGnMap.set [keyOfGnList gnSources] gndSource + + local mesh : getGrMesh gnSources Query query-glyph + + # Build related derivatives + foreach { gr from to } [items-of mesh] : begin + local key : keyOfGnList to + if [not : linksGnMap.has key] : begin + local gnDerivedTo : Fn to gr from + linksGnMap.set key gnDerivedTo + + # Link related derivatives + foreach { gr from to } [items-of mesh] : begin + local gndFrom : linksGnMap.get [keyOfGnList from] + local gndTo : linksGnMap.get [keyOfGnList to] + if (gndFrom && gndTo && [query-glyph gndFrom] && [query-glyph gndTo]) : begin + gr.set [query-glyph gndFrom] gndTo + + return gndSource + define [keyOfGnList gns] ".deriveKey{\[gns.join '}{']}" + + glyph-block-export derive-glyphs define [derive-glyphs dstGid dstUnicode srcGid Fn] : begin - if [not : glyph-is-needed srcGid] : return nothing + if [not : glyph-is-needed dstGid] : return nothing - local glyphSrc : glyphStore.queryByName srcGid - local glyphDst : create-glyph dstGid dstUnicode : glyph-proc - include : Fn srcGid null + DeriveMeshT { srcGid } AnyDerivingCv : function [gns gr] : begin + local gn gns.0 + local gnDst : if [not gr] dstGid ".derive{\(dstGid)}{\(gn)}" + local unicodeDst : if [not gr] dstUnicode null + create-glyph gnDst unicodeDst : Fn gn gr + return gnDst - local derivedGlyphIdMap : new Map - if glyphDst : foreach [gr : items-of : AnyDerivingCv.query glyphSrc] : begin - local relGidSrc : gr.get glyphSrc - if [derivedGlyphIdMap.get relGidSrc] - : then : gr.set glyphDst : derivedGlyphIdMap.get relGidSrc - : else : begin - local relGidDst : gr.amendName dstGid - create-glyph relGidDst : glyph-proc : include : Fn [gr.get glyphSrc] gr.tag - gr.set glyphDst relGidDst - derivedGlyphIdMap.set relGidSrc relGidDst + glyph-block-export derive-multi-part-glyphs + define [derive-multi-part-glyphs dstGid dstUnicode gnSoruces Fn] : begin + if [not : glyph-is-needed dstGid] : return nothing + DeriveMeshT gnSoruces AnyDerivingCv : function [gns gr] : begin + local gnDst : if [not gr] dstGid ".derive{\(dstGid)}{\[gns.join '}{']}" + local unicodeDst : if [not gr] dstUnicode null + create-glyph gnDst unicodeDst : Fn gns gr + return gnDst + + glyph-block-export derive-composites define [derive-composites dstGid dstUnicode srcGid] : begin if [not : glyph-is-needed srcGid] : return nothing local restComponents : {}.slice.call arguments 3 - return : derive-glyphs dstGid dstUnicode srcGid : lambda [src sel] : glyph-proc + return : derive-glyphs dstGid dstUnicode srcGid : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS foreach component [items-of restComponents] : begin if ([typeof component] === 'string') : then : include [refer-glyph component] : else : include component + glyph-block-export alias define [alias dstGid dstUnicode srcGid] : begin if [not dstGid] : throw : new Error "Target ID not specified" if [not : glyph-is-needed srcGid] : return nothing @@ -94,10 +133,11 @@ glyph-block Common-Derivatives : begin if [gr.getPreventDeriving glyphSrc] : gr.setPreventDeriving glyphDst if [Dotless.get glyphSrc] : Dotless.set glyphDst [Dotless.get glyphSrc] + glyph-block-export turned define [turned newid unicode id _x _y mark] : begin if [not newid] : throw : new Error "Target ID not specified" derive-glyphs newid unicode id - lambda [src sel] : glyph-proc + lambda [src gr] : glyph-proc include [refer-glyph src] [if mark false AS_BASE] ALSO_METRICS if mark : include mark define x : if (_x <@ Function) [_x.call currentGlyph] _x @@ -111,16 +151,20 @@ glyph-block Common-Derivatives : begin include : Translate x y include : Italify + glyph-block-export link-reduced-variant define [link-reduced-variant] : params [dstGid srcGid gr follow] : begin if [not : query-glyph dstGid] : select-variant dstGid (shapeFrom -- srcGid) (follow -- [fallback follow dstGid]) if (gr && [query-glyph srcGid]) : gr.set [query-glyph srcGid] dstGid + glyph-block-export alias-reduced-variant define [alias-reduced-variant dstGid srcGid shapeGid gr] : begin alias dstGid null shapeGid if (gr && [query-glyph srcGid]) : gr.set [query-glyph srcGid] dstGid + glyph-block-export HalfAdvance define [HalfAdvance] : this.advanceWidth / 2 + glyph-block-export TurnMarks define [TurnMarks k fnOverride] : glyph-proc local df : DivFrame (currentGlyph.advanceWidth / Width) local mx : compositeBaseAnchors [df.markSet.(k)] @@ -128,6 +172,7 @@ glyph-block Common-Derivatives : begin include mx # Dual derivatives + glyph-block-export HCombine define [HCombine newid unicode id1 id2 spacing] : begin if [not newid] : throw : new Error "Target ID not specified" create-glyph newid unicode : glyph-proc @@ -136,10 +181,12 @@ glyph-block Common-Derivatives : begin include [refer-glyph id2] include : Translate (spacing / 2) 0 + glyph-block-export HDual define [HDual newid unicode id spacing] : begin if [not newid] : throw : new Error "Target ID not specified" return : HCombine newid unicode id id spacing + glyph-block-export VCombine define [VCombine newid unicode id1 id2 spacing] : begin if [not newid] : throw : new Error "Target ID not specified" create-glyph newid unicode : glyph-proc @@ -147,11 +194,14 @@ glyph-block Common-Derivatives : begin include : Translate (-spacing * TanSlope) (-spacing) include [refer-glyph id1] include : Translate (spacing * TanSlope / 2) (spacing / 2) + + glyph-block-export VDual define [VDual newid unicode id spacing] : begin if [not newid] : throw : new Error "Target ID not specified" return : VCombine newid unicode id id spacing - # Two-art glyphs + # Two-part glyphs + glyph-block-export create-two-part-glyph define [create-two-part-glyph newid unicode id1 id2] : begin create-glyph newid unicode : glyph-proc set-width ([query-glyph id1].advanceWidth + [query-glyph id2].advanceWidth) @@ -160,12 +210,6 @@ glyph-block Common-Derivatives : begin CvDecompose.set currentGlyph { id1 id2 } - glyph-block-export select-variant orthographic-italic orthographic-slanted - glyph-block-export refer-glyph query-glyph derive-glyphs derive-composites - glyph-block-export link-reduced-variant alias-reduced-variant - glyph-block-export alias turned HDual HCombine VDual VCombine glyph-is-needed - glyph-block-export HalfAdvance TurnMarks create-two-part-glyph - glyph-block Recursive-Build : begin define [Fork gs ps] : begin # BFS construct ShouldBuildList diff --git a/font-src/glyphs/letter/greek/pi.ptl b/font-src/glyphs/letter/greek/pi.ptl index 74b8dbad9..229f86c82 100644 --- a/font-src/glyphs/letter/greek/pi.ptl +++ b/font-src/glyphs/letter/greek/pi.ptl @@ -50,7 +50,7 @@ glyph-block Letter-Greek-Pi : begin include : MarkSet.e include : PiShape [DivFrame 1] XH 0 (shrinkRate -- 0) (doSerif -- SLAB) - derive-glyphs 'cyrl/pe.SRB' null 'u' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/pe.SRB' null 'u' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE include : refer-glyph "macronAbove" diff --git a/font-src/glyphs/letter/greek/upper-gamma.ptl b/font-src/glyphs/letter/greek/upper-gamma.ptl index b87bc51de..5cb8b596c 100644 --- a/font-src/glyphs/letter/greek/upper-gamma.ptl +++ b/font-src/glyphs/letter/greek/upper-gamma.ptl @@ -100,7 +100,7 @@ glyph-block Letter-Greek-Upper-Gamma: begin select-variant 'grek/Digamma' 0x3DC (follow -- 'grek/Gamma') - derive-glyphs 'cyrl/GheHook' 0x494 'cyrl/Ghe' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/GheHook' 0x494 'cyrl/Ghe' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : nShoulder left -- (GammaBarLeft + Stroke * HVContrast) @@ -111,7 +111,7 @@ glyph-block Letter-Greek-Upper-Gamma: begin smb -- SmoothB include : VerticalHook (RightSB - HalfStroke * HVContrast) 0 (-HookX) Hook - derive-glyphs 'cyrl/gheHook' 0x495 'cyrl/ghe.upright' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/gheHook' 0x495 'cyrl/ghe.upright' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : nShoulder left -- (GammaBarLeft + Stroke * HVContrast) diff --git a/font-src/glyphs/letter/latin/c.ptl b/font-src/glyphs/letter/latin/c.ptl index 14ec5c472..7b88d92d9 100644 --- a/font-src/glyphs/letter/latin/c.ptl +++ b/font-src/glyphs/letter/latin/c.ptl @@ -301,7 +301,7 @@ glyph-block Letter-Latin-C : begin CShapeOutline [DivFrame 1] XH 0 SmallSmoothA SmallSmoothB BBS VBarLeft (SB + BBD + OX) 0 CAP BBS - derive-glyphs 'currency/euroSign' 0x20AC 'C' : lambda [src sel] : glyph-proc + derive-glyphs 'currency/euroSign' 0x20AC 'C' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HOverlayBar [mix SB 0 0.7] [mix SB RightSB 0.7] (CAP * 0.4) include : HOverlayBar [mix SB 0 0.7] [mix SB RightSB 0.7] (CAP * 0.6) @@ -376,38 +376,38 @@ glyph-block Letter-Latin-C : begin derive-composites 'grek/dotLunateSmallSigma' 0x37C 'grek/lunateSmallSigma' 'grek/lunateSigmaDotSmall' derive-composites 'grek/dotRevLunateSmallSigma' 0x37D 'grek/revLunateSmallSigma' 'grek/lunateSigmaDotSmall' - derive-glyphs 'Cbar' 0xA792 'C' : lambda [src sel] : glyph-proc + derive-glyphs 'Cbar' 0xA792 'C' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HOverlayBar (SB * 0.3) [mix (SB + Stroke) (RightSB - Stroke) 0.55] (CAP * OverlayPos) - derive-glyphs 'cbar' 0xA793 'c' : lambda [src sel] : glyph-proc + derive-glyphs 'cbar' 0xA793 'c' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HOverlayBar (SB * 0.3) [mix (SB + Stroke) (RightSB - Stroke) 0.55] (XH * OverlayPos) - derive-glyphs 'cyrl/E' 0x42D 'revC' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/E' 0x42D 'revC' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HBar [mix SB RightSB 0.35] RightSB (CAP / 2) - derive-glyphs 'cyrl/e' 0x44D 'revSmallC' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/e' 0x44D 'revSmallC' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HBar [mix SB RightSB 0.35] RightSB (XH / 2) - derive-glyphs 'cyrl/Ye' 0x404 'C' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/Ye' 0x404 'C' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HBar SB [mix RightSB SB 0.35] (CAP / 2) [AdviceStroke2 2 4 CAP] - derive-glyphs 'cyrl/ye' 0x454 'c' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/ye' 0x454 'c' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HBar SB [mix RightSB SB 0.35] (XH / 2) [AdviceStroke2 2 4 XH] - derive-glyphs 'cyrl/Koppa' 0x480 'CTopSerifOnly' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/Koppa' 0x480 'CTopSerifOnly' : lambda [src gr] : glyph-proc include : MarkSet.if include : union [VBarRight (Middle + Stroke * HVContrast) Descender (Stroke / 2)] : difference refer-glyph src Rect (CAP / 2) Descender (Middle + Stroke * HVContrast) (Width * 4) Rect (XH / 2) [mix Stroke Hook 0.5] Middle (Width * 4) - derive-glyphs 'cyrl/koppa' 0x481 'cTopSerifOnly' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/koppa' 0x481 'cTopSerifOnly' : lambda [src gr] : glyph-proc include : MarkSet.p include : union [VBarRight (Middle + Stroke * HVContrast) Descender (Stroke / 2)] : difference refer-glyph src diff --git a/font-src/glyphs/letter/latin/lower-b.ptl b/font-src/glyphs/letter/latin/lower-b.ptl index 994213e2b..1418b5252 100644 --- a/font-src/glyphs/letter/latin/lower-b.ptl +++ b/font-src/glyphs/letter/latin/lower-b.ptl @@ -72,12 +72,12 @@ glyph-block Letter-Latin-Lower-B : begin select-variant 'bHookTop' 0x253 - derive-glyphs 'bdot' 0x1E03 'b' : lambda [src sel] : glyph-proc + derive-glyphs 'bdot' 0x1E03 'b' : lambda [src gr] : glyph-proc include : refer-glyph "dotAbove" include : Translate (Width + HalfStroke) 0 include [refer-glyph src] AS_BASE - derive-glyphs 'latinbe' 0x183 'b' : lambda [src sel] : glyph-proc + derive-glyphs 'latinbe' 0x183 'b' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE include : HBarTop (SB - O) [mix SB RightSB 0.9] CAP if SLAB : begin diff --git a/font-src/glyphs/letter/latin/lower-d.ptl b/font-src/glyphs/letter/latin/lower-d.ptl index a78e809b5..28af08531 100644 --- a/font-src/glyphs/letter/latin/lower-d.ptl +++ b/font-src/glyphs/letter/latin/lower-d.ptl @@ -148,7 +148,7 @@ glyph-block Letter-Latin-Lower-D : begin derive-composites 'dHookBottom' 0x256 'd/hookBottomBase' 'rtailBR' derive-composites 'dHookTopBottom' 0x1D91 'dHookTop/hookBottomBase' 'rtailBR' - derive-glyphs 'ddot' 0x1E0B 'd' : lambda [src sel] : glyph-proc + derive-glyphs 'ddot' 0x1E0B 'd' : lambda [src gr] : glyph-proc include : refer-glyph "dotAbove" include : Translate (Width - HalfStroke) 0 include [refer-glyph src] AS_BASE diff --git a/font-src/glyphs/letter/latin/lower-h.ptl b/font-src/glyphs/letter/latin/lower-h.ptl index 43d942d6a..164458d5a 100644 --- a/font-src/glyphs/letter/latin/lower-h.ptl +++ b/font-src/glyphs/letter/latin/lower-h.ptl @@ -136,7 +136,7 @@ glyph-block Letter-Latin-Lower-H : begin if SLAB : begin include : LeftwardTopSerif (RightSB - Stroke * HVContrast) XH SideJut - derive-glyphs 'hCedilla' 0x1E29 'h' : lambda [src sel] : glyph-proc + derive-glyphs 'hCedilla' 0x1E29 'h' : lambda [src gr] : glyph-proc include [refer-glyph 'cedillaBelow'] include : ApparentTranslate (Width + SB - Middle + HalfStroke * HVContrast) 0 include [refer-glyph src] diff --git a/font-src/glyphs/letter/latin/lower-i.ptl b/font-src/glyphs/letter/latin/lower-i.ptl index 63cac20ad..1efc90aea 100644 --- a/font-src/glyphs/letter/latin/lower-i.ptl +++ b/font-src/glyphs/letter/latin/lower-i.ptl @@ -8,7 +8,6 @@ glyph-module glyph-block Letter-Latin-Lower-I : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives - glyph-block-import Letter-Shared : CreateDottedComposition glyph-block-import Letter-Shared : CreateAccentedComposition CreateMultiAccentedComposition glyph-block-import Letter-Shared-Shapes : FlatHookDepth DiagonalTailR DiagonalTailStdDepth @@ -285,10 +284,10 @@ glyph-block Letter-Latin-Lower-I : begin include [refer-glyph 'dotlessi'] AS_BASE include : refer-glyph "ogonekBelow" - CreateDottedComposition 'dotlessi' 'i' 'i' true - CreateDottedComposition 'dotlessi/sansSerif' 'i/sansSerif' null true - CreateDottedComposition 'dotlessi' 'cyrl/Ukrainiani' 0x456 - CreateDottedComposition 'dotlessi/compLigRight' 'i/compLigRight' null + CreateAccentedComposition 'i' 'i' 'dotlessi' 'dotAbove' + CreateAccentedComposition 'i/sansSerif' null 'dotlessi/sansSerif' 'dotAbove' + CreateAccentedComposition 'cyrl/Ukrainiani' 0x456 'dotlessi' 'dotAbove' + CreateAccentedComposition 'i/compLigRight' null 'dotlessi/compLigRight' 'dotAbove' link-reduced-variant 'i/sansSerif' 'i' MathSansSerif alias 'grek/iota.flatTailed' null 'dotlessi.flatTailed' @@ -318,4 +317,4 @@ glyph-block Letter-Latin-Lower-I : begin Dotless.set currentGlyph 'mathbb/dotlessi' CreateAccentedComposition 'dotlessiBarOver' null 'dotlessi' 'barOver' - CreateDottedComposition 'dotlessiBarOver' 'iBarOver' 0x268 + CreateAccentedComposition 'iBarOver' 0x268 'dotlessiBarOver' 'dotAbove' diff --git a/font-src/glyphs/letter/latin/lower-j.ptl b/font-src/glyphs/letter/latin/lower-j.ptl index db2a82997..f9c2a6836 100644 --- a/font-src/glyphs/letter/latin/lower-j.ptl +++ b/font-src/glyphs/letter/latin/lower-j.ptl @@ -8,7 +8,7 @@ glyph-module glyph-block Letter-Latin-Lower-J : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives - glyph-block-import Letter-Shared : CreateDottedComposition + glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth glyph-block-import Letter-Shared-Shapes : DiagonalTailL DiagonalTailStdDepth glyph-block-import Letter-Blackboard : BBS BBD @@ -146,10 +146,10 @@ glyph-block Letter-Latin-Lower-J : begin select-variant 'dotlessj' 0x237 link-reduced-variant 'dotlessj/sansSerif' 'dotlessj' MathSansSerif - CreateDottedComposition 'dotlessj' 'j' 'j' true - CreateDottedComposition 'dotlessj/sansSerif' 'j/sansSerif' null true - CreateDottedComposition 'dotlessj' 'grek/yot' 0x3F3 - CreateDottedComposition 'dotlessj' 'cyrl/je' 0x458 + CreateAccentedComposition 'j' 'j' 'dotlessj' 'dotAbove' + CreateAccentedComposition 'j/sansSerif' null 'dotlessj/sansSerif' 'dotAbove' + CreateAccentedComposition 'grek/yot' 0x3F3 'dotlessj' 'dotAbove' + CreateAccentedComposition 'cyrl/je' 0x458 'dotlessj' 'dotAbove' link-reduced-variant 'j/sansSerif' 'j' MathSansSerif create-glyph 'dotlessjCurlyTail.serifless' : glyph-proc @@ -171,4 +171,4 @@ glyph-block Letter-Latin-Lower-J : begin include : LeftwardTopSerif (Middle + JBalance) XH LongJut select-variant 'dotlessjCurlyTail' - CreateDottedComposition 'dotlessjCurlyTail' 'jCurlyTail' 0x29D + CreateAccentedComposition 'jCurlyTail' 0x29D 'dotlessjCurlyTail' 'dotAbove' diff --git a/font-src/glyphs/letter/latin/lower-l.ptl b/font-src/glyphs/letter/latin/lower-l.ptl index 8cf60536b..b27a47fe3 100644 --- a/font-src/glyphs/letter/latin/lower-l.ptl +++ b/font-src/glyphs/letter/latin/lower-l.ptl @@ -181,9 +181,9 @@ glyph-block Letter-Latin-Lower-L : begin include : HBarTop (Middle - BBD / 2 - Jut) Middle CAP BBS include : HBarBottom (Middle - BBD / 2 - Jut) (Middle + BBD / 2 + Jut) 0 BBS - CreateCommaCaronComposition 'l' 'lcaron' 0x13E + CreateCommaCaronComposition 'lcaron' 0x13E 'l' - derive-glyphs 'lSlash' 0x142 'l' : lambda [src sel] : glyph-proc + derive-glyphs 'lSlash' 0x142 'l' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS local anchor currentGlyph.baseAnchors.overlay local stretch : Math.sqrt (currentGlyph.advanceWidth / UPM * 2) diff --git a/font-src/glyphs/letter/latin/lower-n.ptl b/font-src/glyphs/letter/latin/lower-n.ptl index 1565b42bf..30c8b37fa 100644 --- a/font-src/glyphs/letter/latin/lower-n.ptl +++ b/font-src/glyphs/letter/latin/lower-n.ptl @@ -142,19 +142,11 @@ glyph-block Letter-Latin-Lower-N : begin derive-composites 'cyrl/peDescender.italic' null 'cyrl/peItalicDescBase' [CyrDescender RightSB] do "n with Apostrophe" - create-glyph 'nApostrophe/comma.round' : glyph-proc + derive-glyphs 'nApostrophe/comma' null 'commaAbove' : function [src gr] : glyph-proc set-width 0 Joining.set currentGlyph Joining.Classes.Right include : WithTransform [Translate (Width + SB - Middle) 0] - refer-glyph "commaAbove" - - create-glyph 'nApostrophe/comma.square' : glyph-proc - set-width 0 - Joining.set currentGlyph Joining.Classes.Right - include : WithTransform [Translate (Width + SB - Middle) 0] - refer-glyph "commaAboveSquare" - - select-variant 'nApostrophe/comma' (follow -- 'punctuationDot') + refer-glyph src create-two-part-glyph 'nApostrophe' 0x149 'nApostrophe/comma' 'n' diff --git a/font-src/glyphs/letter/latin/lower-p.ptl b/font-src/glyphs/letter/latin/lower-p.ptl index 08439f51c..121030639 100644 --- a/font-src/glyphs/letter/latin/lower-p.ptl +++ b/font-src/glyphs/letter/latin/lower-p.ptl @@ -52,7 +52,7 @@ glyph-block Letter-Latin-Lower-P : begin link-reduced-variant 'p/hookTopBase' 'p' select-variant 'cyrl/er' 0x440 (shapeFrom -- 'p') - derive-glyphs 'cyrl/rrTick' 0x48F 'cyrl/er' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/rrTick' 0x48F 'cyrl/er' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : dispiro widths.center [AdviceStroke 4] @@ -71,7 +71,7 @@ glyph-block Letter-Latin-Lower-P : begin top -- XH stroke -- BBS - derive-glyphs 'pHookTop' 0x1A5 "p/hookTopBase" : function [src sel] : glyph-proc + derive-glyphs 'pHookTop' 0x1A5 "p/hookTopBase" : function [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS eject-contour 'serifLT' eject-contour 'stemLeft' diff --git a/font-src/glyphs/letter/latin/lower-t.ptl b/font-src/glyphs/letter/latin/lower-t.ptl index 2e8d53b7c..77ca4c3f2 100644 --- a/font-src/glyphs/letter/latin/lower-t.ptl +++ b/font-src/glyphs/letter/latin/lower-t.ptl @@ -203,7 +203,7 @@ glyph-block Letter-Latin-Lower-T : begin select-variant 't/phoneticLeft1' (shapeFrom -- 't') select-variant 't/phoneticLeft2' (shapeFrom -- 't') select-variant 'turnt' 0x287 (follow -- 't') - CreateCommaCaronComposition 't' 'tcaron' 0x165 + CreateCommaCaronComposition 'tcaron' 0x165 't' derive-glyphs 'tCedilla' 0x163 't' ConnectedCedilla select-variant "tHookTop" 0x1AD diff --git a/font-src/glyphs/letter/latin/o.ptl b/font-src/glyphs/letter/latin/o.ptl index 723c10b47..a6193607a 100644 --- a/font-src/glyphs/letter/latin/o.ptl +++ b/font-src/glyphs/letter/latin/o.ptl @@ -71,25 +71,27 @@ glyph-block Letter-Latin-O : begin VBarLeft (SB + OX + BBD) 0 XH BBS VBarRight (RightSB - OX - BBD) 0 XH BBS - create-glyph 'OHorn' 0x01A0 : glyph-proc + derive-multi-part-glyphs 'OHorn' 0x01A0 {'O' 'longHorn'} : function [srcs gr] : glyph-proc + local { base horn } srcs include : MarkSet.capital include : HornBaseAnchor RightSB CAP (Width / 2) (SmoothB) 0.5 include : difference new-glyph : glyph-proc include : MarkSet.capital - include [refer-glyph 'longHorn'] + include [refer-glyph horn] OShapeOutline.NoOvershoot CAP 0 SB RightSB nothing SmoothA SmoothB - include : refer-glyph "O" + include : refer-glyph base - create-glyph 'oHorn' 0x01A1 : glyph-proc + derive-multi-part-glyphs 'oHorn' 0x01A1 {'o' 'longHorn'} : function [srcs gr] : glyph-proc + local { base horn } srcs include : MarkSet.e include : HornBaseAnchor RightSB XH (Width / 2) (SmoothB) 0.5 include : difference new-glyph : glyph-proc include : MarkSet.e - include [refer-glyph 'longHorn'] + include [refer-glyph horn] OShapeOutline.NoOvershoot XH 0 SB RightSB nothing nothing nothing - include : refer-glyph "o" + include : refer-glyph base create-glyph 'Oslash' 0xD8 : glyph-proc local fine : 0.5 * OverlayStroke diff --git a/font-src/glyphs/letter/latin/u.ptl b/font-src/glyphs/letter/latin/u.ptl index a658fecc2..5999d83ce 100644 --- a/font-src/glyphs/letter/latin/u.ptl +++ b/font-src/glyphs/letter/latin/u.ptl @@ -189,11 +189,11 @@ glyph-block Letter-Latin-U : begin select-variant 'cyrl/i.italic.reduced' (shapeFrom -- 'u') alias 'cyrl/i.BGR' null 'cyrl/i.italic' - derive-glyphs 'cyrl/ibreve.BGR' null 'cyrl/i.BGR' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/ibreve.BGR' null 'cyrl/i.BGR' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include [refer-glyph 'breveAbove'] - derive-glyphs 'cyrl/igrave.BGR' null 'cyrl/i.BGR' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/igrave.BGR' null 'cyrl/i.BGR' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include [refer-glyph 'graveAbove'] @@ -222,7 +222,7 @@ glyph-block Letter-Latin-U : begin include : MarkSet.e include : LatinUpsilon2Shape XH SmallSmoothA SmallSmoothB - derive-glyphs 'uWithLightCentralizationStroke' null 'u' : function [src sel] : glyph-proc + derive-glyphs 'uWithLightCentralizationStroke' null 'u' : function [src gr] : glyph-proc include : MarkSet.p include : refer-glyph src local fine : AdviceStroke 4 diff --git a/font-src/glyphs/letter/latin/upper-a.ptl b/font-src/glyphs/letter/latin/upper-a.ptl index 982be7fd0..a6964b556 100644 --- a/font-src/glyphs/letter/latin/upper-a.ptl +++ b/font-src/glyphs/letter/latin/upper-a.ptl @@ -103,7 +103,7 @@ glyph-block Letter-Latin-Upper-A : begin select-variant 'grek/Delta' 0x394 - derive-glyphs 'cyrl/De.BGR' null 'grek/Delta' : function [src sel] : glyph-proc + derive-glyphs 'cyrl/De.BGR' null 'grek/Delta' : function [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS local descenderOverflow : if SLAB SideJut ((RightSB - SB) * 0.075) local xCutLeft SB diff --git a/font-src/glyphs/letter/latin/upper-b.ptl b/font-src/glyphs/letter/latin/upper-b.ptl index bdf4d0aec..300276d72 100644 --- a/font-src/glyphs/letter/latin/upper-b.ptl +++ b/font-src/glyphs/letter/latin/upper-b.ptl @@ -174,7 +174,7 @@ glyph-block Letter-Latin-Upper-B : begin VBarRight ([mix SB RightSB BArcMix] - BBD - OX * 2) (CAP * BBarPos) CAP BBS VBarLeft (SB + BBD) 0 CAP BBS - derive-glyphs 'Bhookleft' 0x181 'B' : lambda [src sel] : glyph-proc + derive-glyphs 'Bhookleft' 0x181 'B' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS eject-contour "serifLT" include : LeftHook SB CAP diff --git a/font-src/glyphs/letter/latin/upper-d.ptl b/font-src/glyphs/letter/latin/upper-d.ptl index 6f9eab72f..f30716653 100644 --- a/font-src/glyphs/letter/latin/upper-d.ptl +++ b/font-src/glyphs/letter/latin/upper-d.ptl @@ -83,18 +83,18 @@ glyph-block Letter-Latin-Upper-D : begin select-variant 'romanFiveThousand' 0x2181 (follow -- 'D') select-variant 'romanFiftyThousand' 0x2187 (follow -- 'D') link-reduced-variant 'D/sansSerif' 'D' MathSansSerif - derive-glyphs 'Eth' 0xD0 'D' : lambda [src sel] : glyph-proc + derive-glyphs 'Eth' 0xD0 'D' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HOverlayBar (SB * 0.3) [mix (SB + Stroke) (RightSB - Stroke) 0.55] (CAP * OverlayPos) alias 'Dcroat' 0x110 'Eth' alias 'arficanD' 0x189 'Eth' select-variant 'smcpD' 0x1D05 (follow -- 'D') - derive-glyphs 'smcpEth' 0x1D06 'smcpD' : lambda [src sel] : glyph-proc + derive-glyphs 'smcpEth' 0x1D06 'smcpD' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HOverlayBar (SB * 0.3) [mix (SB + Stroke) (RightSB - Stroke) 0.55] (XH * OverlayPos) - derive-glyphs 'Dhookleft' 0x18a 'D' : lambda [src sel] : glyph-proc + derive-glyphs 'Dhookleft' 0x18a 'D' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS eject-contour 'serifLT' include : LeftHook SB CAP diff --git a/font-src/glyphs/letter/latin/upper-f.ptl b/font-src/glyphs/letter/latin/upper-f.ptl index d2b3c9973..6b2474ee9 100644 --- a/font-src/glyphs/letter/latin/upper-f.ptl +++ b/font-src/glyphs/letter/latin/upper-f.ptl @@ -89,7 +89,7 @@ glyph-block Letter-Latin-Upper-F : begin turned 'turnSmcpF' 0x214E 'smcpF' Middle (XH / 2) - derive-glyphs 'Fltail' 0x191 'F' : lambda [src sel] : glyph-proc + derive-glyphs 'Fltail' 0x191 'F' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : MarkSet.if eject-contour 'serifBottom' diff --git a/font-src/glyphs/letter/latin/upper-h.ptl b/font-src/glyphs/letter/latin/upper-h.ptl index 2f26e2091..457fb70b4 100644 --- a/font-src/glyphs/letter/latin/upper-h.ptl +++ b/font-src/glyphs/letter/latin/upper-h.ptl @@ -177,7 +177,7 @@ glyph-block Letter-Latin-Upper-H : begin derive-composites 'smcpHbar' null 'smcpH' HOverlayBar [mix SB 0 0.7] [mix RightSB Width 0.7] (XH * 0.725) - derive-glyphs 'HCedilla' 0x1E28 'H' : lambda [src sel] : glyph-proc + derive-glyphs 'HCedilla' 0x1E28 'H' : lambda [src gr] : glyph-proc include [refer-glyph 'cedillaBelow'] include : Translate (Width + SB - Middle + HalfStroke * HVContrast) 0 include [refer-glyph src] diff --git a/font-src/glyphs/letter/latin/upper-l.ptl b/font-src/glyphs/letter/latin/upper-l.ptl index 8ac19de1f..a86f4ffa4 100644 --- a/font-src/glyphs/letter/latin/upper-l.ptl +++ b/font-src/glyphs/letter/latin/upper-l.ptl @@ -50,7 +50,7 @@ glyph-block Letter-Latin-Upper-L : begin include : VBarLeft (LBarLeftX + BBD) 0 CAP BBS include : HBarTop LBarLeftX (LBarLeftX + BBD) CAP BBS - derive-glyphs 'Lcaron' 0x13D 'L' : lambda [src sel] : glyph-proc + derive-glyphs 'Lcaron' 0x13D 'L' : lambda [src gr] : glyph-proc include : WithTransform [Translate (Width + (RightSB - SB) * 0.375) 0] refer-glyph "commaAbove" include [refer-glyph src] AS_BASE ALSO_METRICS @@ -62,15 +62,15 @@ glyph-block Letter-Latin-Upper-L : begin flat [mix 0 SB 0.5] (middle - LongJut * 0.4) [widths fine fine] curl (1.6 * LongJut + [mix 0 SB 0.5]) (middle + LongJut * 0.4) - derive-glyphs 'LSlash' 0x141 'L' : lambda [src sel] : glyph-proc + derive-glyphs 'LSlash' 0x141 'L' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : LSlashOverlay CAP - derive-glyphs 'smcpLSlash' 0x1D0C 'smcpL' : lambda [src sel] : glyph-proc + derive-glyphs 'smcpLSlash' 0x1D0C 'smcpL' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : LSlashOverlay XH - derive-glyphs 'LTildeOver' 0x2C62 'L' : lambda [src sel] : glyph-proc + derive-glyphs 'LTildeOver' 0x2C62 'L' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : new-glyph : glyph-proc include : refer-glyph "tildeAboveOverlay" diff --git a/font-src/glyphs/letter/latin/upper-p.ptl b/font-src/glyphs/letter/latin/upper-p.ptl index 69d2618cb..380362cbb 100644 --- a/font-src/glyphs/letter/latin/upper-p.ptl +++ b/font-src/glyphs/letter/latin/upper-p.ptl @@ -176,7 +176,7 @@ glyph-block Letter-Latin-Upper-P : begin select-variant 'currency/rubleSign' 0x20BD select-variant 'PHookLeft' 0x1A4 - derive-glyphs 'cyrl/ErTick' 0x48E 'cyrl/Er' : lambda [src sel] : glyph-proc + derive-glyphs 'cyrl/ErTick' 0x48E 'cyrl/Er' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS local yBowl : [PBarPosY CAP Stroke PShape.BarPos] + 0.75 * Stroke include : dispiro diff --git a/font-src/glyphs/letter/latin/upper-r.ptl b/font-src/glyphs/letter/latin/upper-r.ptl index 4495c0498..d879804cb 100644 --- a/font-src/glyphs/letter/latin/upper-r.ptl +++ b/font-src/glyphs/letter/latin/upper-r.ptl @@ -256,7 +256,7 @@ glyph-block Letter-Latin-Upper-R : begin select-variant 'currency/indianRupeeSign' 0x20B9 (follow -- 'RRotunda') - derive-glyphs 'Rbar' 0x24C 'R' : lambda [src sel] : glyph-proc + derive-glyphs 'Rbar' 0x24C 'R' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : HBar [mix 0 SB 0.3] (SB - O) ((CAP - Stroke) * [RBarPos CAP SLAB] + Stroke * 0.25) diff --git a/font-src/glyphs/letter/latin/upper-y.ptl b/font-src/glyphs/letter/latin/upper-y.ptl index 6c5d8dc35..279bbef19 100644 --- a/font-src/glyphs/letter/latin/upper-y.ptl +++ b/font-src/glyphs/letter/latin/upper-y.ptl @@ -130,7 +130,7 @@ glyph-block Letter-Latin-Upper-Y : begin select-variant 'grek/Upsilon' 0x3A5 (follow -- 'Y') link-reduced-variant 'grek/Upsilon/sansSerif' 'grek/Upsilon' MathSansSerif (follow -- 'Y/sansSerif') alias 'cyrl/Ue' 0x4AE 'Y' - derive-glyphs 'currency/yenSign' 0xA5 'Y' : lambda [src sel] : glyph-proc + derive-glyphs 'currency/yenSign' 0xA5 'Y' : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : YOverlayShape diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index bd5007606..44b5463d0 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -10,38 +10,30 @@ glyph-block Letter-Shared : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives - glyph-block-export CreateDottedComposition - define [CreateDottedComposition sourceGid dstGid unicode fDontDecompose] - derive-glyphs dstGid unicode sourceGid - lambda [src sel] : glyph-proc - include [refer-glyph src] AS_BASE ALSO_METRICS - include : refer-glyph "dotAbove" - Dotless.set currentGlyph src - if (!fDontDecompose && !sel) : CvDecompose.set currentGlyph { src "dotAbove" } + glyph-block-export CreateAccentedComposition + define [CreateAccentedComposition dst u srcGid accentGid fDontDecompose] + derive-multi-part-glyphs dst u { srcGid accentGid } : function [gns gr] : glyph-proc + local { base mark } gns + include [refer-glyph base] AS_BASE ALSO_METRICS + include [refer-glyph mark] + if (!gr && accentGid === 'dotAbove') : Dotless.set currentGlyph base glyph-block-export CreateCommaCaronComposition - define [CreateCommaCaronComposition sourceGid dstGid unicode] - derive-glyphs dstGid unicode sourceGid - lambda [src sel] : glyph-proc - define srcGlyph : query-glyph src - define commaOffset : (Width / 2) * [Math.pow (srcGlyph.advanceWidth / Width * 2) (2/3)] - include : refer-glyph "commaTR" - include : ApparentTranslate commaOffset 0 - include srcGlyph AS_BASE ALSO_METRICS - - glyph-block-export CreateAccentedComposition - define [CreateAccentedComposition dstGid unicode srcGid accentGid fDontDecompose] - derive-glyphs dstGid unicode srcGid : lambda [src sel] : glyph-proc - include [refer-glyph src] AS_BASE ALSO_METRICS - include [refer-glyph accentGid] - if (!fDontDecompose && !sel) : CvDecompose.set currentGlyph { src accentGid } + define [CreateCommaCaronComposition dst u sourceGid] + derive-multi-part-glyphs dst u { sourceGid 'commaTR' } : function [gns gr] : glyph-proc + local { base comma } gns + define baseGlyph : query-glyph base + define commaOffset : (Width / 2) * [Math.pow (baseGlyph.advanceWidth / Width * 2) (2/3)] + include : refer-glyph comma + include : ApparentTranslate commaOffset 0 + include [refer-glyph base] AS_BASE ALSO_METRICS glyph-block-export CreateMultiAccentedComposition define [CreateMultiAccentedComposition dstGid unicode srcGid accentGids fDontDecompose] - derive-glyphs dstGid unicode srcGid : lambda [src sel] : glyph-proc + derive-glyphs dstGid unicode srcGid : lambda [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS foreach accentGid [items-of accentGids] : include [refer-glyph accentGid] - if (!fDontDecompose && !sel) : CvDecompose.set currentGlyph { src ::accentGids } + if (!fDontDecompose && !gr) : CvDecompose.set currentGlyph { src :: accentGids } glyph-block-export CreateRightDependentComposite define [CreateRightDependentComposite gidDst unicode gidPart1 gidPart2] : begin diff --git a/font-src/glyphs/marks/above.ptl b/font-src/glyphs/marks/above.ptl index b447bf141..ac44bf07c 100644 --- a/font-src/glyphs/marks/above.ptl +++ b/font-src/glyphs/marks/above.ptl @@ -31,18 +31,22 @@ glyph-block Mark-Above : begin define asciiMarkZoom : (RightSB - SB) / (markExtend * 3) ### Above marks - create-glyph 'dotAbove' 0x307 : glyph-proc - set-width 0 - set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack - set-base-anchor 'aboveBrace' markMiddle aboveMarkMid - include : DotAt markMiddle aboveMarkMid DotRadius + foreach { suffix { DrawAt kdr } } [Object.entries DotVariants] : do + create-glyph "dotAbove.\(suffix)" : glyph-proc + set-width 0 + set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack + set-base-anchor 'aboveBrace' markMiddle aboveMarkMid + include : DrawAt markMiddle aboveMarkMid (DotRadius * kdr) - create-glyph 'dieresisAbove' 0x308 : glyph-proc - set-width 0 - set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack - set-base-anchor 'aboveBrace' markMiddle aboveMarkMid - include : DotAt (markMiddle - markExtend) aboveMarkMid markDotsRadius - include : DotAt (markMiddle + markExtend) aboveMarkMid markDotsRadius + create-glyph "dieresisAbove.\(suffix)" : glyph-proc + set-width 0 + set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack + set-base-anchor 'aboveBrace' markMiddle aboveMarkMid + include : DrawAt (markMiddle - markExtend) aboveMarkMid (markDotsRadius * kdr) + include : DrawAt (markMiddle + markExtend) aboveMarkMid (markDotsRadius * kdr) + + select-variant 'dotAbove' 0x307 (follow -- 'diacriticDot') + select-variant 'dieresisAbove' 0x308 (follow -- 'diacriticDot') define [RingDims] : begin local radiusOut : AccentHeight * [linreg 16 0.5 90 0.75 (markHalfStroke * 2)] @@ -473,7 +477,7 @@ glyph-block Mark-Above : begin flat (m2 - markStress) aboveMarkBot [widths markFine markFine] curl (m2 + markExtend) aboveMarkTop [widths markStress markStress] - create-glyph 'commaAbove' 0x313 : glyph-proc + create-glyph 'commaAbove.round' : glyph-proc set-width 0 set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack set-base-anchor 'aboveBrace' markMiddle aboveMarkMid @@ -487,34 +491,36 @@ glyph-block Mark-Above : begin g4 [mix markMiddle (markMiddle - radius) 0.2] (aboveMarkBot - radius - commaOvershoot2) include : ApparentTranslate 0 (DotRadius * 0.3) - create-glyph 'commaAboveSquare' : glyph-proc + create-glyph 'commaAbove.square' : glyph-proc set-width 0 set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack set-base-anchor 'aboveBrace' markMiddle aboveMarkMid - local radius commaAboveRadius + local radius : commaAboveRadius * DesignParameters.squareDotScalar include : Rect aboveMarkTop (aboveMarkTop - radius * 2) (markMiddle - radius) (markMiddle + radius) include : dispiro widths.rhs : Math.min radius (markFine * [linreg 16 2 90 1.75 (markHalfStroke * 2)]) - flat (markMiddle + radius) aboveMarkTop - curl (markMiddle + radius) (aboveMarkTop - radius) + flat (markMiddle + radius) aboveMarkTop [heading Downward] + curl (markMiddle + radius) (aboveMarkTop - 2 * radius) [heading Downward] quadControls 0 0.6 g4 [mix markMiddle (markMiddle - radius) 0.2] (aboveMarkBot - radius - commaOvershoot2) include : ApparentTranslate 0 (DotRadius * 0.3) - create-glyph 'commaGrekUpperTonos' : glyph-proc + select-variant 'commaAbove' 0x313 (follow -- 'diacriticDot') + + derive-glyphs 'commaGrekUpperTonos' null 'commaAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph 'commaAbove' + include : refer-glyph src set-mark-anchor 'grekUpperTonos' markMiddle XH - create-glyph 'turnCommaAbove' 0x312 : glyph-proc + derive-glyphs 'turnCommaAbove' 0x312 'commaAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph "commaAbove" + include : refer-glyph src include : FlipAround markMiddle ([mix aboveMarkTop (aboveMarkBot - commaAboveRadius) 0.5] + (DotRadius * 0.3) + commaOvershoot / 2) set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack set-base-anchor 'aboveBrace' markMiddle aboveMarkMid - create-glyph 'revCommaAbove' 0x314 : glyph-proc + create-glyph 'revCommaAbove.round' : glyph-proc set-width 0 set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack set-base-anchor 'aboveBrace' markMiddle aboveMarkMid @@ -528,9 +534,27 @@ glyph-block Mark-Above : begin g4 [mix markMiddle (markMiddle + radius) 0.2] (aboveMarkBot - radius - commaOvershoot2) include : ApparentTranslate 0 (DotRadius * 0.3) - create-glyph 'revCommaGrekUpperTonos' : glyph-proc + create-glyph 'revCommaAbove.square' : glyph-proc set-width 0 - include : refer-glyph 'revCommaAbove' + set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack + set-base-anchor 'aboveBrace' markMiddle aboveMarkMid + + local radius : commaAboveRadius * DesignParameters.squareDotScalar + include : Rect (aboveMarkTop + commaOvershoot) (aboveMarkTop - radius * 2 + commaOvershoot) (markMiddle - radius) (markMiddle + radius) + include : dispiro + widths.lhs : Math.min radius (markFine * [linreg 16 2 90 1.75 (markHalfStroke * 2)]) + flat (markMiddle - radius) aboveMarkTop [heading Downward] + curl (markMiddle - radius) (aboveMarkTop - 2 * radius) [heading Downward] + quadControls 0 0.6 + g4 [mix markMiddle (markMiddle + radius) 0.2] (aboveMarkBot - radius - commaOvershoot2) + include : ApparentTranslate 0 (DotRadius * 0.3) + + select-variant 'revCommaAbove' 0x314 (follow -- 'diacriticDot') + + + derive-glyphs 'revCommaGrekUpperTonos' null 'revCommaAbove' : function [src gr] : glyph-proc + set-width 0 + include : refer-glyph src set-mark-anchor 'grekUpperTonos' markMiddle XH create-glyph 'barAbove' 0x30D : glyph-proc diff --git a/font-src/glyphs/marks/below.ptl b/font-src/glyphs/marks/below.ptl index 2565f1d2a..2e6da4809 100644 --- a/font-src/glyphs/marks/below.ptl +++ b/font-src/glyphs/marks/below.ptl @@ -184,9 +184,9 @@ glyph-block Mark-Below : begin # Turned below marks define [TurnAboveMarkToBelow gnBelowMark unicodeBelowMark gnAboveMark] : begin - create-glyph gnBelowMark unicodeBelowMark : glyph-proc + derive-glyphs gnBelowMark unicodeBelowMark gnAboveMark : function [src gr] : glyph-proc set-width 0 - include : refer-glyph gnAboveMark + include : refer-glyph src include : FlipAround markMiddle (XH / 2) local aboveGlyph : query-glyph gnAboveMark if aboveGlyph : begin diff --git a/font-src/glyphs/marks/composite.ptl b/font-src/glyphs/marks/composite.ptl index 875af2a36..8810be787 100644 --- a/font-src/glyphs/marks/composite.ptl +++ b/font-src/glyphs/marks/composite.ptl @@ -19,32 +19,33 @@ glyph-block Mark-Composite : begin glyph-block-import Mark-Above : commaOvershoot commaAboveRadius glyph-block-import Mark-Below : belowMarkBot belowMarkTop belowMarkMid - define [GreekLRDoubleMark id unicode leftGlyph rightGlyph] : begin + define [GreekLRDoubleMark id unicode gnLeft gnRight] : begin local k : -Width * 0.15 - create-glyph id : glyph-proc + derive-multi-part-glyphs id null { gnLeft gnRight } : function [srcs gr] : glyph-proc + local { leftPart rightPart } srcs set-width 0 - include leftGlyph + include : refer-glyph leftPart include : Translate (2 * k) 0 - include rightGlyph + include : refer-glyph rightPart include : Translate (0 - k) 0 set-mark-anchor 'above' markMiddle XH markMiddle aboveMarkStack - create-glyph "\(id)GrekUpperTonos" : glyph-proc + derive-glyphs "\(id)GrekUpperTonos" null id : function [src gr] : glyph-proc set-width 0 - include [refer-glyph id] + include [refer-glyph src] set-mark-anchor 'grekUpperTonos' (markMiddle - k) XH - if unicode : create-glyph ('spaced' + id) unicode : glyph-proc + if unicode : derive-glyphs ('spaced' + id) unicode id : function [src gr] : glyph-proc include [refer-glyph 'markBaseSpace'] AS_BASE set-width [query-glyph 'markBaseSpace'].advanceWidth - include [refer-glyph id] + include [refer-glyph src] - GreekLRDoubleMark 'psiliVaria' 0x1FCD [refer-glyph 'commaAbove'] [refer-glyph 'variaAbove'] - GreekLRDoubleMark 'psiliOxia' 0x1FCE [refer-glyph 'commaAbove'] [refer-glyph 'oxiaAbove'] - GreekLRDoubleMark 'dasiaVaria' 0x1FDD [refer-glyph 'revCommaAbove'] [refer-glyph 'variaAbove'] - GreekLRDoubleMark 'dasiaOxia' 0x1FDE [refer-glyph 'revCommaAbove'] [refer-glyph 'oxiaAbove'] + GreekLRDoubleMark 'psiliVaria' 0x1FCD 'commaAbove' 'variaAbove' + GreekLRDoubleMark 'psiliOxia' 0x1FCE 'commaAbove' 'oxiaAbove' + GreekLRDoubleMark 'dasiaVaria' 0x1FDD 'revCommaAbove' 'variaAbove' + GreekLRDoubleMark 'dasiaOxia' 0x1FDE 'revCommaAbove' 'oxiaAbove' local yc : aboveMarkTop - commaAboveRadius + DotRadius * 0.3 + commaOvershoot diff --git a/font-src/glyphs/marks/horn-and-angle.ptl b/font-src/glyphs/marks/horn-and-angle.ptl index f9c293fce..2838de00f 100644 --- a/font-src/glyphs/marks/horn-and-angle.ptl +++ b/font-src/glyphs/marks/horn-and-angle.ptl @@ -55,31 +55,58 @@ glyph-block Mark-Horn-And-Angle : begin widths.rhs [mix hornFine hornStroke t] g4 (attX - overshootX - HalfStroke * HVContrast) (attY - overshootY - Stroke) [widths.rhs hornStroke] - create-glyph 'horn' 0x31B : glyph-proc + define [SquareHornShape attX attY overshootX overshootY yrP] : glyph-proc + local [object [radius r] hornFine hornStroke startX startY] : HornDim attX attY overshootX overshootY yrP + local radius : r * DesignParameters.squareDotScalar + include : union + SquareAt (startX - radius) startY radius + dispiro + flat startX (startY + radius) [widths.rhs.heading hornFine Downward] + curl startX (startY - radius) + quadControls 0 0.8 8 : object : blend : lambda [t] + widths.rhs [mix hornFine hornStroke t] + g4 (attX - overshootX - HalfStroke * HVContrast) (attY - overshootY - Stroke) [widths.rhs hornStroke] + + create-glyph 'horn.round' : glyph-proc set-width 0 include : HornShape 0 XH 0 0 0.5 include : HornMarkAnchor 0 XH 0 0 0.5 - create-glyph 'longHorn' : glyph-proc + create-glyph 'horn.square' : glyph-proc + set-width 0 + include : SquareHornShape 0 XH 0 0 0.5 + include : HornMarkAnchor 0 XH 0 0 0.5 + + select-variant 'horn' 0x31B (follow -- 'diacriticDot') + + + create-glyph 'longHorn.round' : glyph-proc set-width 0 include : HornShape 0 XH (Width / 2) (SmoothB) 0.5 include : HornMarkAnchor 0 XH (Width / 2) (SmoothB) 0.5 + create-glyph 'longHorn.square' : glyph-proc + set-width 0 + include : SquareHornShape 0 XH (Width / 2) (SmoothB) 0.5 + include : HornMarkAnchor 0 XH (Width / 2) (SmoothB) 0.5 + + select-variant 'longHorn' null (follow -- 'diacriticDot') + create-glyph 'leftangleTR' 0x31A : glyph-proc set-width 0 include : VBarLeft 0 aboveMarkBot aboveMarkTop (markFine * 2) include : HBarTop (-markExtend * 1.5) 0 aboveMarkTop (markFine * 2) set-mark-anchor 'topright' 0 XH 0 aboveMarkTop - create-glyph 'dotTR' 0x358 : glyph-proc + derive-glyphs 'dotTR' 0x358 'dotAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph "dotAbove" + include : refer-glyph src include : ApparentTranslate (RightSB - Middle + DotRadius) 0 set-mark-anchor 'topright' 0 XH 0 aboveMarkTop - create-glyph 'commaTR' 0x315 : glyph-proc + derive-glyphs 'commaTR' 0x315 'commaAbove' : function [src gr] : glyph-proc set-width 0 - include : refer-glyph "commaAbove" + include : refer-glyph src include : ApparentTranslate (RightSB - Middle + DotRadius) 0 set-mark-anchor 'topright' 0 XH 0 aboveMarkTop diff --git a/font-src/glyphs/symbol/ligation.ptl b/font-src/glyphs/symbol/ligation.ptl index 2af82e1b5..7fdd92b7a 100644 --- a/font-src/glyphs/symbol/ligation.ptl +++ b/font-src/glyphs/symbol/ligation.ptl @@ -177,7 +177,7 @@ glyph-block Symbol-Ligation : begin Joining.set currentGlyph Joining.Classes.Mid include : Translate (+arrowheadsKern) 0 - derive-glyphs 'exclam.lig.htmlcommentstart' null 'exclam' : function [src sel] : glyph-proc + derive-glyphs 'exclam.lig.htmlcommentstart' null 'exclam' : function [src gr] : glyph-proc Joining.set currentGlyph Joining.Classes.Mid include : refer-glyph src include : Translate (((RightSB - Width) + (Width - arrowExtend / 2)) / 2 - Middle) 0 diff --git a/font-src/glyphs/symbol/math/apl.ptl b/font-src/glyphs/symbol/math/apl.ptl index 22efdb817..2e249ec15 100644 --- a/font-src/glyphs/symbol/math/apl.ptl +++ b/font-src/glyphs/symbol/math/apl.ptl @@ -155,13 +155,13 @@ glyph-block Symbol-Math-APL : begin create-glyph 0x235E : aplBoxed : refer-glyph 'asciiSingleQuote.straight' create-glyph 0x236F : aplBoxed : refer-glyph 'notequal' - derive-glyphs 'apl/boxedDivide' 0x2339 'divide' : function [src sel] : aplBoxed : refer-glyph src - derive-glyphs 'apl/boxedColon' 0x2360 'colon/mid' : function [src sel] : aplBoxed : refer-glyph src + derive-glyphs 'apl/boxedDivide' 0x2339 'divide' : function [src gr] : aplBoxed : refer-glyph src + derive-glyphs 'apl/boxedColon' 0x2360 'colon/mid' : function [src gr] : aplBoxed : refer-glyph src - derive-glyphs 'apl/quadQuestion/hookPart' null 'question/hookPart' : function [src sel] : glyph-proc + derive-glyphs 'apl/quadQuestion/hookPart' null 'question/hookPart' : function [src gr] : glyph-proc include : aplBoxed : refer-glyph src set-base-anchor 'cvDecompose' 0 0 - derive-glyphs 'apl/quadQuestion/dotPart' null 'question/dotPart' : function [src sel] : glyph-proc + derive-glyphs 'apl/quadQuestion/dotPart' null 'question/dotPart' : function [src gr] : glyph-proc set-width 0 include : aplBoxedPhantom : WithTransform [Translate Width 0] : refer-glyph src set-mark-anchor 'cvDecompose' 0 0 @@ -184,22 +184,26 @@ glyph-block Symbol-Math-APL : begin derive-composites 'apl/barComma' 0x236A 'comma' 'minus' derive-composites 'apl/zeroTilde' 0x236C 'zero.lnum/forceUnslashed' 'overlayTildeOperator' - # Dieresis - create-glyph 0x2362 : composite-proc [refer-glyph 'nabla.aplForm'] [MarkSet.tack] [refer-glyph 'dieresisAbove'] [clear-anchors] - create-glyph 0x2361 : composite-proc [refer-glyph 'top'] [MarkSet.tack] [refer-glyph 'dieresisAbove'] [clear-anchors] - create-glyph 0x2363 : composite-proc [refer-glyph 'asterisk.pentaSMid'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors] - create-glyph 0x2364 : composite-proc [refer-glyph 'whiteSmallCircle.NWID'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors] - create-glyph 0x2365 : composite-proc [refer-glyph 'whiteCircle.NWID'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors] - create-glyph 0x2368 : composite-proc [refer-glyph 'asciiTilde.low'] [refer-glyph 'dieresisAbove'] - create-glyph 0x2369 : composite-proc [refer-glyph 'greater.narrow'] [MarkSet.plus] [refer-glyph 'dieresisAbove'] [clear-anchors] - - # Underscore - create-glyph 0x234A : composite-proc [refer-glyph 'bot'] [MarkSet.tack] [refer-glyph 'underlineBelow'] [clear-anchors] - create-glyph 0x2358 : composite-proc [refer-glyph 'asciiSingleQuote.straight'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors] - create-glyph 0x235A : composite-proc [refer-glyph 'whiteDiamond.NWID'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors] - create-glyph 0x235B : composite-proc [refer-glyph 'whiteSmallCircle.NWID'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors] - create-glyph 0x235C : composite-proc [refer-glyph 'whiteCircle.NWID'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors] - create-glyph 0x2377 : composite-proc [refer-glyph 'smallElement'] [MarkSet.plus] [refer-glyph 'underlineBelow'] [clear-anchors] + # Dieresis & underscore + define [AplAccented u part1 part2 marks] + derive-multi-part-glyphs [NameUni u] u {part1 part2} : function [srcs gr] : composite-proc + refer-glyph srcs.0 + begin marks + refer-glyph srcs.1 + clear-anchors + AplAccented 0x2362 'nabla.aplForm' 'dieresisAbove' [MarkSet.tack] + AplAccented 0x2361 'top' 'dieresisAbove' [MarkSet.tack] + AplAccented 0x2363 'asterisk.pentaSMid' 'dieresisAbove' [MarkSet.plus] + AplAccented 0x2364 'whiteSmallCircle.NWID' 'dieresisAbove' [MarkSet.plus] + AplAccented 0x2365 'whiteCircle.NWID' 'dieresisAbove' [MarkSet.plus] + AplAccented 0x2368 'asciiTilde.low' 'dieresisAbove' [MarkSet.plus] + AplAccented 0x2369 'greater.narrow' 'dieresisAbove' [MarkSet.plus] + AplAccented 0x234A 'bot' 'underlineBelow' [MarkSet.tack] + AplAccented 0x2358 'asciiSingleQuote.straight' 'underlineBelow' [MarkSet.plus] + AplAccented 0x235A 'whiteDiamond.NWID' 'underlineBelow' [MarkSet.plus] + AplAccented 0x235B 'whiteSmallCircle.NWID' 'underlineBelow' [MarkSet.plus] + AplAccented 0x235C 'whiteCircle.NWID' 'underlineBelow' [MarkSet.plus] + AplAccented 0x2377 'smallElement' 'underlineBelow' [MarkSet.plus] derive-composites 'apl/alphaBar' 0x2376 'grek/alpha' [refer-glyph 'underlineBelow'] [clear-anchors] derive-composites 'apl/iotaBar' 0x2378 'grek/iota' [refer-glyph 'underlineBelow'] [clear-anchors] @@ -213,7 +217,7 @@ glyph-block Symbol-Math-APL : begin create-glyph 0x2346 : composite-proc : Overlay [refer-glyph 'arrowRight.NWID'] [refer-glyph 'apl/bar'] create-glyph 0x235F : composite-proc [intersection [refer-glyph 'mathOOutline'] [refer-glyph 'opAsterisk.low']] [refer-glyph 'mathO'] - derive-glyphs 'apl/barSemicolon' 0x236E 'semicolon' : function [src sel] : Overlay [refer-glyph src] [refer-glyph 'underscore.high'] + derive-glyphs 'apl/barSemicolon' 0x236E 'semicolon' : function [src gr] : Overlay [refer-glyph src] [refer-glyph 'underscore.high'] # Complex Composition create-glyph 0x2367 : composite-proc [refer-glyph 'apl/bar'] : union diff --git a/font-src/glyphs/symbol/math/boxed.ptl b/font-src/glyphs/symbol/math/boxed.ptl index edadb2fbb..4d8e55a4d 100644 --- a/font-src/glyphs/symbol/math/boxed.ptl +++ b/font-src/glyphs/symbol/math/boxed.ptl @@ -9,7 +9,7 @@ glyph-block Symbol-Math-Boxed : begin glyph-block-import Common-Derivatives define [MakeMathBoxed u inner] : begin - derive-glyphs "mathBoxed{\(inner)}" u inner : function [src sel] + derive-glyphs "mathBoxed{\(inner)}" u inner : function [src gr] composite-proc refer-glyph 'mathBox' intersection [refer-glyph 'mathBoxOutline'] [refer-glyph src] diff --git a/font-src/glyphs/symbol/math/circled.ptl b/font-src/glyphs/symbol/math/circled.ptl index 6fed69c2d..9dce5e30d 100644 --- a/font-src/glyphs/symbol/math/circled.ptl +++ b/font-src/glyphs/symbol/math/circled.ptl @@ -9,7 +9,7 @@ glyph-block Symbol-Math-Circled : begin glyph-block-import Common-Derivatives define [MakeMathCircled u inner] : begin - derive-glyphs "mathCircled{\(inner)}" u inner : function [src sel] + derive-glyphs "mathCircled{\(inner)}" u inner : function [src gr] composite-proc refer-glyph 'mathO' intersection [refer-glyph 'mathOOutline'] [refer-glyph src] @@ -24,7 +24,7 @@ glyph-block Symbol-Math-Circled : begin for-width-kinds WideWidth1 define [MakeMathBigCircled u inner] : begin - derive-glyphs [MangleName "mathBigCircled{\(inner)}"] [MangleUnicode u] [MangleName inner] : function [src sel] : composite-proc + derive-glyphs [MangleName "mathBigCircled{\(inner)}"] [MangleUnicode u] [MangleName inner] : function [src gr] : composite-proc refer-glyph : MangleName 'mathOBig' intersection refer-glyph : MangleName 'mathOOutlineBig' diff --git a/font-src/glyphs/symbol/punctuation/ligation-variants.ptl b/font-src/glyphs/symbol/punctuation/ligation-variants.ptl index 79880e548..38ef5cecb 100644 --- a/font-src/glyphs/symbol/punctuation/ligation-variants.ptl +++ b/font-src/glyphs/symbol/punctuation/ligation-variants.ptl @@ -36,18 +36,18 @@ glyph-block Symbol-Punctuation-Ligation-Variants : begin define [LigD baseName suffix pDelta] : if [glyph-is-needed baseName] : begin local delta : Math.max 0 : Width / 2 - (XH - PeriodSize) / 2 - derive-glyphs (baseName + '.lig.' + suffix) null baseName : function [src sel] + derive-glyphs (baseName + '.lig.' + suffix) null baseName : function [src gr] composite-proc refer-glyph src Translate (delta * pDelta ) 0 define [LigDTwoParts baseName aPart bPart suffix pDelta] : if [glyph-is-needed baseName] : begin local delta : Math.max 0 : Width / 2 - (XH - PeriodSize) / 2 - derive-glyphs (aPart + '.lig.' + suffix) null aPart : function [src sel] : glyph-proc + derive-glyphs (aPart + '.lig.' + suffix) null aPart : function [src gr] : glyph-proc include [refer-glyph src] AS_BASE ALSO_METRICS include : Translate (delta * pDelta ) 0 set-base-anchor 'cvDecompose' 0 0 - derive-glyphs (bPart + '.lig.' + suffix) null bPart : function [src sel] : glyph-proc + derive-glyphs (bPart + '.lig.' + suffix) null bPart : function [src gr] : glyph-proc set-width 0 include [refer-glyph src] AS_BASE include : Translate (delta * pDelta ) 0 diff --git a/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl b/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl index dde6b926c..e3f200402 100644 --- a/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl +++ b/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl @@ -17,31 +17,31 @@ glyph-block Symbol-Punctuation-Quotes-And-Primes : begin local commaLow (Descender * 0.9) local ratio : Math.min 1 : (quoteTop - quoteBottom) / (PeriodSize - commaLow) - derive-glyphs 'lowSingleQuote' 0x201A 'comma' : function [src sel] : glyph-proc + derive-glyphs 'lowSingleQuote' 0x201A 'comma' : function [src gr] : glyph-proc local df : DivFrame para.diversityF set-width df.width include : refer-glyph src include : FlipAround df.middle 0 ratio ratio - derive-glyphs 'revLowSingleQuote' null 'revComma' : function [src sel] : glyph-proc + derive-glyphs 'revLowSingleQuote' null 'revComma' : function [src gr] : glyph-proc local df : DivFrame para.diversityF set-width df.width include : refer-glyph src include : FlipAround df.middle 0 ratio ratio - derive-glyphs 'openSingleQuote' 0x2018 'lowSingleQuote' : function [src sel] : glyph-proc + derive-glyphs 'openSingleQuote' 0x2018 'lowSingleQuote' : function [src gr] : glyph-proc local df : DivFrame para.diversityF set-width df.width include : refer-glyph src include : FlipAround df.middle [mix [mix PeriodSize commaLow 0.5] yCurlyQuotes 0.5] - derive-glyphs 'closeSingleQuote' 0x2019 'openSingleQuote' : function [src sel] : glyph-proc + derive-glyphs 'closeSingleQuote' 0x2019 'openSingleQuote' : function [src gr] : glyph-proc local df : DivFrame para.diversityF set-width df.width include : refer-glyph src include : FlipAround df.middle yCurlyQuotes - derive-glyphs 'revSingleQuote' 0x201B 'revComma' : function [src sel] : glyph-proc + derive-glyphs 'revSingleQuote' 0x201B 'revComma' : function [src gr] : glyph-proc local df : DivFrame para.diversityF set-width df.width include : refer-glyph src diff --git a/font-src/meta/macros.ptl b/font-src/meta/macros.ptl index db4b9d421..299c868df 100644 --- a/font-src/meta/macros.ptl +++ b/font-src/meta/macros.ptl @@ -131,7 +131,7 @@ define-macro glyph-block-import : syntax-rules Common-Derivatives `[select-variant orthographic-italic orthographic-slanted refer-glyph query-glyph alias turned HDual HCombine VDual VCombine derive-glyphs derive-composites link-reduced-variant alias-reduced-variant glyph-is-needed - HalfAdvance TurnMarks create-two-part-glyph] + HalfAdvance TurnMarks create-two-part-glyph derive-multi-part-glyphs DeriveMeshT] CommonShapes `[Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShapeT OShape OShapeOutline OShapeFlatTB diff --git a/font-src/support/gr.js b/font-src/support/gr.js index e5bdb398a..5f630fb42 100644 --- a/font-src/support/gr.js +++ b/font-src/support/gr.js @@ -72,29 +72,23 @@ const AplForm = OtlTaggedProp("AplForm", "APLF"); const NumeratorForm = OtlTaggedProp("Numerator", "numr"); const DenominatorForm = OtlTaggedProp("Denominator", "dnom"); -const CvDecompose = { - get(glyph) { - if (glyph && glyph.related) return glyph.related.CvDecompose; - else return null; - }, - set(glyph, composition) { - if (!Array.isArray(composition)) throw new Error("Must supply a GID array"); - if (!glyph.related) glyph.related = {}; - glyph.related.CvDecompose = composition; - } -}; +function DecompositionProp(key) { + return { + get(glyph) { + if (glyph && glyph.related) return glyph.related[key]; + else return null; + }, + set(glyph, composition) { + if (!Array.isArray(composition)) throw new Error("Must supply a GID array"); + if (!glyph.related) glyph.related = {}; + glyph.related[key] = composition; + } + }; +} -const CcmpDecompose = { - get(glyph) { - if (glyph && glyph.related) return glyph.related.CcmpDecompose; - else return null; - }, - set(glyph, composition) { - if (!Array.isArray(composition)) throw new Error("Must supply a GID array"); - if (!glyph.related) glyph.related = {}; - glyph.related.CcmpDecompose = composition; - } -}; +const CvDecompose = DecompositionProp("CvDecompose"); +const PseudoCvDecompose = DecompositionProp("PseudoCvDecompose"); +const CcmpDecompose = DecompositionProp("CcmpDecompose"); const TieMark = { tag: "TMRK", @@ -221,7 +215,6 @@ function Cv(tag, rank) { } const DotlessOrNot = { - optional: true, query(glyph) { if (Dotless.get(glyph)) return [Dotless]; return null; @@ -229,7 +222,6 @@ const DotlessOrNot = { }; const AnyCv = { - optional: false, query(glyph) { let ret = []; if (glyph && glyph.related && glyph.related.cv) { @@ -245,7 +237,6 @@ const AnyCv = { }; const AnyDerivingCv = { - optional: false, query(glyph) { let ret = []; if (glyph && glyph.related && glyph.related.cv) { @@ -275,17 +266,14 @@ function getGrTreeImpl(gid, grSetList, fnGidToGlyph, sink) { if (!grSetList.length) return; const g = fnGidToGlyph(gid); if (!g) return; - const grq = grSetList[0]; - const grs = grq.query(g); - if ((!grs || !grs.length) && grq.optional) { - getGrTreeImpl(gid, grSetList.slice(1), fnGidToGlyph, sink); - } else if (grs && grs.length) { - if (grq.optional) { - getGrTreeImpl(gid, grSetList.slice(1), fnGidToGlyph, sink); - } + + const grs = grSetList[0].query(g); + + getGrTreeImpl(gid, grSetList.slice(1), fnGidToGlyph, sink); + if (grs && grs.length) { for (const gr of grs) { sink.push([gr, gid, gr.get(g)]); - getGrTreeImpl(gr.get(g), grSetList.slice(1), fnGidToGlyph, sink); + getGrTreeImpl(gr.get(g), grSetList, fnGidToGlyph, sink); } } } @@ -369,7 +357,7 @@ function createGrDisplaySheet(glyphStore, gid) { displayQuerySingleFeature(glyphStore, gid, AplForm, typographicFeatures); let charVariantFeatures = []; - const decomposition = CvDecompose.get(glyph); + const decomposition = CvDecompose.get(glyph) || PseudoCvDecompose.get(glyph); if (decomposition) { const variantAssignmentSet = new Set(); for (const componentGn of decomposition) { @@ -484,6 +472,7 @@ exports.Joining = Joining; exports.AnyDerivingCv = AnyDerivingCv; exports.CcmpDecompose = CcmpDecompose; exports.CvDecompose = CvDecompose; +exports.PseudoCvDecompose = PseudoCvDecompose; exports.RightDependentLink = RightDependentLink; exports.RightDependentTrigger = RightDependentTrigger; exports.MathSansSerif = MathSansSerif; diff --git a/params/variants.toml b/params/variants.toml index 4dd9fd5f0..f51e58d32 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -6529,6 +6529,24 @@ selector.punctuationDot = "square" +[prime.diacritic-dot] +sampler = "öẋ ij" +hotChars = "ijäöü" +samplerExplain = "Dot and Comma shape in diacritics" +tag = "VXDD" + +[prime.diacritic-dot.variants.round] +rank = 1 +description = "Dots and Commas in diacritics are round" +selector.diacriticDot = "round" + +[prime.diacritic-dot.variants.square] +rank = 2 +description = "Dots and Commas in diacritics are square" +selector.diacriticDot = "square" + + + # This is a special variant selector that controls digit form [prime.digit-form] isSpecial = true @@ -6659,6 +6677,7 @@ ascii-single-quote = "straight" ascii-grave = "straight" question = "smooth" punctuation-dot = "round" +diacritic-dot = "round" # m, n, h has tailed variant, but not very ideal # Do not make them default @@ -6868,6 +6887,7 @@ brace = "straight" at = "fourfold" percent = "rings-continuous-slash" punctuation-dot = "square" +diacritic-dot = "square" [composite.ss02.slab-override.design] capital-k = "straight-serifed" @@ -6985,6 +7005,7 @@ ampersand = "upper-open" percent = "rings-continuous-slash" bar = "force-upright" punctuation-dot = "square" +diacritic-dot = "square" [composite.ss04.slab-override.design] capital-d = "more-rounded-bilateral-serifed" @@ -7090,6 +7111,7 @@ at = "fourfold" percent = "rings-continuous-slash" bar = "force-upright" punctuation-dot = "square" +diacritic-dot = "square" [composite.ss06.slab-override.design] capital-d = "more-rounded-bilateral-serifed" @@ -7437,6 +7459,7 @@ pilcrow = "low" number-sign = "slanted" percent = "rings-continuous-slash" punctuation-dot = "square" +diacritic-dot = "square" [composite.ss13.slab-override.design] capital-d = "more-rounded-bilateral-serifed" @@ -7692,6 +7715,7 @@ at = "fourfold" dollar = "interrupted" cent = "bar-interrupted" punctuation-dot = "square" +diacritic-dot = "square" brace = "curly-flat-boundary" [composite.ss17.italic]