From ae374c3ff8d18be8b46e569df372cdc637dec11d Mon Sep 17 00:00:00 2001 From: be5invis Date: Mon, 8 Mar 2021 21:32:51 -0800 Subject: [PATCH] Fix incorrect serif shape for motion-serifed `m` under semi-proportional subfamilies. --- changes/5.0.6.md | 1 + font-src/glyphs/letter/latin/k.ptl | 2 +- font-src/glyphs/letter/latin/lower-m.ptl | 6 +-- font-src/glyphs/letter/latin/v.ptl | 58 ++++++++++++++---------- font-src/glyphs/letter/shared.ptl | 38 ++++++++++------ verdafile.js | 3 +- 6 files changed, 64 insertions(+), 44 deletions(-) create mode 100644 changes/5.0.6.md diff --git a/changes/5.0.6.md b/changes/5.0.6.md new file mode 100644 index 000000000..494d61fea --- /dev/null +++ b/changes/5.0.6.md @@ -0,0 +1 @@ + * Fix incorrect serif shape for motion-serifed `m` under semi-proportional subfamilies. \ No newline at end of file diff --git a/font-src/glyphs/letter/latin/k.ptl b/font-src/glyphs/letter/latin/k.ptl index 122ea133d..df91fe7fa 100644 --- a/font-src/glyphs/letter/latin/k.ptl +++ b/font-src/glyphs/letter/latin/k.ptl @@ -182,7 +182,7 @@ glyph-block Letter-Latin-K : begin then : dispiro flat xDTStart dim.arcTerminalY [widths.center swDiagTailAdj] curl (xDTEnd + 0.125 * [DiagonalTailInnerRadius]) (0.9 * swDiagTail + 0.5 *[DiagonalTailInnerRadius]) - DiagonalTailF 1 [DivFrame 1] xDTEnd 0 (Hook - swDiagTail * 0.375) swDiagTail + DiagonalTailF 1 [DivFrame 1] xDTEnd 0 50 (Hook) swDiagTail else : intersection Rect XH 0 0 [if slab (dim.slabStartX + SideJut) (Width * 2)] dispiro diff --git a/font-src/glyphs/letter/latin/lower-m.ptl b/font-src/glyphs/letter/latin/lower-m.ptl index 2dbda2988..67a1562d4 100644 --- a/font-src/glyphs/letter/latin/lower-m.ptl +++ b/font-src/glyphs/letter/latin/lower-m.ptl @@ -93,11 +93,7 @@ glyph-block Letter-Latin-Lower-M : begin include : tagged 'serifRB' : RightwardBottomSerif df.rightSB rbot SideJut df.mvs define [SmallMBottomMotionRightSerif df top rbot] : glyph-proc - if (df.width > para.refJut * 7) : begin - include : tagged 'serifRB' : begin - CenterBottomSerif (df.rightSB - 0.5 * df.mvs * HVContrast) rbot Jut df.mvs - : else : begin - include : tagged 'serifRB' : RightwardBottomSerif df.rightSB rbot SideJut df.mvs + include : tagged 'serifRB' : RightwardBottomSerif df.rightSB rbot SideJut df.mvs define [SmallMSerifs df top lbot mbot rbot tailed earless] : glyph-proc if [not earless] : include : SmallMTopLeftSerif df top lbot diff --git a/font-src/glyphs/letter/latin/v.ptl b/font-src/glyphs/letter/latin/v.ptl index efa497e78..ffb026df0 100644 --- a/font-src/glyphs/letter/latin/v.ptl +++ b/font-src/glyphs/letter/latin/v.ptl @@ -117,36 +117,48 @@ glyph-block Letter-Latin-V : begin flat xBar top [heading Downward] curl xBar ((sw + rInY) * (1 + TanSlope)) arcvh - g2 (xBar + sw * HVContrast + rInY * HVContrast + TanSlope * sw) O + g2.right.mid (xBar + sw * HVContrast + rInY * HVContrast + TanSlope * sw) O archv.superness 2 g4 xArcRight yArcRight g4 xArcEnd yArcEnd - create-glyph : glyph-proc + create-glyph 'V.straight' : glyph-proc include : MarkSet.capital - create-derived 'V.straight' : VShape [DivFrame 1] CAP Stroke true - create-derived 'V.curly' : VShape [DivFrame 1] CAP Stroke false - create-derived 'V.straightMotionSerifed' : composite-proc - VShape [DivFrame 1] CAP Stroke true (slab -- false) - LeftwardTopSerif SB CAP SideJut - create-derived 'V.curlyMotionSerifed' : composite-proc - VShape [DivFrame 1] CAP Stroke false (slab -- false) - LeftwardTopSerif SB CAP SideJut + include : VShape [DivFrame 1] CAP Stroke true + create-glyph 'V.curly' : glyph-proc + include : MarkSet.capital + include : VShape [DivFrame 1] CAP Stroke false + create-glyph 'V.straightMotionSerifed' : glyph-proc + include : MarkSet.capital + include : VShape [DivFrame 1] CAP Stroke true (slab -- false) + include : LeftwardTopSerif SB CAP SideJut + create-glyph 'V.curlyMotionSerifed' : glyph-proc + include : MarkSet.capital + include : VShape [DivFrame 1] CAP Stroke false (slab -- false) + include : LeftwardTopSerif SB CAP SideJut - create-glyph : glyph-proc + create-glyph 'v.straight' : glyph-proc include : MarkSet.e - create-derived 'v.straight' : VShape [DivFrame 1] XH Stroke true - create-derived 'v.curly' : VShape [DivFrame 1] XH Stroke false - create-derived 'v.cursive' : VCursiveShape 0 XH Stroke - create-derived 'v.straightMotionSerifed' : composite-proc - VShape [DivFrame 1] XH Stroke true (slab -- false) - LeftwardTopSerif SB XH SideJut - create-derived 'v.curlyMotionSerifed' : composite-proc - VShape [DivFrame 1] XH Stroke false (slab -- false) - LeftwardTopSerif SB XH SideJut - create-derived 'v.cursiveMotionSerifed' : composite-proc - VCursiveShape (1 / 32) XH Stroke - LeftwardTopSerif [VCursiveShapeBarPos (1 / 32)] XH (SideJut + [VCursiveShapeBarPos (1 / 32)] - SB) + include : VShape [DivFrame 1] XH Stroke true + create-glyph 'v.curly' : glyph-proc + include : MarkSet.e + include : VShape [DivFrame 1] XH Stroke false + create-glyph 'v.cursive' : glyph-proc + include : MarkSet.e + include : VCursiveShape 0 XH Stroke + create-glyph 'v.straightMotionSerifed' : glyph-proc + include : MarkSet.e + include : VShape [DivFrame 1] XH Stroke true (slab -- false) + include : LeftwardTopSerif SB XH SideJut + create-glyph 'v.curlyMotionSerifed' : glyph-proc + include : MarkSet.e + include : VShape [DivFrame 1] XH Stroke false (slab -- false) + include : LeftwardTopSerif SB XH SideJut + create-glyph 'v.cursiveMotionSerifed' : glyph-proc + local pxBar : 1 / 16 + include : MarkSet.e + include : VCursiveShape pxBar XH Stroke + include : LeftwardTopSerif [VCursiveShapeBarPos pxBar] XH (SideJut + [VCursiveShapeBarPos pxBar] - SB) define [VHooktopShape df barStraight top] : glyph-proc diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index 21f6f9474..e08e55722 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -299,6 +299,8 @@ glyph-block Letter-Shared-Shapes : begin VBarRight cx (cy - hookY + O * 2) cy sw VerticalHook (cx - sw / 2 * HVContrast) cy hookX (-hookY) sw + define DiagTailDefaultAngle 40 + glyph-block-export DiagonalTailStdDepth define [DiagonalTailStdDepth df sw] : Math.max (0.5 * sw) df.div * [Math.hypot HookX Hook] - 0.25 * sw @@ -307,30 +309,38 @@ glyph-block Letter-Shared-Shapes : begin define [DiagonalTailInnerRadius] : Math.max (XH / 32) (0.5 * [AdviceStroke2 24 32 XH]) glyph-block-export DiagonalTailF - define [DiagonalTailF sign df cx cy depth sw] : begin + define [DiagonalTailF sign df cx cy angle depth sw] : begin + define tailAngle : angle / 180 * Math.PI + define sinAngle : Math.sin tailAngle + define cosAngle : Math.cos tailAngle + define mocFine : [AdviceStroke 3] / Stroke * sw define mocSwMid : mix sw mocFine (2 / 3) define fine : mocFine / [mix 1 HVContrast 0.375] define swMid : mix sw fine 0.7 - define rInY : DiagonalTailInnerRadius - define rInX : 1 * rInY - define InvSqrt2 : 1 / [Math.sqrt 2] - define dxTurn : 0.5 * sw * HVContrast + rInX * df.div - define dxTurnObl : if (sign > 0) (-0.75 * TanSlope * rInY) 0 + define rIn : DiagonalTailInnerRadius + define rTurn : rIn + 0.5 * mocFine * cosAngle * HVContrast + + define dxTurn : 0.5 * sw * HVContrast + rIn * df.div + define dxTurnObl : if (sign > 0) (-0.75 * TanSlope * rIn) 0 define dyTurn : 0.5 * mocSwMid - define dxTailStart : dxTurn + InvSqrt2 * rInX + InvSqrt2 * 0.5 * mocFine * HVContrast - define dyTailStart : dyTurn + (1 - InvSqrt2 + [if (sign > 0) 0 (TanSlope)]) * (0.5 * mocFine + rInY) - define dxyDepth : (depth - 0.5 * sw) * InvSqrt2 + define dxTailStart : dxTurn + sinAngle * rTurn + define dyTailStart : dyTurn + (1 - cosAngle + [if (sign > 0) 0 (TanSlope)]) * rTurn + define dxDepth : (depth - 0.5 * sw) * cosAngle + define dyDepth : (depth - 0.5 * sw) * sinAngle return : list - g2 + g2.[if (sign > 0) "right" "left"].mid cx + sign * dxTurn + dxTurnObl cy + O + dyTurn if (sign > 0) widths.center.heading swMid Rightward widths.center.heading swMid Leftward - if (sign > 0) [alsoThru.g2 0.541 (1 - 0.76) [widths.center : mix swMid fine 0.52]] {} + if (sign <= 0) {} : alsoThru.g2 + [Math.sin (tailAngle / 2)] / [Math.sin tailAngle] + (1 - [Math.cos (tailAngle / 2)]) / (1 - [Math.cos tailAngle]) + widths.center : mix swMid fine (1 / 2) flat (cx + sign * dxTailStart) (cy + O + dyTailStart) [widths.center fine] - curl (cx + sign * dxTailStart + sign * dxyDepth) (cy + O + dyTailStart + dxyDepth) + curl (cx + sign * dxTailStart + sign * dxDepth) (cy + O + dyTailStart + dyDepth) glyph-block-export DiagonalTailR define [DiagonalTailR df cx cy depth sw] : begin @@ -338,7 +348,7 @@ glyph-block Letter-Shared-Shapes : begin return : list curl cx (cy + sw + rInY) arcvh 8 - DiagonalTailF (+1) df cx cy depth sw + DiagonalTailF (+1) df cx cy DiagTailDefaultAngle depth sw glyph-block-export DiagonalTailL define [DiagonalTailL df cx cy depth sw] : begin @@ -346,4 +356,4 @@ glyph-block Letter-Shared-Shapes : begin return : list curl cx (cy + sw + rInY) arcvh 8 - DiagonalTailF (-1) df cx cy depth sw + DiagonalTailF (-1) df cx cy DiagTailDefaultAngle depth sw diff --git a/verdafile.js b/verdafile.js index ba39078c2..caff2aae1 100644 --- a/verdafile.js +++ b/verdafile.js @@ -75,7 +75,8 @@ const RawPlans = computed(`metadata:raw-plans`, async target => { if (fs.existsSync(PRIVATE_BUILD_PLANS)) { const privateBP = await tryParseToml(PRIVATE_BUILD_PLANS); - Object.assign(bp.buildPlans, privateBP.buildPlans); + Object.assign(bp.buildPlans, privateBP.buildPlans || {}); + Object.assign(bp.collectPlans, privateBP.collectPlans || {}); Object.assign(bp.buildOptions, privateBP.buildOptions || {}); } return bp;