From 529500d79f5fc068aa67c3234795ef66f5637424 Mon Sep 17 00:00:00 2001 From: be5invis Date: Mon, 8 Feb 2021 20:42:53 -0800 Subject: [PATCH] Locate mark placement and stack offset to config file (#886). --- font-src/glyphs/marks/index.ptl | 32 ++++++++++++++++---------------- font-src/meta/aesthetics.ptl | 22 ++++++++++++---------- font-src/meta/macros.ptl | 15 ++++++++------- params/parameters.toml | 14 ++++++++------ 4 files changed, 44 insertions(+), 39 deletions(-) diff --git a/font-src/glyphs/marks/index.ptl b/font-src/glyphs/marks/index.ptl index e2c9d8bfb..d14795f7a 100644 --- a/font-src/glyphs/marks/index.ptl +++ b/font-src/glyphs/marks/index.ptl @@ -14,30 +14,30 @@ glyph-block Marks : begin ### Combining marks glyph-block-export markExtend markHalfStroke markFine - local markExtend (AccentX * 0.5) - local markHalfStroke : 0.5 * [AdviceStroke2 3.375 3.5 XH] - local markStress : markHalfStroke * 1.1 - local markFine : Math.min (markHalfStroke * 0.9) (0.5 * [AdviceStroke2 3.875 4.25 XH]) + define markExtend (AccentX * 0.5) + define markHalfStroke : 0.5 * [AdviceStroke2 3.375 3.5 XH] + define markStress : markHalfStroke * 1.1 + define markFine : Math.min (markHalfStroke * 0.9) (0.5 * [AdviceStroke2 3.875 4.25 XH]) glyph-block-export markMiddle - local markMiddle (-Middle) - local markDotsRadius : DotRadius * [Math.min 1 (markStress / HalfStroke)] + define markMiddle (-Middle) + define markDotsRadius : DotRadius * [Math.min 1 (markStress / HalfStroke)] glyph-block-export aboveMarkTop aboveMarkBot aboveMarkMid - local aboveMarkTop (XH + Accent * 1.38) - local aboveMarkBot (XH + Accent * 0.35) - local aboveMarkMid [mix aboveMarkBot aboveMarkTop 0.5] + define aboveMarkTop (XH + AccentBaseOffset + AccentStackOffset) + define aboveMarkBot (XH + AccentBaseOffset) + define aboveMarkMid [mix aboveMarkBot aboveMarkTop 0.5] glyph-block-export belowMarkBot belowMarkTop belowMarkMid - local belowMarkBot (0 - Accent * 1.38) - local belowMarkTop (0 - Accent * 0.35) - local belowMarkMid [mix belowMarkBot belowMarkTop 0.5] + define belowMarkBot (0 - AccentBaseOffset - AccentStackOffset) + define belowMarkTop (0 - AccentBaseOffset) + define belowMarkMid [mix belowMarkBot belowMarkTop 0.5] - local commaOvershoot : O * [linreg 16 0 90 (-1) (markHalfStroke * 2)] - local commaOvershoot2 : O * [linreg 16 1 90 (-1) (markHalfStroke * 2)] - local commaAboveRadius : 0.85 * DotRadius * markHalfStroke / HalfStroke + define commaOvershoot : O * [linreg 16 0 90 (-1) (markHalfStroke * 2)] + define commaOvershoot2 : O * [linreg 16 1 90 (-1) (markHalfStroke * 2)] + define commaAboveRadius : 0.85 * DotRadius * markHalfStroke / HalfStroke - local asciiMarkZoom : (RightSB - SB) / (markExtend * 3) + define asciiMarkZoom : (RightSB - SB) / (markExtend * 3) ### Above marks create-glyph 'dotAbove' 0x307 : glyph-proc diff --git a/font-src/meta/aesthetics.ptl b/font-src/meta/aesthetics.ptl index e67eac92c..058ac18a9 100644 --- a/font-src/meta/aesthetics.ptl +++ b/font-src/meta/aesthetics.ptl @@ -96,11 +96,13 @@ export : define [calculateMetrics para] : begin define OverlayPos DesignParameters.overlayPos define Jut para.jut define LongJut para.longjut + define VJut para.vjut define MidJutSide : Math.max Jut : mix (0.5 * Stroke * HVContrast) LongJut 0.5 define MidJutCenter : Math.max Jut : mix (0.5 * Stroke * HVContrast) LongJut 0.6 - define VJut para.vjut - define Accent para.accent - define AccentX para.accentx + define Accent para.accent + define AccentX para.accentx + define AccentBaseOffset para.accentBaseOffset + define AccentStackOffset para.accentStackOffset define CThin : fallback para.cthin 0.75 define CThinB : fallback para.cthinb 0.5 @@ -199,13 +201,13 @@ export : define [calculateMetrics para] : begin Translate ApparentTranslate Rotate GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX OXHook Hook AHook SHook RHook JHook FHook HookX Smooth SmallSmooth Stroke DotSize PeriodSize HBarPos OverlayPos - LongJut Jut VJut Accent AccentX CThin CThinB SLAB TailAdjX TailAdjY LBalance - IBalance LBalance2 IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2 - FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 Ess EssQuestion - HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA - SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS compositeBaseAnchors - AdviceStroke AdviceStroke2 MVertStroke MVertStrokeD OverlayStroke OperatorStroke - GeometryStroke ShoulderFine _SuperXY adviceSSmooth adviceGlottalStopSmooth + LongJut Jut VJut Accent AccentX AccentBaseOffset AccentStackOffset CThin CThinB SLAB + TailAdjX TailAdjY LBalance IBalance LBalance2 IBalance2 JBalance JBalance2 TBalance + TBalance2 RBalance RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 + WideWidth4 Ess EssQuestion HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius + SideJut SmoothA SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS + compositeBaseAnchors AdviceStroke AdviceStroke2 MVertStroke MVertStrokeD OverlayStroke + OperatorStroke GeometryStroke ShoulderFine _SuperXY adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter YSmoothMidR YSmoothMidL] diff --git a/font-src/meta/macros.ptl b/font-src/meta/macros.ptl index 72c536315..c0e9ca576 100644 --- a/font-src/meta/macros.ptl +++ b/font-src/meta/macros.ptl @@ -203,20 +203,21 @@ define-macro glyph-block : syntax-rules recursiveCodes glyphStore $createAndSaveGlyphImpl$ spirofns booleFns MarkSet AS_BASE ALSO_METRICS pickHash buildGlyphs tagged DivFrame fontMetrics $assignUnicodeImpl$] + define metricImports `[UPM HalfUPM Width SB CAP XH Descender Contrast SymbolMid ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop BgOpBot Italify Upright Scale Translate ApparentTranslate Rotate GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX OXHook Hook AHook SHook RHook JHook FHook HookX Smooth SmallSmooth Stroke DotSize - PeriodSize HBarPos OverlayPos LongJut Jut VJut - Accent AccentX CThin CThinB SLAB TailAdjX TailAdjY LBalance IBalance LBalance2 + PeriodSize HBarPos OverlayPos LongJut Jut VJut Accent AccentX AccentBaseOffset + AccentStackOffset CThin CThinB SLAB TailAdjX TailAdjY LBalance IBalance LBalance2 IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 Ess EssQuestion HalfStroke RightSB - Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB - SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS AdviceStroke - AdviceStroke2 MVertStroke OverlayStroke OperatorStroke GeometryStroke ShoulderFine - _SuperXY adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend - SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL] + Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB SmallSmoothA + SmallSmoothB CorrectionOMidX CorrectionOMidS AdviceStroke AdviceStroke2 MVertStroke + OverlayStroke OperatorStroke GeometryStroke ShoulderFine _SuperXY adviceSSmooth + adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf + SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL] define spiroFnImports `[g4 g2 corner flat curl close end straight widths disable-contrast heading unimportant important alsoThru alsoThruThem bezcontrols quadcontrols archv arcvh complexThru dispiro spiro-outline] diff --git a/params/parameters.toml b/params/parameters.toml index 6dd389179..d74372d5b 100644 --- a/params/parameters.toml +++ b/params/parameters.toml @@ -29,12 +29,14 @@ arrowHeight = 1.50 # Height of arrows slopeAngle = 0 # slope angle, in degrees. derivedSlopeAngle = 10 # Slope angle of derived letters requiring italics -accent = 155 # Height of accent marks. -accentx = 200 # Width of accent marks. -overshoot = -8 # Vertical overshoot for arcs. -overshootx = -8 # Horizontal overshoot for arcs. -oxhook = -2 # Horizontal overshoot for hook tips. -fovershoot = -40 # Overshoot of the top end of italic `f`. +accent = 155 # Height of accent marks. +accentx = 200 # Width of accent marks. +accentBaseOffset = 54 # Offset of accent marks to the base. +accentStackOffset = 160 # Offset when accent marks stack. +overshoot = -8 # Vertical overshoot for arcs. +overshootx = -8 # Horizontal overshoot for arcs. +oxhook = -2 # Horizontal overshoot for hook tips. +fovershoot = -40 # Overshoot of the top end of italic `f`. shoulderfineMin = 0.8