This commit is contained in:
be5invis 2023-05-25 19:52:21 -07:00
parent 392e31e7a1
commit fcdbba15fd
9 changed files with 745 additions and 1011 deletions

View file

@ -1,6 +1,6 @@
$$include '../../../meta/macros.ptl' $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix linreg fallback SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
glyph-module glyph-module
@ -179,16 +179,16 @@ glyph-block Letter-Latin-Lower-A : begin
corner (RightSB - Stroke * HVContrast) 0 corner (RightSB - Stroke * HVContrast) 0
corner (RightSB - Stroke * HVContrast) (0 + Stroke / 2) corner (RightSB - Stroke * HVContrast) (0 + Stroke / 2)
define SingleStoreyConfig : object define SingleStoreyConfig : SuffixCfg.weave
singleStoreySerifless { SingleStorey.FullBarBody SingleStorey.SeriflessBar } object # body
singleStoreySerifed { SingleStorey.FullBarBody SingleStorey.SerifedBar } singleStorey SingleStorey.FullBarBody
singleStoreyTailed { SingleStorey.FullBarBody SingleStorey.TailedBar } singleStoreyEarlessCorner SingleStorey.EarlessCornerBody
singleStoreyEarlessCornerSerifless { SingleStorey.EarlessCornerBody SingleStorey.SeriflessBar } singleStoreyEarlessRounded SingleStorey.EarlessRoundedBody
singleStoreyEarlessCornerSerifed { SingleStorey.EarlessCornerBody SingleStorey.SerifedBar }
singleStoreyEarlessCornerTailed { SingleStorey.EarlessCornerBody SingleStorey.TailedBar } object # bar
singleStoreyEarlessRoundedSerifless { SingleStorey.EarlessRoundedBody SingleStorey.SeriflessBar } serifless SingleStorey.SeriflessBar
singleStoreyEarlessRoundedSerifed { SingleStorey.EarlessRoundedBody SingleStorey.SerifedBar } serifed SingleStorey.SerifedBar
singleStoreyEarlessRoundedTailed { SingleStorey.EarlessRoundedBody SingleStorey.TailedBar } tailed SingleStorey.TailedBar
foreach { suffix { body bar } } [Object.entries SingleStoreyConfig] : do foreach { suffix { body bar } } [Object.entries SingleStoreyConfig] : do
create-glyph "a.\(suffix)" : glyph-proc create-glyph "a.\(suffix)" : glyph-proc

View file

@ -1,6 +1,6 @@
$$include '../../../meta/macros.ptl' $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix clamp fallback SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
glyph-module glyph-module
@ -71,25 +71,22 @@ glyph-block Letter-Latin-Lower-D : begin
define [BaseSerif df yTop] : tagged 'serifRB' define [BaseSerif df yTop] : tagged 'serifRB'
HSerif.rb df.rightSB 0 SideJut HSerif.rb df.rightSB 0 SideJut
define DConfig : object define DConfig : SuffixCfg.weave
toothedSerifless { ToothedBody null null } object # body
toothedTopSerifed { ToothedBody TopSerif null } toothed ToothedBody
toothedSerifed { ToothedBody TopSerif BaseSerif } toothlessCorner ToothlessCornerBody
toothedBottomSerifed { ToothedBody null BaseSerif } toothlessCornerHBB ToothlessCornerHBBBody
tailedSerifless { TailedBody null null } toothlessRounded ToothlessRoundedBody
tailedSerifed { TailedBody TopSerif null } toothlessRoundedHBB ToothlessRoundedHBBBody
toothlessCornerSerifless { ToothlessCornerBody null null } tailed TailedBody
toothlessCornerSerifed { ToothlessCornerBody TopSerif null }
toothlessCornerSeriflessHBB { ToothlessCornerHBBBody null null }
toothlessCornerSerifedHBB { ToothlessCornerHBBBody TopSerif null }
toothlessRoundedSerifless { ToothlessRoundedBody null null }
toothlessRoundedSerifed { ToothlessRoundedBody TopSerif null }
toothlessRoundedSeriflessHBB { ToothlessRoundedHBBBody null null }
toothlessRoundedSerifedHBB { ToothlessRoundedHBBBody TopSerif null }
toothlessRoundedBottomSerifed { ToothlessRoundedHBBBody null BaseSerif }
toothlessRoundedBilateralSerifed{ ToothlessRoundedHBBBody TopSerif BaseSerif }
foreach { suffix { Body topSerif bottomSerif } } [Object.entries DConfig] : do function [body] : object # serifs
serifless { null null }
topSerifed { TopSerif null }
bottomSerifed { null [if (body === 'toothed') BaseSerif null] }
serifed { TopSerif [if (body === 'toothed') BaseSerif null] }
foreach { suffix { Body {topSerif bottomSerif} } } [Object.entries DConfig] : do
local yOverlay : mix XH (Ascender - [if topSerif Stroke 0]) 0.5 local yOverlay : mix XH (Ascender - [if topSerif Stroke 0]) 0.5
create-glyph "d.\(suffix)" : glyph-proc create-glyph "d.\(suffix)" : glyph-proc

View file

@ -1,6 +1,6 @@
$$include '../../../meta/macros.ptl' $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix fallback SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
glyph-module glyph-module
@ -135,47 +135,24 @@ glyph-block Letter-Latin-Lower-F : begin
define dfNarrowF : DivFrame para.diversityF define dfNarrowF : DivFrame para.diversityF
define pNarrowSide : mix 1 para.diversityF 1.5 define pNarrowSide : mix 1 para.diversityF 1.5
define SmallFConfig : object define SmallFConfig : SuffixCfg.weave
'serifless' { { StandardSmallFShape [DivFrame 1] } { 0.95 fbar CH-NONE } 'b' } object # body
'serifed' { { StandardSmallFShape [DivFrame 1] } { 0.95 fbar CH-SERIF } 'b' } "" { StandardSmallFShape [DivFrame 1] }
'extended' { { StandardSmallFShape [DivFrame 1] } { 0.95 fbar CH-EXTENSION } 'if' } flatHook { [NarrowFShape 0] dfNarrowF }
'tailed' { { StandardSmallFShape [DivFrame 1] } { 1 fbar CH-HOOK } 'if' } flatHookCLC1 { [NarrowFShape 1] dfNarrowF }
'diagonalTailed' { { StandardSmallFShape [DivFrame 1] } { 1 fbar CH-DIAGONAL-HOOK } 'if' } flatHookCLC2 { [NarrowFShape 2] dfNarrowF }
'seriflessCrossbarAtXHeight' { { StandardSmallFShape [DivFrame 1] } { 0.95 XH CH-NONE } 'b' } flatHookCLC3 { [NarrowFShape 3] dfNarrowF }
'serifedCrossbarAtXHeight' { { StandardSmallFShape [DivFrame 1] } { 0.95 XH CH-SERIF } 'b' } function [body] : object # hooks
'extendedCrossbarAtXHeight' { { StandardSmallFShape [DivFrame 1] } { 0.95 XH CH-EXTENSION } 'if' } serifless { [if body pNarrowSide 0.95] CH-NONE 'b' }
'tailedCrossbarAtXHeight' { { StandardSmallFShape [DivFrame 1] } { 1 XH CH-HOOK } 'if' } serifed { [if body pNarrowSide 0.95] CH-SERIF 'b' }
'diagonalTailedCrossbarAtXHeight' { { StandardSmallFShape [DivFrame 1] } { 1 XH CH-DIAGONAL-HOOK } 'if' } extended { [if body pNarrowSide 0.95] CH-EXTENSION 'if' }
'flatHook' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide fbar CH-NONE } 'b' } tailed { [if body pNarrowSide 1] CH-HOOK 'if' }
'flatHookSerifed' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide fbar CH-SERIF } 'b' } diagonalTailed { [if body pNarrowSide 1] CH-DIAGONAL-HOOK 'if' }
'flatHookExtended' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide fbar CH-EXTENSION } 'if' } object # crossbar
'flatHookTailed' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide fbar CH-HOOK } 'if' } "" fbar
'flatHookDiagonalTailed' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide fbar CH-DIAGONAL-HOOK } 'if' } crossbarAtXHeight XH
'flatHookCrossbarAtXHeight' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide XH CH-NONE } 'b' }
'flatHookSerifedCrossbarAtXHeight' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide XH CH-SERIF } 'b' }
'flatHookExtendedCrossbarAtXHeight' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide XH CH-EXTENSION } 'if' }
'flatHookTailedCrossbarAtXHeight' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide XH CH-HOOK } 'if' }
'flatHookDiagonalTailedCrossbarAtXHeight' { { [NarrowFShape 0] dfNarrowF } { pNarrowSide XH CH-DIAGONAL-HOOK } 'if' }
'flatHookCLC1' { { [NarrowFShape 1] dfNarrowF } { pNarrowSide XH CH-NONE } 'b' } foreach { suffix {{Body df} {pBar ch mk} yBar}} [Object.entries SmallFConfig] : do
'flatHookSerifedCLC1' { { [NarrowFShape 1] dfNarrowF } { pNarrowSide XH CH-SERIF } 'b' }
'flatHookExtendedCLC1' { { [NarrowFShape 1] dfNarrowF } { pNarrowSide XH CH-EXTENSION } 'if' }
'flatHookTailedCLC1' { { [NarrowFShape 1] dfNarrowF } { pNarrowSide XH CH-HOOK } 'if' }
'flatHookDiagonalTailedCLC1' { { [NarrowFShape 1] dfNarrowF } { pNarrowSide XH CH-DIAGONAL-HOOK } 'if' }
'flatHookCLC2' { { [NarrowFShape 2] dfNarrowF } { pNarrowSide fbar CH-NONE } 'b' }
'flatHookSerifedCLC2' { { [NarrowFShape 2] dfNarrowF } { pNarrowSide fbar CH-SERIF } 'b' }
'flatHookExtendedCLC2' { { [NarrowFShape 2] dfNarrowF } { pNarrowSide fbar CH-EXTENSION } 'if' }
'flatHookTailedCLC2' { { [NarrowFShape 2] dfNarrowF } { pNarrowSide fbar CH-HOOK } 'if' }
'flatHookDiagonalTailedCLC2' { { [NarrowFShape 2] dfNarrowF } { pNarrowSide fbar CH-DIAGONAL-HOOK } 'if' }
'flatHookCLC3' { { [NarrowFShape 3] dfNarrowF } { pNarrowSide fbar CH-NONE } 'b' }
'flatHookSerifedCLC3' { { [NarrowFShape 3] dfNarrowF } { pNarrowSide fbar CH-SERIF } 'b' }
'flatHookExtendedCLC3' { { [NarrowFShape 3] dfNarrowF } { pNarrowSide fbar CH-EXTENSION } 'if' }
'flatHookTailedCLC3' { { [NarrowFShape 3] dfNarrowF } { pNarrowSide fbar CH-HOOK } 'if' }
'flatHookDiagonalTailedCLC3' { { [NarrowFShape 3] dfNarrowF } { pNarrowSide fbar CH-DIAGONAL-HOOK } 'if' }
foreach { suffix {{Body df} {pBar yBar ch} mk}} [Object.entries SmallFConfig] : do
create-glyph "f.\(suffix)" : glyph-proc create-glyph "f.\(suffix)" : glyph-proc
set-width df.width set-width df.width
include : df.markSet.(mk) include : df.markSet.(mk)

View file

@ -1,6 +1,6 @@
$$include '../../../meta/macros.ptl' $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix fallback SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
glyph-module glyph-module
@ -11,6 +11,14 @@ glyph-block Letter-Latin-Lower-G : begin
glyph-block-import Letter-Shared-Shapes : OBarLeft OBarRight DToothlessRise DMBlend glyph-block-import Letter-Shared-Shapes : OBarLeft OBarRight DToothlessRise DMBlend
glyph-block-import Letter-Shared-Shapes : FlatHookDepth PalatalHook VerticalHook glyph-block-import Letter-Shared-Shapes : FlatHookDepth PalatalHook VerticalHook
define [OverlayW bw] : glyph-proc
define l : mix 0 SB 0.3
define r : mix Width RightSB 0.3
include : HBar.m l r currentGlyph.baseAnchors.overlay.y bw
# overlay bar width for double-storey g
define obwDoubleStorey : Math.min [AdviceStroke 5] (0.5 / 3 * (CAP - Stroke * 4))
create-glyph 'g.doubleStorey' : glyph-proc create-glyph 'g.doubleStorey' : glyph-proc
include : MarkSet.p include : MarkSet.p
local obot : XH * DesignParameters.gBarPos - O - Stroke * 0.4 local obot : XH * DesignParameters.gBarPos - O - Stroke * 0.4
@ -42,6 +50,8 @@ glyph-block Letter-Latin-Lower-G : begin
set-base-anchor 'overlay' Middle [mix (Descender + O) groundy 0.5] set-base-anchor 'overlay' Middle [mix (Descender + O) groundy 0.5]
create-forked-glyph 'gBar.doubleStorey' : OverlayW obwDoubleStorey
create-glyph 'g.openDoubleStorey' : glyph-proc create-glyph 'g.openDoubleStorey' : glyph-proc
include : MarkSet.p include : MarkSet.p
local obot : XH * DesignParameters.gBarPos - O - Stroke * 0.4 local obot : XH * DesignParameters.gBarPos - O - Stroke * 0.4
@ -69,6 +79,8 @@ glyph-block Letter-Latin-Lower-G : begin
set-base-anchor 'overlay' Middle [mix (Descender + O) groundy 0.5] set-base-anchor 'overlay' Middle [mix (Descender + O) groundy 0.5]
create-forked-glyph 'gBar.openDoubleStorey' : OverlayW obwDoubleStorey
define SingleStorey : namespace define SingleStorey : namespace
export : define [RoundHookT sink df yTop offset sw] : sink export : define [RoundHookT sink df yTop offset sw] : sink
widths.rhs sw widths.rhs sw
@ -116,21 +128,19 @@ glyph-block Letter-Latin-Lower-G : begin
sw -- df.mvs sw -- df.mvs
include : FlipAround df.middle (top / 2) include : FlipAround df.middle (top / 2)
define SingleStoreyConfig : object define SingleStoreyConfig : SuffixCfg.weave
singleStoreySerifless { SingleStorey.SeriflessBody SingleStorey.RoundHook 0 } object # hook
singleStoreySerifed { SingleStorey.SerifedBody SingleStorey.RoundHook 0 } singleStorey SingleStorey.RoundHook
singleStoreyEarlessCorner { SingleStorey.EarlessCornerBody SingleStorey.RoundHook DToothlessRise } singleStoreyFlatHook SingleStorey.FlatHook
singleStoreyEarlessCornerHTB { SingleStorey.EarlessCornerBody SingleStorey.RoundHook 0 } object # ear/serif
singleStoreyEarlessRounded { SingleStorey.EarlessRoundedBody SingleStorey.RoundHook SmallArchDepthB } serifless { SingleStorey.SeriflessBody 0 }
singleStoreyEarlessRoundedHTB { SingleStorey.EarlessRoundedBody SingleStorey.RoundHook 0 } serifed { SingleStorey.SerifedBody 0 }
singleStoreyFlatHookSerifless { SingleStorey.SeriflessBody SingleStorey.FlatHook 0 } earlessCorner { SingleStorey.EarlessCornerBody DToothlessRise }
singleStoreyFlatHookSerifed { SingleStorey.SerifedBody SingleStorey.FlatHook 0 } earlessCornerHTB { SingleStorey.EarlessCornerBody 0 }
singleStoreyEarlessCornerFlatHook { SingleStorey.EarlessCornerBody SingleStorey.FlatHook DToothlessRise } earlessRounded { SingleStorey.EarlessRoundedBody SmallArchDepthB }
singleStoreyEarlessCornerFlatHookHTB { SingleStorey.EarlessCornerBody SingleStorey.FlatHook 0 } earlessRoundedHTB { SingleStorey.EarlessRoundedBody 0 }
singleStoreyEarlessRoundedFlatHook { SingleStorey.EarlessRoundedBody SingleStorey.FlatHook SmallArchDepthB }
singleStoreyEarlessRoundedFlatHookHTB { SingleStorey.EarlessRoundedBody SingleStorey.FlatHook 0 }
foreach { suffix { bodyShape hookShape hookStart } } [Object.entries SingleStoreyConfig] : do foreach { suffix { hookShape {bodyShape hookStart} } } [Object.entries SingleStoreyConfig] : do
create-glyph "g.\(suffix)" : glyph-proc create-glyph "g.\(suffix)" : glyph-proc
include : MarkSet.p include : MarkSet.p
set-base-anchor 'overlay' Middle (XH / 2) set-base-anchor 'overlay' Middle (XH / 2)
@ -158,17 +168,20 @@ glyph-block Letter-Latin-Lower-G : begin
refSw -- dfSub.mvs refSw -- dfSub.mvs
maskOut -- [intersection [MaskBelow 0] [MaskLeft dfSub.rightSB]] maskOut -- [intersection [MaskBelow 0] [MaskLeft dfSub.rightSB]]
create-glyph "gBar.\(suffix)" : glyph-proc
include [refer-glyph "g.\(suffix)"] AS_BASE ALSO_METRICS
include : OverlayW [AdviceStroke2 2 4 XH]
select-variant 'g' 'g' select-variant 'g' 'g'
link-reduced-variant 'g/sansSerif' 'g' MathSansSerif link-reduced-variant 'g/sansSerif' 'g' MathSansSerif
turned 'turng' 0x1D77 'g' Middle [mix Descender XH 0.5] turned 'turng' 0x1D77 'g' Middle [mix Descender XH 0.5]
select-variant "gBar" 0x1E5 (follow -- 'g')
select-variant 'gScript/hookTopBase' null (shapeFrom -- 'g') select-variant 'gScript/hookTopBase' null (shapeFrom -- 'g')
select-variant 'gScript' 0x261 (shapeFrom -- 'g') select-variant 'gScript' 0x261 (shapeFrom -- 'g') (follow -- 'gScript')
follow -- [if SLAB 'gScript/slabSerif' 'gScript/sansSerif'] select-variant 'GScript' 0xA7AC (follow -- 'gScript')
select-variant 'GScript' 0xA7AC select-variant 'gPalatalHook' 0x1D83 (follow -- 'gScript')
follow -- [if SLAB 'gScript/slabSerif' 'gScript/sansSerif']
select-variant 'gPalatalHook' 0x1D83
follow -- [if SLAB 'gScript/slabSerif' 'gScript/sansSerif']
alias 'cyrl/de.SRB' null 'gScript' alias 'cyrl/de.SRB' null 'gScript'
@ -192,25 +205,3 @@ glyph-block Letter-Latin-Lower-G : begin
include : intersection include : intersection
VBar.r (RightSB - BBD) Descender XH BBS VBar.r (RightSB - BBD) Descender XH BBS
SingleStorey.RoundHookT spiro-outline [DivFrame 1] XH 1 BBS SingleStorey.RoundHookT spiro-outline [DivFrame 1] XH 1 BBS
do
define l : mix 0 SB 0.3
define r : mix Width RightSB 0.3
define bwDoubleStorey : Math.min [AdviceStroke 5] (0.5 / 3 * (CAP - Stroke * 4))
define bwSingleStorey : AdviceStroke2 2 4 XH
define [derive suffix bw] : create-glyph "gbar.\(suffix)" : glyph-proc
include [refer-glyph "g.\(suffix)"] AS_BASE
include : HBar.m l r [query-glyph "g.\(suffix)"].baseAnchors.overlay.y bw
derive 'doubleStorey' bwDoubleStorey
derive 'openDoubleStorey' bwDoubleStorey
derive 'singleStoreySerifless' bwSingleStorey
derive 'singleStoreySerifed' bwSingleStorey
derive 'singleStoreyEarlessCorner' bwSingleStorey
derive 'singleStoreyEarlessRounded' bwSingleStorey
derive 'singleStoreyFlatHookSerifless' bwSingleStorey
derive 'singleStoreyFlatHookSerifed' bwSingleStorey
derive 'singleStoreyEarlessCornerFlatHook' bwSingleStorey
derive 'singleStoreyEarlessRoundedFlatHook' bwSingleStorey
select-variant "gbar" 0x1E5 (follow -- 'g')

View file

@ -1,6 +1,6 @@
$$include '../../../meta/macros.ptl' $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix fallback SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
glyph-module glyph-module
@ -44,18 +44,17 @@ glyph-block Letter-Latin-Lower-H : begin
corner (SB + HalfStroke * HVContrast) yOverlay corner (SB + HalfStroke * HVContrast) yOverlay
corner xOverlayEnd yOverlay corner xOverlayEnd yOverlay
define HConfig : object define HConfig : SuffixCfg.weave
straightSerifless { 0 false no-shape } object # tail
tailedSerifless { 1 false no-shape } straight false
straightMotionSerifed { 0 true SmallHMotionSerifs } tailed true
tailedMotionSerifed { 1 true SmallHMotionSerifs } object # serifs
straightTopLeftSerifed { 0 true SmallHTopLeftSerifs } serifless { false no-shape }
straightLeftSerifed { 0 true SmallHSerifs } serifed { true SmallHSerifs }
tailedLeftSerifed { 1 true SmallHSerifs } motionSerifed { true SmallHMotionSerifs }
straightSerifed { 0 true SmallHSerifs } topLeftSerifed { true SmallHTopLeftSerifs }
tailedSerifed { 1 true SmallHSerifs }
foreach { suffix { fTailed fHasTopSerif Serifs } } [Object.entries HConfig] : do foreach { suffix { fTailed {fHasTopSerif Serifs} } } [Object.entries HConfig] : do
create-glyph "h.\(suffix)" : glyph-proc create-glyph "h.\(suffix)" : glyph-proc
include : MarkSet.b include : MarkSet.b
include : VBar.l SB 0 Ascender include : VBar.l SB 0 Ascender

View file

@ -186,7 +186,7 @@ glyph-block Letter-Latin-Lower-M : begin
"topLeftSerifed" { LtSerifs } "topLeftSerifed" { LtSerifs }
"topLeftAndBottomRightSerifed" { LtRbSerifs } "topLeftAndBottomRightSerifed" { LtRbSerifs }
foreach { suffix { {Body earless} {tailed} {shortLeg} {Serifs} } } [pairs-of SmallMConfig] : do foreach { suffix { {Body earless} {shortLeg} {tailed} {Serifs} } } [pairs-of SmallMConfig] : do
define [mShapeBody df height] : glyph-proc define [mShapeBody df height] : glyph-proc
include : Body height 0 [if shortLeg [SmallMShortLegHeight height df] 0] [if tailed ([SmallMSmoothHeight height df] + O) 0] df include : Body height 0 [if shortLeg [SmallMShortLegHeight height df] 0] [if tailed ([SmallMSmoothHeight height df] + O) 0] df
if tailed : include : RightwardTailedBar df.rightSB 0 [SmallMSmoothHeight height df] (sw -- df.mvs) if tailed : include : RightwardTailedBar df.rightSB 0 [SmallMSmoothHeight height df] (sw -- df.mvs)

View file

@ -1,6 +1,6 @@
$$include '../../../meta/macros.ptl' $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix clamp fallback SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif Joining] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif Joining] from"../../../support/gr.mjs"
glyph-module glyph-module
@ -65,35 +65,28 @@ glyph-block Letter-Latin-Lower-N : begin
include : RightwardTailedBar right yBot yBR sw include : RightwardTailedBar right yBot yBR sw
include : AdjustTrailingAnchor include : AdjustTrailingAnchor
define NConfig : object define NConfig : SuffixCfg.weave
'straightSerifless' { EaredBody 0 nothing nothing nothing } object # body
'straightMotionSerifed' { EaredBody 0 NTopLeftSerif nothing NBottomRightSerifItalic } "" EaredBody
'straightTopLeftSerifed' { EaredBody 0 NTopLeftSerif nothing nothing } earlessCorner EarlessCornerBody
'straightSerifed' { EaredBody 0 NTopLeftSerif NBottomLeftSerif NBottomRightSerifUpright } earlessRounded EarlessRoundedBody
earlessCornerHTB EarlessCornerBody
earlessRoundedHTB EarlessRoundedBody
object # terminal
straight 0
tailed 1
function [body tail] : object # serifs
serifless { nothing nothing nothing }
topLeftSerifed { NTopLeftSerif nothing nothing }
motionSerifed { NTopLeftSerif nothing [if (tail != 'tailed') NBottomRightSerifItalic] }
serifed : list
match body
([Just "earlessCorner"] || [Just "earlessRounded"]) nothing
([Just "earlessCornerHTB"] || [Just "earlessRoundedHTB"]) NHTB
begin NBottomLeftSerif
if (tail != 'tailed') NBottomRightSerifUpright
'tailedSerifless' { EaredBody 1 nothing nothing nothing } foreach { suffix { Body tailed {sLT sLB sRB} } } [Object.entries NConfig] : do
'tailedMotionSerifed' { EaredBody 1 NTopLeftSerif nothing nothing }
'tailedSerifed' { EaredBody 1 NTopLeftSerif NBottomLeftSerif nothing }
'earlessCornerStraightSerifless' { EarlessCornerBody 0 nothing nothing nothing }
'earlessCornerStraightSerifed' { EarlessCornerBody 0 nothing NBottomLeftSerif NBottomRightSerifUpright }
'earlessCornerTailedSerifless' { EarlessCornerBody 1 nothing nothing nothing }
'earlessCornerTailedSerifed' { EarlessCornerBody 1 nothing NBottomLeftSerif nothing }
'earlessRoundedStraightSerifless' { EarlessRoundedBody 0 nothing nothing nothing }
'earlessRoundedStraightSerifed' { EarlessRoundedBody 0 nothing NBottomLeftSerif NBottomRightSerifUpright }
'earlessRoundedTailedSerifless' { EarlessRoundedBody 1 nothing nothing nothing }
'earlessRoundedTailedSerifed' { EarlessRoundedBody 1 nothing NBottomLeftSerif nothing }
'earlessCornerStraightHTBSerifless' { EarlessCornerBody 0 NHTB nothing nothing }
'earlessCornerStraightHTBSerifed' { EarlessCornerBody 0 NHTB NBottomLeftSerif NBottomRightSerifUpright }
'earlessCornerTailedHTBSerifless' { EarlessCornerBody 1 NHTB nothing nothing }
'earlessCornerTailedHTBSerifed' { EarlessCornerBody 1 NHTB NBottomLeftSerif nothing }
'earlessRoundedStraightHTBSerifless' { EarlessRoundedBody 0 NHTB nothing nothing }
'earlessRoundedStraightHTBSerifed' { EarlessRoundedBody 0 NHTB NBottomLeftSerif NBottomRightSerifUpright }
'earlessRoundedTailedHTBSerifless' { EarlessRoundedBody 1 NHTB nothing nothing }
'earlessRoundedTailedHTBSerifed' { EarlessRoundedBody 1 NHTB NBottomLeftSerif nothing }
foreach { suffix { Body tailed sLT sLB sRB } } [Object.entries NConfig] : do
create-glyph "n.\(suffix)" : glyph-proc create-glyph "n.\(suffix)" : glyph-proc
include : MarkSet.e include : MarkSet.e
set-base-anchor 'trailing' RightSB 0 set-base-anchor 'trailing' RightSB 0

View file

@ -281,19 +281,26 @@ class VbStageAlternative {
tryAccept(globalState, localState) { tryAccept(globalState, localState) {
// Reject if disable conditions match // Reject if disable conditions match
if (this.shouldReject(localState)) return null; if (this.evalCondition(this.disableIf, localState)) return null;
// Accept this alternative. // Accept this alternative.
const ans = localState.clone(); const ans = localState.clone();
ans.stage = this.next; ans.stage = this.next;
ans.assignments.set(this.stage, this.key); ans.assignments.set(this.stage, this.key);
if (this.stage === globalState.entry) ans.rankGroup = this.rank; if (this.stage === globalState.entry) ans.rankGroup = this.rank;
if (this.keyAffix) ans.addKeyAffix(this.mode, this.keyAffix);
if (this.descriptionJoiner && this.descriptionAffix) if (this.keyAffix) ans.addKeyAffix(this.mode, this.evalValue(this.keyAffix, localState));
ans.addDescription(this.mode, this.descriptionJoiner, this.descriptionAffix); if (this.descriptionJoiner && this.descriptionAffix) {
if (this.selectorAffix) ans.addDescription(
this.mode,
this.evalValue(this.descriptionJoiner, localState),
this.evalValue(this.descriptionAffix, localState)
);
}
if (this.selectorAffix) {
for (const [selector, suffix] of Object.entries(this.selectorAffix)) for (const [selector, suffix] of Object.entries(this.selectorAffix))
ans.addSelectorAffix(this.mode, selector, suffix); ans.addSelectorAffix(this.mode, selector, this.evalValue(suffix, localState));
}
if (!this.next || this.next === "END") { if (!this.next || this.next === "END") {
ans.rank = ++globalState.rank; ans.rank = ++globalState.rank;
@ -304,10 +311,22 @@ class VbStageAlternative {
} }
} }
shouldReject(localState) { evalValue(expr, localState) {
if (!this.disableIf) return false; if (typeof expr === "string") return expr;
if (expr.if) {
const condition = this.evalCondition(expr.if, localState);
if (condition) {
return this.evalCondition(expr.then, localState);
} else {
return this.evalCondition(expr.else, localState);
}
}
}
for (const branch of this.disableIf) { evalCondition(expr, localState) {
if (!expr) return false;
for (const branch of expr) {
let statementMatches = true; let statementMatches = true;
for (let [k, v] of Object.entries(branch)) { for (let [k, v] of Object.entries(branch)) {
v = v.trim(); v = v.trim();

File diff suppressed because it is too large Load diff