Adjust serif shapes for lowercase italic Yeri glyphs with corner body shape (#2151).
This commit is contained in:
parent
92e85b86d3
commit
384a6fb10e
6 changed files with 248 additions and 187 deletions
|
@ -1 +1,2 @@
|
||||||
* Fix application of `APLF` for several [Uiua](https://www.uiua.org/) operators.
|
* Fix application of `APLF` for several [Uiua](https://www.uiua.org/) operators.
|
||||||
|
* Adjust serif shapes for lowercase italic Yeri glyphs with corner body shape (#2151).
|
||||||
|
|
|
@ -515,25 +515,23 @@ glyph-block CommonShapes : begin
|
||||||
return : HookShape before after false args
|
return : HookShape before after false args
|
||||||
|
|
||||||
glyph-block-export hookstart
|
glyph-block-export hookstart
|
||||||
define [hookstart] : begin
|
define flex-params [hookstart] : begin
|
||||||
postulate
|
local-parameter : y
|
||||||
y
|
local-parameter : tight
|
||||||
tight
|
local-parameter : sw -- Stroke
|
||||||
sw -- Stroke
|
local-parameter : swItalicAdj -- sw
|
||||||
swItalicAdj -- sw
|
local-parameter : noAdjTerminalY -- false
|
||||||
noAdjTerminalY -- false
|
local-parameter : turnSlope -- nothing
|
||||||
turnSlope -- nothing
|
|
||||||
return : Interpolator hookStartBlender : object y tight sw swItalicAdj noAdjTerminalY turnSlope
|
return : Interpolator hookStartBlender : object y tight sw swItalicAdj noAdjTerminalY turnSlope
|
||||||
|
|
||||||
glyph-block-export hookend
|
glyph-block-export hookend
|
||||||
define [hookend] : begin
|
define flex-params [hookend] : begin
|
||||||
postulate
|
local-parameter : y
|
||||||
y
|
local-parameter : tight
|
||||||
tight
|
local-parameter : sw -- Stroke
|
||||||
sw -- Stroke
|
local-parameter : swItalicAdj -- sw
|
||||||
swItalicAdj -- sw
|
local-parameter : noAdjTerminalY -- false
|
||||||
noAdjTerminalY -- false
|
local-parameter : turnSlope -- nothing
|
||||||
turnSlope -- nothing
|
|
||||||
return : Interpolator hookEndBlender : object y tight sw swItalicAdj noAdjTerminalY turnSlope
|
return : Interpolator hookEndBlender : object y tight sw swItalicAdj noAdjTerminalY turnSlope
|
||||||
|
|
||||||
glyph-block-export Ungizmo
|
glyph-block-export Ungizmo
|
||||||
|
|
|
@ -13,127 +13,162 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
|
|
||||||
define DefaultBarPos 0.55
|
define DefaultBarPos 0.55
|
||||||
|
|
||||||
glyph-block-export CyrlYeriUprightShape
|
define Yeri : namespace
|
||||||
define [CyrlYeriUprightShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
define flex-params [CornerCommon] : glyph-proc
|
||||||
local bowl : top * pBar + HalfStroke
|
local-parameter : top
|
||||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
local-parameter : left -- SB
|
||||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
local-parameter : right -- RightSB
|
||||||
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
local-parameter : stroke -- Stroke
|
||||||
local fine : stroke * CThinB
|
local-parameter : jut -- Jut
|
||||||
|
local-parameter : pBar -- DefaultBarPos
|
||||||
|
local-parameter : yStart -- top
|
||||||
|
|
||||||
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
local bowl : top * pBar + HalfStroke
|
||||||
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||||
|
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||||
|
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
||||||
|
local fine : stroke * CThinB
|
||||||
|
|
||||||
include : union
|
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
||||||
dispiro
|
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
||||||
widths.lhs stroke
|
|
||||||
flat (left + Stroke * 0.2) 0 [heading Rightward]
|
include : union
|
||||||
curl ([Math.max (left + stroke * TanSlope) (right - turnRadius)] + CorrectionOMidX * stroke) 0
|
dispiro
|
||||||
archv 8
|
widths.lhs stroke
|
||||||
g4 (right - OX) yTurnBottomR
|
flat (left + Stroke * 0.2) 0 [heading Rightward]
|
||||||
arcvh 8
|
curl ([Math.max (left + stroke * TanSlope) (right - turnRadius)] + CorrectionOMidX * stroke) 0
|
||||||
flat ([Math.max (left + stroke * TanSlope) (right - turnRadius)] - CorrectionOMidX * stroke) bowl
|
archv 8
|
||||||
|
g4 (right - OX) yTurnBottomR
|
||||||
|
arcvh 8
|
||||||
|
flat ([Math.max (left + stroke * TanSlope) (right - turnRadius)] - CorrectionOMidX * stroke) bowl
|
||||||
|
curl (left + Stroke * 0.2) bowl [heading Leftward]
|
||||||
|
VBar.l left 0 yStart stroke
|
||||||
|
|
||||||
|
export : define flex-params [UprightShape] : glyph-proc
|
||||||
|
local-parameter : top
|
||||||
|
local-parameter : left -- SB
|
||||||
|
local-parameter : right -- RightSB
|
||||||
|
local-parameter : stroke -- Stroke
|
||||||
|
local-parameter : jut -- Jut
|
||||||
|
local-parameter : pBar -- DefaultBarPos
|
||||||
|
local-parameter : yStart -- top
|
||||||
|
|
||||||
|
include : CornerCommon.apply null $-flex-arguments
|
||||||
|
if SLAB : begin
|
||||||
|
include : tagged 'serifYeriLB' : HSerif.lb left 0 (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||||
|
include : tagged 'serifYeriLT' : HSerif.mt (left + [HSwToV : 0.5 * stroke]) top jut stroke
|
||||||
|
|
||||||
|
export : define flex-params [ItalicShape] : glyph-proc
|
||||||
|
local-parameter : top
|
||||||
|
local-parameter : left -- SB
|
||||||
|
local-parameter : right -- RightSB
|
||||||
|
local-parameter : stroke -- Stroke
|
||||||
|
local-parameter : jut -- Jut
|
||||||
|
local-parameter : pBar -- DefaultBarPos
|
||||||
|
local-parameter : yStart -- top
|
||||||
|
|
||||||
|
include : CornerCommon.apply null $-flex-arguments
|
||||||
|
if SLAB : begin
|
||||||
|
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||||
|
|
||||||
|
export : define flex-params [AutoItalicShape] : begin
|
||||||
|
if para.isItalic
|
||||||
|
: then : ItalicShape.apply null $-flex-arguments
|
||||||
|
: else : UprightShape.apply null $-flex-arguments
|
||||||
|
|
||||||
|
export : define flex-params [RoundShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||||
|
local bowl : top * pBar + HalfStroke
|
||||||
|
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||||
|
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||||
|
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
||||||
|
local fine : stroke * CThinB
|
||||||
|
|
||||||
|
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
||||||
|
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
||||||
|
|
||||||
|
include : dispiro
|
||||||
|
flat left [Math.max yStart (yTurnBottomL + 0.1)] [widths.lhs.heading stroke Downward]
|
||||||
|
curl left yTurnBottomL
|
||||||
|
arcvh
|
||||||
|
g4 ([mix left right 0.5] + CorrectionOMidX * stroke) O
|
||||||
|
archv
|
||||||
|
g4 (right - OX) yTurnBottomR
|
||||||
|
arcvh
|
||||||
|
flat ([mix left right 0.5] - CorrectionOMidX * stroke) bowl
|
||||||
curl (left + Stroke * 0.2) bowl [heading Leftward]
|
curl (left + Stroke * 0.2) bowl [heading Leftward]
|
||||||
VBar.l left 0 yStart stroke
|
|
||||||
|
|
||||||
if SLAB : begin
|
if SLAB : begin
|
||||||
include : tagged 'serifYeriLB' : HSerif.lb left 0 (jut - [HSwToV : 0.5 * stroke]) stroke
|
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||||
include : tagged 'serifYeriLT' : HSerif.mt (left + [HSwToV : 0.5 * stroke]) top jut stroke
|
|
||||||
|
|
||||||
glyph-block-export CyrlYeriRoundShape
|
export : define flex-params [CursiveShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||||
define [CyrlYeriRoundShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
local bowl : top * pBar + HalfStroke
|
||||||
local bowl : top * pBar + HalfStroke
|
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
||||||
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
local fine : stroke * CThinB
|
||||||
local fine : stroke * CThinB
|
|
||||||
|
|
||||||
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
||||||
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
||||||
|
|
||||||
include : dispiro
|
include : dispiro
|
||||||
flat left [Math.max yStart (yTurnBottomL + 0.1)] [widths.lhs.heading stroke Downward]
|
flat left [Math.max yStart (yTurnBottomL + 0.1)] [widths.lhs.heading stroke Downward]
|
||||||
curl left yTurnBottomL
|
curl left yTurnBottomL
|
||||||
arcvh
|
arcvh
|
||||||
g4 ([mix left right 0.5] + CorrectionOMidX * stroke) O
|
g4 ([mix left right 0.5] + CorrectionOMidX * stroke) O
|
||||||
archv
|
archv
|
||||||
g4 (right - OX) yTurnBottomR
|
g4 (right - OX) yTurnBottomR
|
||||||
arcvh
|
arcvh
|
||||||
flat ([mix left right 0.5] - CorrectionOMidX * stroke) bowl
|
ShoulderMidKnotLhsRev [mix left right 0.5] bowl fine stroke (-1) (-1)
|
||||||
curl (left + Stroke * 0.2) bowl [heading Leftward]
|
archv
|
||||||
|
g4.down.end (left + (stroke - fine) * HVContrast) yTurnBottomL [widths.lhs.heading fine Downward]
|
||||||
|
|
||||||
if SLAB : begin
|
if SLAB : begin
|
||||||
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||||
|
|
||||||
glyph-block-export CyrlYeriCursiveShape
|
define RevYeri : namespace
|
||||||
define [CyrlYeriCursiveShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
export : define flex-params [Shape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
||||||
local bowl : top * pBar + HalfStroke
|
local bowl : top * pBar + HalfStroke
|
||||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
local turnRadius : bowl * 0.45
|
||||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
local turnbottom : mix 0 bowl (ArchDepthB / (ArchDepthA + ArchDepthB))
|
||||||
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
local trShrink [Math.pow ((right - left) / (RightSB - SB)) 0.5]
|
||||||
local fine : stroke * CThinB
|
include : dispiro
|
||||||
|
widths.rhs stroke
|
||||||
|
flat (right - Stroke * 0.2) 0 [heading Leftward]
|
||||||
|
curl (left + turnRadius * trShrink + CorrectionOMidX * stroke) 0
|
||||||
|
archv
|
||||||
|
g4 (left + O) turnbottom
|
||||||
|
arcvh
|
||||||
|
flat (left + turnRadius * trShrink - CorrectionOMidX * stroke) bowl
|
||||||
|
curl (right - Stroke * 0.2) bowl [heading Rightward]
|
||||||
|
include : VBar.r right 0 top stroke
|
||||||
|
if SLAB : begin
|
||||||
|
include : tagged 'serifYeriRB'
|
||||||
|
HSerif.rb right 0 (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||||
|
include : tagged 'serifYeriRT'
|
||||||
|
HSerif.mt (right - [HSwToV : 0.5 * stroke]) top jut stroke
|
||||||
|
|
||||||
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
export : define flex-params [RoundShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||||
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
local bowl : top * pBar + HalfStroke
|
||||||
|
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||||
|
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||||
|
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
||||||
|
local fine : stroke * CThinB
|
||||||
|
|
||||||
include : dispiro
|
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
||||||
flat left [Math.max yStart (yTurnBottomL + 0.1)] [widths.lhs.heading stroke Downward]
|
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
||||||
curl left yTurnBottomL
|
|
||||||
arcvh
|
|
||||||
g4 ([mix left right 0.5] + CorrectionOMidX * stroke) O
|
|
||||||
archv
|
|
||||||
g4 (right - OX) yTurnBottomR
|
|
||||||
arcvh
|
|
||||||
ShoulderMidKnotLhsRev [mix left right 0.5] bowl fine stroke (-1) (-1)
|
|
||||||
archv
|
|
||||||
g4.down.end (left + (stroke - fine) * HVContrast) yTurnBottomL [widths.lhs.heading fine Downward]
|
|
||||||
|
|
||||||
if SLAB : begin
|
include : dispiro
|
||||||
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
flat right [Math.max yStart (yTurnBottomR + 0.1)] [widths.rhs.heading stroke Downward]
|
||||||
|
curl right yTurnBottomR
|
||||||
|
arcvh
|
||||||
|
g4 ([mix left right 0.5] + CorrectionOMidX * stroke) O
|
||||||
|
archv
|
||||||
|
g4 (left + OX) yTurnBottomL
|
||||||
|
arcvh
|
||||||
|
flat ([mix left right 0.5] - CorrectionOMidX * stroke) bowl
|
||||||
|
curl (right - Stroke * 0.2) bowl [heading Rightward]
|
||||||
|
|
||||||
define [RevCyrYeriShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
define flex-params [CyrBackYerShape Yeri top left right [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
||||||
local bowl : top * pBar + HalfStroke
|
|
||||||
local turnRadius : bowl * 0.45
|
|
||||||
local turnbottom : mix 0 bowl (ArchDepthB / (ArchDepthA + ArchDepthB))
|
|
||||||
local trShrink [Math.pow ((right - left) / (RightSB - SB)) 0.5]
|
|
||||||
include : dispiro
|
|
||||||
widths.rhs stroke
|
|
||||||
flat (right - Stroke * 0.2) 0 [heading Leftward]
|
|
||||||
curl (left + turnRadius * trShrink + CorrectionOMidX * stroke) 0
|
|
||||||
archv
|
|
||||||
g4 (left + O) turnbottom
|
|
||||||
arcvh
|
|
||||||
flat (left + turnRadius * trShrink - CorrectionOMidX * stroke) bowl
|
|
||||||
curl (right - Stroke * 0.2) bowl [heading Rightward]
|
|
||||||
include : VBar.r right 0 top stroke
|
|
||||||
if SLAB : begin
|
|
||||||
include : tagged 'serifYeriRB'
|
|
||||||
HSerif.rb right 0 (jut - [HSwToV : 0.5 * stroke]) stroke
|
|
||||||
include : tagged 'serifYeriRT'
|
|
||||||
HSerif.mt (right - [HSwToV : 0.5 * stroke]) top jut stroke
|
|
||||||
|
|
||||||
define [RevCyrYeriRoundShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
|
||||||
local bowl : top * pBar + HalfStroke
|
|
||||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
|
||||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
|
||||||
local adb : ArchDepthBOf ArchDepth (right - left + SB * 2)
|
|
||||||
local fine : stroke * CThinB
|
|
||||||
|
|
||||||
local yTurnBottomL : YSmoothMidL bowl 0 ada adb
|
|
||||||
local yTurnBottomR : YSmoothMidR bowl 0 ada adb
|
|
||||||
|
|
||||||
include : dispiro
|
|
||||||
flat right [Math.max yStart (yTurnBottomR + 0.1)] [widths.rhs.heading stroke Downward]
|
|
||||||
curl right yTurnBottomR
|
|
||||||
arcvh
|
|
||||||
g4 ([mix left right 0.5] + CorrectionOMidX * stroke) O
|
|
||||||
archv
|
|
||||||
g4 (left + OX) yTurnBottomL
|
|
||||||
arcvh
|
|
||||||
flat ([mix left right 0.5] - CorrectionOMidX * stroke) bowl
|
|
||||||
curl (right - Stroke * 0.2) bowl [heading Rightward]
|
|
||||||
|
|
||||||
define [CyrBackYerShape] : with-params [Yeri top left right [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
|
||||||
local xLeftBarLeftEdge : Math.max (right - (RightSB - SB)) : if SLAB
|
local xLeftBarLeftEdge : Math.max (right - (RightSB - SB)) : if SLAB
|
||||||
[mix left right 0.35] - [HSwToV : 0.50 * stroke]
|
[mix left right 0.35] - [HSwToV : 0.50 * stroke]
|
||||||
[mix left right 0.20] - [HSwToV : 0.25 * stroke]
|
[mix left right 0.20] - [HSwToV : 0.25 * stroke]
|
||||||
|
@ -151,7 +186,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
include : VSerif.dl xTopBarLeftEnd top VJut
|
include : VSerif.dl xTopBarLeftEnd top VJut
|
||||||
Math.min (VJutStroke * stroke / Stroke) (0.625 * (xLeftBarLeftEdge - xTopBarLeftEnd))
|
Math.min (VJutStroke * stroke / Stroke) (0.625 * (xLeftBarLeftEdge - xTopBarLeftEnd))
|
||||||
|
|
||||||
define [CyrNeutralYerShape] : with-params [Yeri top left right [stroke Stroke] [jut Jut]] : glyph-proc
|
define flex-params [CyrNeutralYerShape Yeri top left right [stroke Stroke] [jut Jut]] : glyph-proc
|
||||||
local xLeftBarLeftEdge : Math.max (right - (RightSB - SB)) : if SLAB
|
local xLeftBarLeftEdge : Math.max (right - (RightSB - SB)) : if SLAB
|
||||||
[mix left right 0.35] - [HSwToV : 0.50 * stroke]
|
[mix left right 0.35] - [HSwToV : 0.50 * stroke]
|
||||||
[mix left right 0.20] - [HSwToV : 0.25 * stroke]
|
[mix left right 0.20] - [HSwToV : 0.25 * stroke]
|
||||||
|
@ -190,13 +225,15 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
RightwardTailedBar df.rightSB 0 top sw
|
RightwardTailedBar df.rightSB 0 top sw
|
||||||
VBar.r df.rightSB 0 top sw
|
VBar.r df.rightSB 0 top sw
|
||||||
|
|
||||||
|
local useFullSerifs : Yeri === Yeri.UprightShape || Yeri === Yeri.AutoItalicShape && !para.isItalic
|
||||||
|
|
||||||
if SLAB : begin
|
if SLAB : begin
|
||||||
include : tagged 'serifRT' : if (Yeri !== CyrlYeriUprightShape)
|
include : tagged 'serifRT' : if useFullSerifs
|
||||||
then : glyph-proc
|
then : HSerif.mt (df.rightSB - [HSwToV : 0.5 * sw]) top jut sw
|
||||||
else : HSerif.mt (df.rightSB - [HSwToV : 0.5 * sw]) top jut sw
|
else : glyph-proc
|
||||||
if (!fTail) : include : tagged 'serifRB' : if (Yeri !== CyrlYeriUprightShape)
|
if (!fTail) : include : tagged 'serifRB' : if useFullSerifs
|
||||||
then : HSerif.rb df.rightSB 0 (jut - [HSwToV : 0.5 * sw]) sw
|
then : HSerif.mb (df.rightSB - [HSwToV : 0.5 * sw]) 0 jut sw
|
||||||
else : HSerif.mb (df.rightSB - [HSwToV : 0.5 * sw]) 0 jut sw
|
else : HSerif.rb df.rightSB 0 (jut - [HSwToV : 0.5 * sw]) sw
|
||||||
|
|
||||||
define [ZhuangToneSixShape Yeri top] : glyph-proc
|
define [ZhuangToneSixShape Yeri top] : glyph-proc
|
||||||
local xLeft : [mix SB RightSB 0.20] - [HSwToV : 0.125 * Stroke]
|
local xLeft : [mix SB RightSB 0.20] - [HSwToV : 0.125 * Stroke]
|
||||||
|
@ -208,17 +245,17 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
|
|
||||||
glyph-block-export YeriConfig
|
glyph-block-export YeriConfig
|
||||||
define YeriConfig : object
|
define YeriConfig : object
|
||||||
corner { CyrlYeriUprightShape }
|
corner { Yeri.UprightShape Yeri.AutoItalicShape }
|
||||||
round { CyrlYeriRoundShape }
|
round { Yeri.RoundShape Yeri.RoundShape }
|
||||||
cursive { CyrlYeriCursiveShape }
|
cursive { Yeri.CursiveShape Yeri.CursiveShape }
|
||||||
|
|
||||||
define YeryConfig : object
|
define YeryConfig : object
|
||||||
corner { CyrlYeriUprightShape false }
|
corner { Yeri.UprightShape Yeri.AutoItalicShape false }
|
||||||
round { CyrlYeriRoundShape false }
|
round { Yeri.RoundShape Yeri.RoundShape false }
|
||||||
cursive { CyrlYeriCursiveShape false }
|
cursive { Yeri.CursiveShape Yeri.CursiveShape false }
|
||||||
cornerTailed { CyrlYeriUprightShape true }
|
cornerTailed { Yeri.UprightShape Yeri.AutoItalicShape true }
|
||||||
roundTailed { CyrlYeriRoundShape true }
|
roundTailed { Yeri.RoundShape Yeri.RoundShape true }
|
||||||
cursiveTailed { CyrlYeriCursiveShape true }
|
cursiveTailed { Yeri.CursiveShape Yeri.CursiveShape true }
|
||||||
|
|
||||||
define [YeriOverlayBar df top] : begin
|
define [YeriOverlayBar df top] : begin
|
||||||
local stroke : AdviceStroke2 2 3 top
|
local stroke : AdviceStroke2 2 3 top
|
||||||
|
@ -227,69 +264,69 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
bot -- top * DefaultBarPos + stroke / 2
|
bot -- top * DefaultBarPos + stroke / 2
|
||||||
top -- top - [if SLAB Stroke 0]
|
top -- top - [if SLAB Stroke 0]
|
||||||
|
|
||||||
foreach { suffix { Yeri } } [Object.entries YeriConfig] : do
|
foreach { suffix { Uc Lc } } [Object.entries YeriConfig] : do
|
||||||
create-glyph "cyrl/Yeri.\(suffix)" : glyph-proc
|
create-glyph "cyrl/Yeri.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame 1
|
local df : include : DivFrame 1
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) CAP
|
include : Uc (left -- df.leftSB) (right -- df.rightSB) CAP
|
||||||
create-glyph "cyrl/yeri.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yeri.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame 1
|
local df : include : DivFrame 1
|
||||||
include : df.markSet.e
|
include : df.markSet.e
|
||||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) XH
|
include : Lc (left -- df.leftSB) (right -- df.rightSB) XH
|
||||||
create-glyph "cyrl/YeriBar.\(suffix)" : glyph-proc
|
create-glyph "cyrl/YeriBar.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame 1
|
local df : include : DivFrame 1
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) CAP
|
include : Uc (left -- df.leftSB) (right -- df.rightSB) CAP
|
||||||
include : YeriOverlayBar df CAP
|
include : YeriOverlayBar df CAP
|
||||||
create-glyph "cyrl/yeriBar.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yeriBar.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame 1
|
local df : include : DivFrame 1
|
||||||
include : df.markSet.e
|
include : df.markSet.e
|
||||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) XH
|
include : Lc (left -- df.leftSB) (right -- df.rightSB) XH
|
||||||
include : YeriOverlayBar df XH
|
include : YeriOverlayBar df XH
|
||||||
create-glyph "cyrl/Yer.\(suffix)" : glyph-proc
|
create-glyph "cyrl/Yer.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
include : CyrBackYerShape Yeri CAP (left -- df.leftSB) (right -- df.rightSB)
|
include : CyrBackYerShape Uc CAP (left -- df.leftSB) (right -- df.rightSB)
|
||||||
create-glyph "cyrl/yer.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yer.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||||
include : df.markSet.e
|
include : df.markSet.e
|
||||||
include : CyrBackYerShape Yeri XH (left -- df.leftSB) (right -- df.rightSB)
|
include : CyrBackYerShape Lc XH (left -- df.leftSB) (right -- df.rightSB)
|
||||||
create-glyph "cyrl/yerTall.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yerTall.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||||
include : df.markSet.b
|
include : df.markSet.b
|
||||||
include : CyrBackYerShape Yeri Ascender (left -- df.leftSB) (right -- df.rightSB) (pBar -- DefaultBarPos * XH / Ascender)
|
include : CyrBackYerShape Lc Ascender (left -- df.leftSB) (right -- df.rightSB) (pBar -- DefaultBarPos * XH / Ascender)
|
||||||
create-glyph "cyrl/YerNeutral.\(suffix)" : glyph-proc
|
create-glyph "cyrl/YerNeutral.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
include : CyrNeutralYerShape Yeri CAP (left -- df.leftSB) (right -- df.rightSB)
|
include : CyrNeutralYerShape Uc CAP (left -- df.leftSB) (right -- df.rightSB)
|
||||||
create-glyph "cyrl/yerNeutral.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yerNeutral.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||||
include : df.markSet.e
|
include : df.markSet.e
|
||||||
include : CyrNeutralYerShape Yeri XH (left -- df.leftSB) (right -- df.rightSB)
|
include : CyrNeutralYerShape Lc XH (left -- df.leftSB) (right -- df.rightSB)
|
||||||
create-glyph "ZhuangToneSix.\(suffix)" : glyph-proc
|
create-glyph "ZhuangToneSix.\(suffix)" : glyph-proc
|
||||||
include : MarkSet.capital
|
include : MarkSet.capital
|
||||||
include : ZhuangToneSixShape Yeri CAP
|
include : ZhuangToneSixShape Uc CAP
|
||||||
create-glyph "zhuangToneSix.\(suffix)" : glyph-proc
|
create-glyph "zhuangToneSix.\(suffix)" : glyph-proc
|
||||||
include : MarkSet.e
|
include : MarkSet.e
|
||||||
include : ZhuangToneSixShape Yeri XH
|
include : ZhuangToneSixShape Lc XH
|
||||||
|
|
||||||
foreach { suffix { Yeri fTail } } [Object.entries YeryConfig] : do
|
foreach { suffix { Uc Lc fTail } } [Object.entries YeryConfig] : do
|
||||||
create-glyph "cyrl/Yery.\(suffix)" : glyph-proc
|
create-glyph "cyrl/Yery.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
include : CyrYeryShape Yeri df CAP false fTail
|
include : CyrYeryShape Uc df CAP false fTail
|
||||||
create-glyph "cyrl/yery.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yery.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||||
include : df.markSet.e
|
include : df.markSet.e
|
||||||
include : CyrYeryShape Yeri df XH false fTail
|
include : CyrYeryShape Lc df XH false fTail
|
||||||
create-glyph "cyrl/YeryBack.\(suffix)" : glyph-proc
|
create-glyph "cyrl/YeryBack.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
include : CyrYeryShape Yeri df CAP true fTail
|
include : CyrYeryShape Uc df CAP true fTail
|
||||||
create-glyph "cyrl/yeryBack.\(suffix)" : glyph-proc
|
create-glyph "cyrl/yeryBack.\(suffix)" : glyph-proc
|
||||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||||
include : df.markSet.e
|
include : df.markSet.e
|
||||||
include : CyrYeryShape Yeri df XH true fTail
|
include : CyrYeryShape Lc df XH true fTail
|
||||||
|
|
||||||
select-variant 'cyrl/Yer' 0x42A
|
select-variant 'cyrl/Yer' 0x42A
|
||||||
select-variant 'cyrl/yer' 0x44A
|
select-variant 'cyrl/yer' 0x44A
|
||||||
|
@ -313,7 +350,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
|
|
||||||
create-glyph 'cyrl/Be' 0x411 : glyph-proc
|
create-glyph 'cyrl/Be' 0x411 : glyph-proc
|
||||||
include : MarkSet.capital
|
include : MarkSet.capital
|
||||||
include : CyrlYeriUprightShape CAP
|
include : Yeri.UprightShape CAP
|
||||||
include : HBar.m SB [mix SB RightSB 0.9] (CAP - HalfStroke)
|
include : HBar.m SB [mix SB RightSB 0.9] (CAP - HalfStroke)
|
||||||
if SLAB : begin
|
if SLAB : begin
|
||||||
include : VSerif.dr [mix SB RightSB 0.9] CAP VJut
|
include : VSerif.dr [mix SB RightSB 0.9] CAP VJut
|
||||||
|
@ -322,21 +359,21 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
||||||
|
|
||||||
create-glyph 'latn/De' 0x18B : glyph-proc
|
create-glyph 'latn/De' 0x18B : glyph-proc
|
||||||
include : MarkSet.capital
|
include : MarkSet.capital
|
||||||
include : RevCyrYeriShape CAP
|
include : RevYeri.Shape CAP
|
||||||
include : HBar.t [mix RightSB SB 0.9] (RightSB + O) CAP
|
include : HBar.t [mix RightSB SB 0.9] (RightSB + O) CAP
|
||||||
if SLAB : begin
|
if SLAB : begin
|
||||||
include : VSerif.dl [mix RightSB SB 0.9] CAP VJut
|
include : VSerif.dl [mix RightSB SB 0.9] CAP VJut
|
||||||
|
|
||||||
create-glyph 'cyrl/DeKomi' 0x500 : glyph-proc
|
create-glyph 'cyrl/DeKomi' 0x500 : glyph-proc
|
||||||
include : MarkSet.capital
|
include : MarkSet.capital
|
||||||
include : RevCyrYeriShape CAP
|
include : RevYeri.Shape CAP
|
||||||
|
|
||||||
create-glyph 'cyrl/DjeKomi' 0x502 : glyph-proc
|
create-glyph 'cyrl/DjeKomi' 0x502 : glyph-proc
|
||||||
local df : include : DivFrame para.diversityM 3
|
local df : include : DivFrame para.diversityM 3
|
||||||
include : df.markSet.capital
|
include : df.markSet.capital
|
||||||
|
|
||||||
local xm : df.middle + [HSwToV : 0.5 * df.mvs]
|
local xm : df.middle + [HSwToV : 0.5 * df.mvs]
|
||||||
include : RevCyrYeriRoundShape CAP df.leftSB xm df.mvs
|
include : RevYeri.RoundShape CAP df.leftSB xm df.mvs
|
||||||
include : UpwardHookShape
|
include : UpwardHookShape
|
||||||
left -- df.middle - [HSwToV : 0.5 * df.mvs]
|
left -- df.middle - [HSwToV : 0.5 * df.mvs]
|
||||||
right -- df.rightSB
|
right -- df.rightSB
|
||||||
|
|
|
@ -763,17 +763,16 @@ glyph-block Letter-Shared-Shapes : begin
|
||||||
return : new CSerifFrame this.top this.bot l1 r1 this.swRef this.swSerif this.div (r - l + 1)
|
return : new CSerifFrame this.top this.bot l1 r1 this.swRef this.swSerif this.div (r - l + 1)
|
||||||
|
|
||||||
glyph-block-export SerifFrame
|
glyph-block-export SerifFrame
|
||||||
define [SerifFrame] : begin
|
define flex-params [SerifFrame] : begin
|
||||||
postulate
|
local-parameter : top
|
||||||
top
|
local-parameter : bot
|
||||||
bot
|
local-parameter : left
|
||||||
left
|
local-parameter : right
|
||||||
right
|
local-parameter : swRef -- Stroke
|
||||||
swRef -- Stroke
|
local-parameter : swSerif -- swRef
|
||||||
swSerif -- swRef
|
local-parameter : div -- 1
|
||||||
div -- 1
|
local-parameter : hSplit -- 2
|
||||||
hSplit -- 2
|
local-parameter : fForceSymmetric -- false
|
||||||
fForceSymmetric -- false
|
|
||||||
return : new CSerifFrame top bot left right swRef swSerif div hSplit fForceSymmetric
|
return : new CSerifFrame top bot left right swRef swSerif div hSplit fForceSymmetric
|
||||||
|
|
||||||
define SerifFrame.fromDf : function [] : with-params [df top bot [swSerif df.mvs]] : begin
|
define SerifFrame.fromDf : function [] : with-params [df top bot [swSerif df.mvs]] : begin
|
||||||
|
|
|
@ -20,16 +20,15 @@ define-macro Just : begin
|
||||||
|
|
||||||
return m
|
return m
|
||||||
|
|
||||||
define-macro postulate : syntax-rules
|
define-macro $$InitFlexParameters$$ : syntax-rules
|
||||||
`[postulate @::$pairs] : begin
|
`[$$InitFlexParameters$$ @::$pairs] : begin
|
||||||
local ta : env.newt
|
|
||||||
local tb : env.newt
|
local tb : env.newt
|
||||||
local t : env.newt
|
local t : env.newt
|
||||||
|
|
||||||
local ps `[begin
|
local ps `[begin
|
||||||
[local @ta : {}.slice.call arguments 0]
|
[local $-flex-arguments : {}.slice.call arguments 0]
|
||||||
[local @tb {}]
|
[local @tb {}]
|
||||||
[for [local @t 0] (@t < @ta.length) [inc @t] : if [not : @ta.(@t) <@ $NamedParameterPair$] : @tb.push @ta.(@t)]
|
[for [local @t 0] (@t < $-flex-arguments.length) [inc @t] : if [not : $-flex-arguments.(@t) <@ $NamedParameterPair$] : @tb.push $-flex-arguments.(@t)]
|
||||||
]
|
]
|
||||||
|
|
||||||
local declarations `[begin]
|
local declarations `[begin]
|
||||||
|
@ -40,8 +39,6 @@ define-macro postulate : syntax-rules
|
||||||
local j 0
|
local j 0
|
||||||
foreach $pf [items-of $pairs] : begin
|
foreach $pf [items-of $pairs] : begin
|
||||||
local name
|
local name
|
||||||
local pf : formOf $pf
|
|
||||||
|
|
||||||
match [formOf $pf]
|
match [formOf $pf]
|
||||||
pf [atom pf] : begin
|
pf [atom pf] : begin
|
||||||
declarations.push `[local @pf]
|
declarations.push `[local @pf]
|
||||||
|
@ -59,25 +56,54 @@ define-macro postulate : syntax-rules
|
||||||
declarations.push `[local @decl]
|
declarations.push `[local @decl]
|
||||||
indexAssigns.push `[set @decl : fallback @decl (@tb).(@{".quote" j}) @dflt]
|
indexAssigns.push `[set @decl : fallback @decl (@tb).(@{".quote" j}) @dflt]
|
||||||
set name decl
|
set name decl
|
||||||
{".operatorPiece" decl '--' dflt} : begin
|
{".operatorPiece" :: items} : match [opSegToRegular items [scopeOf $pf]]
|
||||||
declarations.push `[local @decl]
|
`(@decl -- @dflt) : begin
|
||||||
indexAssigns.push `[set @decl : fallback @decl (@tb).(@{".quote" j}) @dflt]
|
declarations.push `[local @decl]
|
||||||
set name decl
|
indexAssigns.push `[set @decl : fallback @decl (@tb).(@{".quote" j}) @dflt]
|
||||||
true : throw : new Error "Invalid postulation syntax"
|
set name decl
|
||||||
|
____ : throw : new Error "Invalid postulation syntax"
|
||||||
|
____ : throw : new Error "Invalid postulation syntax"
|
||||||
|
|
||||||
namedAssigns.push `[if (@t && @t <@ $NamedParameterPair$ && @t.left == @{".quote" name})
|
namedAssigns.push `[if (@t && @t <@ $NamedParameterPair$ && @t.left == @{".quote" name})
|
||||||
[set @name @t.right]]
|
[set @name @t.right]]
|
||||||
inc j
|
inc j
|
||||||
|
|
||||||
ps.push declarations
|
ps.push declarations
|
||||||
ps.push `[foreach [@t : items-of @ta] @namedAssigns]
|
ps.push `[foreach [@t : items-of $-flex-arguments] @namedAssigns]
|
||||||
ps.push indexAssigns
|
ps.push indexAssigns
|
||||||
ps.push tearDowns
|
ps.push tearDowns
|
||||||
|
|
||||||
return : dirty ps
|
return : dirty ps
|
||||||
|
|
||||||
|
# TODO: replace this with the new [with-params]
|
||||||
define-macro with-params : syntax-rules
|
define-macro with-params : syntax-rules
|
||||||
`[with-params @_pairs @body] : dirty `[begin [postulate @::[formOf _pairs]] @[formOf body]]
|
`[with-params @_pairs @body] : dirty `[begin
|
||||||
|
[$$InitFlexParameters$$ @::[formOf _pairs]]
|
||||||
|
@[formOf body]
|
||||||
|
]
|
||||||
|
|
||||||
|
define-macro flex-params : syntax-rules
|
||||||
|
`[flex-params @_lam] : begin
|
||||||
|
local lam : formOf _lam
|
||||||
|
local lamArgs lam.1
|
||||||
|
local {lamBodyLeader :: lamBodyStatements} lam.2
|
||||||
|
|
||||||
|
local finalStatements {}
|
||||||
|
|
||||||
|
foreach stmt [items-of lamBodyStatements] : begin
|
||||||
|
if ([Array.isArray stmt] && stmt.0 == 'local-parameter')
|
||||||
|
: then : begin
|
||||||
|
lamArgs.push stmt.1
|
||||||
|
: else : begin
|
||||||
|
finalStatements.push stmt
|
||||||
|
|
||||||
|
return : dirty {'.lambda'
|
||||||
|
{}
|
||||||
|
`[begin
|
||||||
|
[$$InitFlexParameters$$ @::lamArgs]
|
||||||
|
@{lamBodyLeader :: finalStatements}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
### Necessary macros
|
### Necessary macros
|
||||||
# A glyph construction is a function which "modifies" a glyph.
|
# A glyph construction is a function which "modifies" a glyph.
|
||||||
|
|
|
@ -1171,7 +1171,7 @@ const CompiledJs = file.make(
|
||||||
p => p,
|
p => p,
|
||||||
async (target, out) => {
|
async (target, out) => {
|
||||||
const ptl = replaceExt(".ptl", out.full);
|
const ptl = replaceExt(".ptl", out.full);
|
||||||
if (/\/glyphs\//.test(out.full)) await target.need(MARCOS);
|
await target.need(MARCOS);
|
||||||
await target.need(sfu(ptl));
|
await target.need(sfu(ptl));
|
||||||
echo.action(echo.hl.command("Compile Script"), ptl);
|
echo.action(echo.hl.command("Compile Script"), ptl);
|
||||||
await silently.run(PATEL_C, "--strict", "--esm", ptl, "-o", out.full);
|
await silently.run(PATEL_C, "--strict", "--esm", ptl, "-o", out.full);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue