Shape fixup

This commit is contained in:
be5invis 2023-09-29 18:27:26 -07:00
parent 8f957410e1
commit e69163cec8

View file

@ -10,45 +10,44 @@ glyph-block Digits-Five : begin
glyph-block-import Common-Derivatives
glyph-block-import Digits-Shared : OnumMarks ShiftDown CodeLnum CodeOnum
define [FiveFlatStroke top xleft t2 ycurly sw] : dispiro
define [FiveFlatStroke xLeft archTop pShapeHeight sw] : dispiro
widths.rhs sw
flat (xleft + [HSwToV sw]) t2
curl Middle t2
flat (xLeft + [HSwToV sw]) archTop
curl [Math.max (xLeft + 0.01) (Middle - CorrectionOMidX * sw)] archTop
archv
g4 (RightSB - OX) ycurly
g4 (RightSB - OX) [YSmoothMidR archTop 0 ArchDepthA ArchDepthB]
hookend O
g4 SB (Hook * top / CAP)
g4 SB (Hook * pShapeHeight)
define [FiveArcStroke top xleft t2 ycurly sw] : dispiro
define [FiveArcStroke xLeft archTop pShapeHeight sw] : dispiro
widths.rhs sw
g4 xleft (t2 - AHook * top / CAP)
hookstart (t2 - O)
g4 (RightSB - OX) ycurly
g4 xLeft (archTop - AHook * pShapeHeight)
hookstart (archTop - O)
g4 (RightSB - OX) [YSmoothMidR archTop 0 ArchDepthA ArchDepthB]
hookend O
g4 SB (Hook * top / CAP)
g4 SB (Hook * pShapeHeight)
define [FiveArcStrokeMask top xleft t2 ycurly sw] : spiro-outline
g4 (xleft + 1) (t2 - AHook * top / CAP)
hookstart (t2 - O - 1)
g4 (RightSB - OX - 1) ycurly
define [FiveArcStrokeMask xLeft archTop pShapeHeight sw] : spiro-outline
g4 (xLeft + 1) (archTop - AHook * pShapeHeight)
hookstart (archTop - O - 1)
g4 (RightSB - OX - 1) [YSmoothMidR archTop 0 ArchDepthA ArchDepthB]
hookend (O + 1)
g4 (SB + 1) (Hook * top / CAP)
g4 (SB + 1) (Hook * pShapeHeight)
define [FiveShape] : with-params [
top bp [sw Stroke] [bbd 0] [obl 0] [zt 0]
[bottomShape FiveArcStroke] [bottomMaskShape FiveArcStrokeMask]
top bp pBarPosSwAdj [sw Stroke] [bbd 0] [obl 0] [zt 0]
[bottomShape FiveArcStroke]
] : glyph-proc
local t1 : top * bp * 0.8
local t2 : top * bp
local ycurly : YSmoothMidR t2 0 ArchDepthA ArchDepthB
local xleft : [mix SB RightSB 0.025] + zt
local t1 : (top * bp + sw * pBarPosSwAdj) * 0.8
local t2 : (top * bp + sw * pBarPosSwAdj) * 1.0
local xLeft : [mix SB RightSB 0.025] + zt
local xright : [mix RightSB SB 0.05] - (OX - O)
local kGap : 0.144 - 0.1 * sw / t2
include : difference
glyph-proc
local fiveStroke : include : bottomShape top xleft t2 ycurly sw
local fiveStroke : include : bottomShape xLeft t2 (top / CAP) sw
local firstKnot fiveStroke.rhsKnots.0
local oblCor : Math.hypot 1 obl
@ -63,13 +62,9 @@ glyph-block Digits-Five : begin
flat xVBar firstKnot.y [widths.rhs.heading (oblCor * sw) Upward]
flat (xVBar + xVBarOffset) top [heading Upward]
if bbd : begin
local fiveStrokeMask : bottomMaskShape top xleft t2 ycurly sw
include : intersection fiveStrokeMask [VBar.r (RightSB - OX - bbd) 0 CAP sw]
include : difference
VBar.r (firstKnot.x + bbd) 0 CAP sw
begin fiveStrokeMask
Rect (t2 / 2) 0 0 Width
if bbd : let [mask : FiveArcStrokeMask xLeft t2 (top / CAP) sw] : begin
include : intersection mask [VBar.r (RightSB - OX - bbd) 0 CAP sw]
include : difference [VBar.r (firstKnot.x + bbd) 0 CAP sw] mask [Rect (t2 / 2) 0 0 Width]
Rect (t2 / 2 + t2 * kGap) (t2 / 2 - t2 * kGap) 0 Middle
@ -80,26 +75,26 @@ glyph-block Digits-Five : begin
"upright" 0
"oblique" (1 / 12)
object # middle
"arched" FiveArcStroke
"flat" FiveFlatStroke
"arched" { FiveArcStroke DesignParameters.fiveBarPos 0 }
"flat" { FiveFlatStroke (7 / 8 * DesignParameters.fiveBarPos) (1/3) }
foreach { suffix { obl bottomShape } } [pairs-of FiveConfig] : do
foreach { suffix { obl { bottomShape pBarPos pBarPosSwAdj } } } [pairs-of FiveConfig] : do
create-glyph "five.lnum.\(suffix)" : glyph-proc
include : MarkSet.capital
include : FiveShape CAP DesignParameters.fiveBarPos (bottomShape -- bottomShape) (obl -- obl)
include : FiveShape CAP pBarPos pBarPosSwAdj (bottomShape -- bottomShape) (obl -- obl)
create-glyph "five.onum.\(suffix)" : glyph-proc
include : OnumMarks.p
include : FiveShape CAP DesignParameters.fiveBarPos (bottomShape -- bottomShape) (obl -- obl)
include : FiveShape CAP pBarPos pBarPosSwAdj (bottomShape -- bottomShape) (obl -- obl)
include : ShiftDown
create-glyph "zhuangToneFive.\(suffix)" : glyph-proc
include : MarkSet.capital
include : FiveShape CAP DesignParameters.fiveBarPos (bottomShape -- bottomShape) (zt -- ((RightSB - SB) * 0.05))
include : FiveShape CAP pBarPos pBarPosSwAdj (bottomShape -- bottomShape) (zt -- ((RightSB - SB) * 0.05))
create-glyph "zhuangtonefive.\(suffix)" : glyph-proc
include : MarkSet.e
include : FiveShape XH DesignParameters.fiveBarPos (bottomShape -- bottomShape) (zt -- ((RightSB - SB) * 0.05))
include : FiveShape XH pBarPos pBarPosSwAdj (bottomShape -- bottomShape) (zt -- ((RightSB - SB) * 0.05))
select-variant 'five.lnum' [CodeLnum '5'] (follow -- 'five')
select-variant 'five.onum' [CodeOnum '5'] (follow -- 'five')
@ -109,4 +104,4 @@ glyph-block Digits-Five : begin
glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/five' 0x1D7DD : glyph-proc
include : MarkSet.capital
include : FiveShape CAP DesignParameters.fiveBarPos (sw -- BBS) (bbd -- BBD)
include : FiveShape CAP DesignParameters.fiveBarPos 0 (sw -- BBS) (bbd -- BBD)