From 33af28c07aeb32b6fcf7b03c512b25a93b5db2a6 Mon Sep 17 00:00:00 2001 From: be5invis Date: Sun, 18 Apr 2021 04:17:07 -0700 Subject: [PATCH] Adjusted shape of wave ligations (#959). --- changes/6.0.0-preview.4.md | 2 -- changes/{6.0.0-preview.3.md => 6.0.0.md} | 4 ++- font-src/glyphs/common/shapes.ptl | 29 +------------------ font-src/glyphs/index.ptl | 1 + font-src/glyphs/symbol/arrow.ptl | 2 +- font-src/glyphs/symbol/ligation.ptl | 1 + font-src/glyphs/symbol/shared.ptl | 37 ++++++++++++++++++++++++ font-src/meta/macros.ptl | 2 +- 8 files changed, 45 insertions(+), 33 deletions(-) delete mode 100644 changes/6.0.0-preview.4.md rename changes/{6.0.0-preview.3.md => 6.0.0.md} (86%) create mode 100644 font-src/glyphs/symbol/shared.ptl diff --git a/changes/6.0.0-preview.4.md b/changes/6.0.0-preview.4.md deleted file mode 100644 index a87147be7..000000000 --- a/changes/6.0.0-preview.4.md +++ /dev/null @@ -1,2 +0,0 @@ - * Fix broken shape of horn diacritic and `ww` (#957). - * Add turned six-pointed asterisk (#958). \ No newline at end of file diff --git a/changes/6.0.0-preview.3.md b/changes/6.0.0.md similarity index 86% rename from changes/6.0.0-preview.3.md rename to changes/6.0.0.md index da0ae82aa..6456310df 100644 --- a/changes/6.0.0-preview.3.md +++ b/changes/6.0.0.md @@ -9,4 +9,6 @@ * Add vertical-sides variants of `W` and `w` (#950). * Add cursive capital `Z` (#951). * Add flat-hooked Long S and Eszet (#952). - * Add slant-sided `M` (#953). \ No newline at end of file + * Add slant-sided `M` (#953). + * Add turned six-pointed asterisk (#958). + * Adjusted shape of wave ligations (#959). \ No newline at end of file diff --git a/font-src/glyphs/common/shapes.ptl b/font-src/glyphs/common/shapes.ptl index c63651578..ee12f228a 100644 --- a/font-src/glyphs/common/shapes.ptl +++ b/font-src/glyphs/common/shapes.ptl @@ -605,33 +605,6 @@ glyph-block CommonShapes : begin define [ForceUpright] : glyph-proc [set this.gizmo : Translate 0 0] - define [CreateWaveShape dist sw _phaesShift] : begin - define WaveResolution 64 - define WaveMagnitude : dist * (3 / 4) - sw / 2 - define WaveAdj : TanSlope * WaveMagnitude * (-0.75) - define phaseShift : fallback _phaesShift 0 - define [WaveShapeImpl] : params [left right ts te xsJoin xfJoin diagJoinS diagJoinF] : glyph-proc - local resolution : Math.ceil (WaveResolution * (te - ts)) - local knots {} - foreach [pr : range 0 till resolution] : begin - local theta : (phaseShift + [mix ts te (pr / resolution)]) * Math.PI * 2 - local waveRelY : (-1) * [Math.sin theta] - 0.075 * [Math.sin (theta * 3)] - knots.push : g2 - (WaveAdj * waveRelY) + [mix left right (pr / resolution)] - SymbolMid + WaveMagnitude * waveRelY - include : dispiro - widths.center sw - if (xsJoin === nothing) {} : if diagJoinS - list [g2 xsJoin SymbolMid] - list [straight.right.start xsJoin SymbolMid] - begin knots - if (xfJoin === nothing) {} : if diagJoinF - list [g2 xfJoin SymbolMid] - list [straight.right.end xfJoin SymbolMid] - - define [WaveShape] : params [left right xsJoin xfJoin diagJoinS diagJoinF [waveCount 1] [unitWidth Width]] : WaveShapeImpl (unitWidth * -left) (unitWidth * (1 + right)) (-left * waveCount) ((1 + right) * waveCount) xsJoin xfJoin diagJoinS diagJoinF - return WaveShape - define [NameUni unicode] : begin local hex : [unicode.toString 16].toUpperCase while (hex.length < 4) : set hex : '0' + hex @@ -665,4 +638,4 @@ glyph-block CommonShapes : begin corner [mix x1 x2 (-k)] [mix y1 y2 (-k)] corner [mix x1 x2 (1+k)] [mix y1 y2 (1+k)] - glyph-block-export Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif NeedSlab NeedNotItalic VSerifs HSerifs CyrISerifs HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar FlatSlashShape hookstart hookend CyrDescender CyrLeftDescender FlipAround ScaleAround Realign ForceUpright DiagCor CreateWaveShape NameUni PointingTo WithAIHSerifsMask WithTransform clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape AsRadical ExtLineCenter DiagCorDs HCrossBar VERY-FAR MaskAbove MaskBelow MaskLeft MaskRight + glyph-block-export Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif NeedSlab NeedNotItalic VSerifs HSerifs CyrISerifs HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar FlatSlashShape hookstart hookend CyrDescender CyrLeftDescender FlipAround ScaleAround Realign ForceUpright DiagCor NameUni PointingTo WithAIHSerifsMask WithTransform clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape AsRadical ExtLineCenter DiagCorDs HCrossBar VERY-FAR MaskAbove MaskBelow MaskLeft MaskRight diff --git a/font-src/glyphs/index.ptl b/font-src/glyphs/index.ptl index 460d82504..97a262e33 100644 --- a/font-src/glyphs/index.ptl +++ b/font-src/glyphs/index.ptl @@ -134,6 +134,7 @@ export all : define [buildGlyphs para recursive recursiveCodes] : begin run-glyph-module './number/index.js' # Symbols + run-glyph-module './symbol/shared.js' run-glyph-module './symbol/punctuation.js' run-glyph-module './symbol/arrow.js' run-glyph-module './symbol/geometric.js' diff --git a/font-src/glyphs/symbol/arrow.ptl b/font-src/glyphs/symbol/arrow.ptl index e3c8e5837..d3957e75a 100644 --- a/font-src/glyphs/symbol/arrow.ptl +++ b/font-src/glyphs/symbol/arrow.ptl @@ -1,4 +1,3 @@ -###### GEOMETRIC SHAPES $$include '../../meta/macros.ptl' import '../../support/transform' as Transform @@ -395,6 +394,7 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1 do "Wave arrows" + glyph-block-import Shared-Symbol-Shapes : CreateWaveShape define WaveSw arrowSw define WaveShape : CreateWaveShape waveArrowAmplitude * 0.4 + WaveSw / 4 * MosaicWidthScalar diff --git a/font-src/glyphs/symbol/ligation.ptl b/font-src/glyphs/symbol/ligation.ptl index b1872982c..b57167b24 100644 --- a/font-src/glyphs/symbol/ligation.ptl +++ b/font-src/glyphs/symbol/ligation.ptl @@ -80,6 +80,7 @@ glyph-block Symbol-Ligation : begin set currentGlyph.autoRefPriority (-3) do "Waves" + glyph-block-import Shared-Symbol-Shapes : CreateWaveShape define WaveShape : CreateWaveShape dblArrowD dblArrowSw (-1 / 4) define LR (2 / 32) diff --git a/font-src/glyphs/symbol/shared.ptl b/font-src/glyphs/symbol/shared.ptl new file mode 100644 index 000000000..936772f1c --- /dev/null +++ b/font-src/glyphs/symbol/shared.ptl @@ -0,0 +1,37 @@ +$$include '../../meta/macros.ptl' + +import '../../support/transform' as Transform +import [mix linreg clamp fallback] from '../../support/utils' +import [DesignParameters] from '../../meta/aesthetics' + +glyph-module + +glyph-block Shared-Symbol-Shapes : begin + + glyph-block-export CreateWaveShape + define [CreateWaveShape dist sw _phaesShift] : begin + define WaveResolution 64 + define WaveMagnitude : dist * (3 / 4) - sw / 2 + define WaveAdj : TanSlope * WaveMagnitude * (-0.75) + define phaseShift : fallback _phaesShift 0 + define [WaveShapeImpl] : params [left right ts te xsJoin xfJoin diagJoinS diagJoinF] : glyph-proc + local resolution : Math.ceil (WaveResolution * (te - ts)) + local knots {} + foreach [pr : range 0 till resolution] : begin + local theta : (phaseShift + [mix ts te (pr / resolution)]) * Math.PI * 2 + local waveRelY : [Math.sin theta] + 0.075 * [Math.sin (theta * 3)] + knots.push : g2 + (WaveAdj * waveRelY) + [mix left right (pr / resolution)] + SymbolMid + WaveMagnitude * waveRelY + include : dispiro + widths.center sw + if (xsJoin === nothing) {} : if diagJoinS + list [g2 xsJoin SymbolMid] + list [straight.right.start xsJoin SymbolMid] + begin knots + if (xfJoin === nothing) {} : if diagJoinF + list [g2 xfJoin SymbolMid] + list [straight.right.end xfJoin SymbolMid] + + define [WaveShape] : params [left right xsJoin xfJoin diagJoinS diagJoinF [waveCount 1] [unitWidth Width]] : WaveShapeImpl (unitWidth * -left) (unitWidth * (1 + right)) (-left * waveCount) ((1 + right) * waveCount) xsJoin xfJoin diagJoinS diagJoinF + return WaveShape diff --git a/font-src/meta/macros.ptl b/font-src/meta/macros.ptl index c8ca6d173..d8d9d681a 100644 --- a/font-src/meta/macros.ptl +++ b/font-src/meta/macros.ptl @@ -139,7 +139,7 @@ define-macro glyph-block-import : syntax-rules UpwardLeftSerif NeedSlab NeedNotItalic VSerifs HSerifs CyrISerifs HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar FlatSlashShape hookstart hookend CyrDescender CyrLeftDescender FlipAround - ScaleAround Realign ForceUpright DiagCor CreateWaveShape NameUni PointingTo + ScaleAround Realign ForceUpright DiagCor NameUni PointingTo WithAIHSerifsMask WithTransform clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape AsRadical ExtLineCenter DiagCorDs HCrossBar VERY-FAR MaskAbove MaskBelow MaskLeft MaskRight]