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
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

View file

@ -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 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]

View file

@ -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]

View file

@ -31,6 +31,8 @@ derivedSlopeAngle = 10 # Slope angle of derived letters requiring italics
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.