Locate mark placement and stack offset to config file (#886).

This commit is contained in:
be5invis 2021-02-08 20:42:53 -08:00
parent b4883c62ba
commit 529500d79f
4 changed files with 44 additions and 39 deletions

View file

@ -14,30 +14,30 @@ glyph-block Marks : begin
### Combining marks ### Combining marks
glyph-block-export markExtend markHalfStroke markFine glyph-block-export markExtend markHalfStroke markFine
local markExtend (AccentX * 0.5) define markExtend (AccentX * 0.5)
local markHalfStroke : 0.5 * [AdviceStroke2 3.375 3.5 XH] define markHalfStroke : 0.5 * [AdviceStroke2 3.375 3.5 XH]
local markStress : markHalfStroke * 1.1 define markStress : markHalfStroke * 1.1
local markFine : Math.min (markHalfStroke * 0.9) (0.5 * [AdviceStroke2 3.875 4.25 XH]) define markFine : Math.min (markHalfStroke * 0.9) (0.5 * [AdviceStroke2 3.875 4.25 XH])
glyph-block-export markMiddle glyph-block-export markMiddle
local markMiddle (-Middle) define markMiddle (-Middle)
local markDotsRadius : DotRadius * [Math.min 1 (markStress / HalfStroke)] define markDotsRadius : DotRadius * [Math.min 1 (markStress / HalfStroke)]
glyph-block-export aboveMarkTop aboveMarkBot aboveMarkMid glyph-block-export aboveMarkTop aboveMarkBot aboveMarkMid
local aboveMarkTop (XH + Accent * 1.38) define aboveMarkTop (XH + AccentBaseOffset + AccentStackOffset)
local aboveMarkBot (XH + Accent * 0.35) define aboveMarkBot (XH + AccentBaseOffset)
local aboveMarkMid [mix aboveMarkBot aboveMarkTop 0.5] define aboveMarkMid [mix aboveMarkBot aboveMarkTop 0.5]
glyph-block-export belowMarkBot belowMarkTop belowMarkMid glyph-block-export belowMarkBot belowMarkTop belowMarkMid
local belowMarkBot (0 - Accent * 1.38) define belowMarkBot (0 - AccentBaseOffset - AccentStackOffset)
local belowMarkTop (0 - Accent * 0.35) define belowMarkTop (0 - AccentBaseOffset)
local belowMarkMid [mix belowMarkBot belowMarkTop 0.5] define belowMarkMid [mix belowMarkBot belowMarkTop 0.5]
local commaOvershoot : O * [linreg 16 0 90 (-1) (markHalfStroke * 2)] define commaOvershoot : O * [linreg 16 0 90 (-1) (markHalfStroke * 2)]
local commaOvershoot2 : O * [linreg 16 1 90 (-1) (markHalfStroke * 2)] define commaOvershoot2 : O * [linreg 16 1 90 (-1) (markHalfStroke * 2)]
local commaAboveRadius : 0.85 * DotRadius * markHalfStroke / HalfStroke define commaAboveRadius : 0.85 * DotRadius * markHalfStroke / HalfStroke
local asciiMarkZoom : (RightSB - SB) / (markExtend * 3) define asciiMarkZoom : (RightSB - SB) / (markExtend * 3)
### Above marks ### Above marks
create-glyph 'dotAbove' 0x307 : glyph-proc create-glyph 'dotAbove' 0x307 : glyph-proc

View file

@ -96,11 +96,13 @@ export : define [calculateMetrics para] : begin
define OverlayPos DesignParameters.overlayPos define OverlayPos DesignParameters.overlayPos
define Jut para.jut define Jut para.jut
define LongJut para.longjut define LongJut para.longjut
define VJut para.vjut
define MidJutSide : Math.max Jut : mix (0.5 * Stroke * HVContrast) LongJut 0.5 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 MidJutCenter : Math.max Jut : mix (0.5 * Stroke * HVContrast) LongJut 0.6
define VJut para.vjut define Accent para.accent
define Accent para.accent define AccentX para.accentx
define AccentX para.accentx define AccentBaseOffset para.accentBaseOffset
define AccentStackOffset para.accentStackOffset
define CThin : fallback para.cthin 0.75 define CThin : fallback para.cthin 0.75
define CThinB : fallback para.cthinb 0.5 define CThinB : fallback para.cthinb 0.5
@ -199,13 +201,13 @@ export : define [calculateMetrics para] : begin
Translate ApparentTranslate Rotate GlobalTransform TanSlope HVContrast Upward Downward Translate ApparentTranslate Rotate GlobalTransform TanSlope HVContrast Upward Downward
Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX OXHook Hook AHook SHook RHook Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX OXHook Hook AHook SHook RHook
JHook FHook HookX Smooth SmallSmooth Stroke DotSize PeriodSize HBarPos OverlayPos JHook FHook HookX Smooth SmallSmooth Stroke DotSize PeriodSize HBarPos OverlayPos
LongJut Jut VJut Accent AccentX CThin CThinB SLAB TailAdjX TailAdjY LBalance LongJut Jut VJut Accent AccentX AccentBaseOffset AccentStackOffset CThin CThinB SLAB
IBalance LBalance2 IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2 TailAdjX TailAdjY LBalance IBalance LBalance2 IBalance2 JBalance JBalance2 TBalance
FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 Ess EssQuestion TBalance2 RBalance RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3
HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA WideWidth4 Ess EssQuestion HalfStroke RightSB Middle CapMiddle DotRadius PeriodRadius
SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS compositeBaseAnchors SideJut SmoothA SmoothB SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS
AdviceStroke AdviceStroke2 MVertStroke MVertStrokeD OverlayStroke OperatorStroke compositeBaseAnchors AdviceStroke AdviceStroke2 MVertStroke MVertStrokeD OverlayStroke
GeometryStroke ShoulderFine _SuperXY adviceSSmooth adviceGlottalStopSmooth OperatorStroke GeometryStroke ShoulderFine _SuperXY adviceSSmooth adviceGlottalStopSmooth
shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter
YSmoothMidR YSmoothMidL] YSmoothMidR YSmoothMidL]

View file

@ -203,20 +203,21 @@ define-macro glyph-block : syntax-rules
recursiveCodes glyphStore $createAndSaveGlyphImpl$ recursiveCodes glyphStore $createAndSaveGlyphImpl$
spirofns booleFns MarkSet AS_BASE ALSO_METRICS pickHash spirofns booleFns MarkSet AS_BASE ALSO_METRICS pickHash
buildGlyphs tagged DivFrame fontMetrics $assignUnicodeImpl$] buildGlyphs tagged DivFrame fontMetrics $assignUnicodeImpl$]
define metricImports `[UPM HalfUPM Width SB CAP XH Descender Contrast SymbolMid ParenTop define metricImports `[UPM HalfUPM Width SB CAP XH Descender Contrast SymbolMid ParenTop
ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop BgOpBot ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop BgOpBot
Italify Upright Scale Translate ApparentTranslate Rotate GlobalTransform TanSlope Italify Upright Scale Translate ApparentTranslate Rotate GlobalTransform TanSlope
HVContrast Upward Downward Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX HVContrast Upward Downward Rightward Leftward UpwardT DownwardT LeftwardT RightwardT O OX
OXHook Hook AHook SHook RHook JHook FHook HookX Smooth SmallSmooth Stroke DotSize OXHook Hook AHook SHook RHook JHook FHook HookX Smooth SmallSmooth Stroke DotSize
PeriodSize HBarPos OverlayPos LongJut Jut VJut PeriodSize HBarPos OverlayPos LongJut Jut VJut Accent AccentX AccentBaseOffset
Accent AccentX CThin CThinB SLAB TailAdjX TailAdjY LBalance IBalance LBalance2 AccentStackOffset CThin CThinB SLAB TailAdjX TailAdjY LBalance IBalance LBalance2
IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2 FBalance OneBalance IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2 FBalance OneBalance
WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 Ess EssQuestion HalfStroke RightSB WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 Ess EssQuestion HalfStroke RightSB
Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB Middle CapMiddle DotRadius PeriodRadius SideJut SmoothA SmoothB SmallSmoothA
SmallSmoothA SmallSmoothB CorrectionOMidX CorrectionOMidS AdviceStroke SmallSmoothB CorrectionOMidX CorrectionOMidS AdviceStroke AdviceStroke2 MVertStroke
AdviceStroke2 MVertStroke OverlayStroke OperatorStroke GeometryStroke ShoulderFine OverlayStroke OperatorStroke GeometryStroke ShoulderFine _SuperXY adviceSSmooth
_SuperXY adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend adviceGlottalStopSmooth shoulderMidSlope StrokeWidthBlend SmoothAOf SmoothBOf
SmoothAOf SmoothBOf SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL] SmoothAdjust MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL]
define spiroFnImports `[g4 g2 corner flat curl close end straight widths define spiroFnImports `[g4 g2 corner flat curl close end straight widths
disable-contrast heading unimportant important alsoThru alsoThruThem bezcontrols disable-contrast heading unimportant important alsoThru alsoThruThem bezcontrols
quadcontrols archv arcvh complexThru dispiro spiro-outline] quadcontrols archv arcvh complexThru dispiro spiro-outline]

View file

@ -29,12 +29,14 @@ arrowHeight = 1.50 # Height of arrows
slopeAngle = 0 # slope angle, in degrees. slopeAngle = 0 # slope angle, in degrees.
derivedSlopeAngle = 10 # Slope angle of derived letters requiring italics derivedSlopeAngle = 10 # Slope angle of derived letters requiring italics
accent = 155 # Height of accent marks. accent = 155 # Height of accent marks.
accentx = 200 # Width of accent marks. accentx = 200 # Width of accent marks.
overshoot = -8 # Vertical overshoot for arcs. accentBaseOffset = 54 # Offset of accent marks to the base.
overshootx = -8 # Horizontal overshoot for arcs. accentStackOffset = 160 # Offset when accent marks stack.
oxhook = -2 # Horizontal overshoot for hook tips. overshoot = -8 # Vertical overshoot for arcs.
fovershoot = -40 # Overshoot of the top end of italic `f`. 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 shoulderfineMin = 0.8