Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make instances of [DivFrame] predefine their own ArchDepth{A|B} constants as attributes. #2645

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export : define Superscript : list
list 0x1DB3 'sRTail'
list 0x1DB4 'esh'
list 0x1DB5 'tLTail'
list 0x1DB6 'uLongBarOver'
list 0x1DB6 'uBar'
list 0x1DB7 'latn/upsilon'
list 0x1DB8 'smcpU'
list 0x1DB9 'vHookTop'
Expand Down
8 changes: 4 additions & 4 deletions packages/font-glyphs/src/letter/armenian/feh.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ glyph-block Letter-Armenian-Feh : begin
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
local sw : Math.min df.mvs : AdviceStroke2 3 3 CAP df.div
local ada : df.archDepthA ArchDepth sw
local adb : df.archDepthB ArchDepth sw
local ada : df.archDepthAOf ArchDepth sw
local adb : df.archDepthBOf ArchDepth sw
include : FehBody df CAP 0 sw Hook ada adb
include : VBar.m df.middle 0 CAP sw
if SLAB : begin
Expand All @@ -45,8 +45,8 @@ glyph-block Letter-Armenian-Feh : begin
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
local sw : Math.min df.mvs : AdviceStroke2 3 3 Ascender df.div
local ada : df.archDepthA SmallArchDepth sw
local adb : df.archDepthB SmallArchDepth sw
local ada : df.archDepthAOf SmallArchDepth sw
local adb : df.archDepthBOf SmallArchDepth sw
include : FehBody df Ascender 0 sw Hook ada adb
include : VBar.m df.middle Descender Ascender sw
if SLAB : begin
Expand Down
4 changes: 1 addition & 3 deletions packages/font-glyphs/src/letter/armenian/hook-group.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ glyph-block Letter-Armenian-Hook-Group : begin
create-glyph 'armn/Peh' 0x54A : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
local ada : df.archDepthA ArchDepth df.mvs
local adb : df.archDepthB ArchDepth df.mvs
include : LeftHook df CAP 0 df.mvs Hook ada adb
include : LeftHook df CAP 0 df.mvs Hook df.archDepthA df.archDepthB
include : VBar.m df.middle (XH / 2) (CAP - 0.5 * df.mvs) df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
Expand Down
6 changes: 3 additions & 3 deletions packages/font-glyphs/src/letter/armenian/upper-yi.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ glyph-block Letter-Armenian-Upper-Yi : begin
local df : include : DivFrame 1
include : df.markSet.capital
local ze : CyrZe 0 0 CAP 0
left -- df.leftSB
left -- df.leftSB
right -- df.rightSB
blend -- (1 + (2 * O) / (df.rightSB - df.leftSB))
hook -- Hook
op -- HBarPos
hook -- Hook
op -- HBarPos
include : ze.Shape
if SLAB : begin
local midy : mix 0 CAP HBarPos
Expand Down
6 changes: 3 additions & 3 deletions packages/font-glyphs/src/letter/cyrillic/de.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ glyph-block Letter-Cyrillic-De : begin
local sw : fallback _sw df.mvs

local yRingTop : Math.min (XH + O) (XH - QuarterStroke)
local ada : df.archDepthA (SmallArchDepth * yRingTop / XH)
local adb : df.archDepthB (SmallArchDepth * yRingTop / XH)
local ada : df.archDepthAOf : SmallArchDepth * yRingTop / XH
local adb : df.archDepthBOf : SmallArchDepth * yRingTop / XH

return : sink
widths.lhs ShoulderFine
straight.up.start (right - OX - [HSwToV (sw - ShoulderFine)]) (yRingTop - adb)
straight.up.start (right - OX - [HSwToV : sw - ShoulderFine]) (yRingTop - adb)
arch.lhs yRingTop (sw -- sw) (swBefore -- ShoulderFine)
flat (left + OX) (yRingTop - ada)
curl (left + OX) adb
Expand Down
7 changes: 4 additions & 3 deletions packages/font-glyphs/src/letter/cyrillic/lower-be.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ glyph-block Letter-Cyrillic-Lower-Be : begin
glyph-block-import Common-Derivatives

create-glyph 'cyrl/be' 0x431 : glyph-proc
include : MarkSet.b
local df : include : DivFrame 1
include : df.markSet.b

local yRingTop : Math.min (XH + O) (XH - QuarterStroke)
local ada : [DivFrame 1].archDepthA (SmallArchDepth * yRingTop / XH)
local adb : [DivFrame 1].archDepthB (SmallArchDepth * yRingTop / XH)
local ada : df.archDepthAOf : SmallArchDepth * yRingTop / XH
local adb : df.archDepthBOf : SmallArchDepth * yRingTop / XH

include : dispiro
widths.rhs ShoulderFine
Expand Down
14 changes: 6 additions & 8 deletions packages/font-glyphs/src/letter/cyrillic/multiocular-o.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ glyph-block Letter-Cyrillic-Multiocular-O : begin
local yTop : middleRowTop + pY * (Ascender - middleRowTop)
local xLeft : subDf.leftSB + (pX / 3) * (df.width - subDf.width)
local xRight : subDf.rightSB + (pX / 3) * (df.width - subDf.width)
local ada : subDf.archDepthA SmallArchDepth
local adb : subDf.archDepthB SmallArchDepth

local dotSpace : InnerDot.spaceOfDf subDf
local kHeight2 : [Math.sqrt ([InnerDot.spaceOfDf : DivFrame 1] / dotSpace)] * 1.5
local kHeight2 : [Math.sqrt : [InnerDot.spaceOfDf : DivFrame 1] / dotSpace] * 1.5

return : union
OShape.NoOvershoot yTop yBot xLeft xRight subDf.mvs ada adb
OShape.NoOvershoot yTop yBot xLeft xRight subDf.mvs subDf.smallArchDepthA subDf.smallArchDepthB
InnerDot [mix xLeft xRight 0.5] [mix yTop yBot 0.5] kHeight2 (DrawAt === DotAt) kdr dotSpace 5

include : SingleEye 0 0
include : SingleEye 1 0
include : SingleEye 2 0
include : SingleEye 3 0
include : SingleEye 0 0
include : SingleEye 1.0 0
include : SingleEye 2.0 0
include : SingleEye 3.0 0
include : SingleEye 0.5 (+1)
include : SingleEye 1.5 (+1)
include : SingleEye 2.5 (+1)
Expand Down
17 changes: 6 additions & 11 deletions packages/font-glyphs/src/letter/greek/phi.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@ glyph-block Letter-Greek-Phi : begin
glyph-block-import Letter-Shared-Shapes : FlatHookDepth DiagTail OBarLeft OBarRight

define [VarPhiRing fFlatTB df y2 y3] : glyph-proc
local ada : df.archDepthA ArchDepth df.mvs
local adb : df.archDepthB ArchDepth df.mvs
include : VBar.m df.middle y2 y3 df.mvs
include : if fFlatTB
OShapeFlatTB y3 y2 df.leftSB df.rightSB df.mvs ada adb
OShapeFlatTB y3 y2 df.leftSB df.rightSB df.mvs df.archDepthA df.archDepthB
Math.max (0.25 * (df.rightSB - df.leftSB)) : HSwToV df.mvs
OShape y3 y2 df.leftSB df.rightSB df.mvs ada adb
OShape y3 y2 df.leftSB df.rightSB df.mvs df.archDepthA df.archDepthB

define [CyrlEfSplitRing fFlatTB df y2 y3] : glyph-proc
local subDf : df.slice 3 2 OX
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs

include : VBar.m df.middle y2 y3 df.mvs
include : union
OBarRight.shape
Expand All @@ -33,16 +28,16 @@ glyph-block Letter-Greek-Phi : begin
left -- df.leftSB
right -- (df.middle + [HSwToV : 0.5 * df.mvs])
sw -- df.mvs
ada -- ada
adb -- adb
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB
OBarLeft.shape
top -- y3
bot -- y2
left -- (df.middle - [HSwToV : 0.5 * df.mvs])
right -- df.rightSB
sw -- df.mvs
ada -- ada
adb -- adb
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB

define [GrekLowerPhiCursiveRing fFlatTB df y2 y3] : glyph-proc
local l : df.leftSB + OX * 2
Expand Down
8 changes: 3 additions & 5 deletions packages/font-glyphs/src/letter/latin-ext/ezh.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,14 @@ glyph-block Letter-Latin-Ezh : begin
local df : include : DivFrame para.diversityM 1
include : df.markSet.p
local dfSub : DivFrame (0.75 * para.diversityM) 2
local ada : dfSub.archDepthA SmallArchDepth dfSub.mvs
local adb : dfSub.archDepthB SmallArchDepth dfSub.mvs
local [object yMidBar] : include : EzhShape dfSub XH Descender
isCursive -- isCursive
isSerifed -- isSerifed
sw -- dfSub.mvs
hook -- Hook
ada -- ada
adb -- adb
local y : [mix yMidBar Descender : pArc ada adb] - 0.5 * dfSub.mvs
ada -- dfSub.smallArchDepthA
adb -- dfSub.smallArchDepthB
local y : [mix yMidBar Descender : pArc dfSub.smallArchDepthA dfSub.smallArchDepthB] - 0.5 * dfSub.mvs
include : PalatalHook.r
x -- df.rightSB
y -- y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ glyph-block Letter-Latin-Flattened-Open-A : begin
local top : 0.5 * XH

local subDf : df.slice 3 2 OX
local ada : Math.min (top - TINY) : subDf.archDepthA SmallArchDepth df.mvs
local adb : Math.min (top - TINY) : subDf.archDepthB SmallArchDepth df.mvs
local ada : Math.min subDf.smallArchDepthA : top - TINY
local adb : Math.min subDf.smallArchDepthB : top - TINY

include : dispiro
widths.lhs df.mvs
Expand Down
36 changes: 12 additions & 24 deletions packages/font-glyphs/src/letter/latin-ext/lower-ae-oe.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
local { subDf shift } : SubDfAndShift pShift df OX
return : with-transform [ApparentTranslate shift 0]
OShape top 0 subDf.leftSB subDf.rightSB df.mvs
subDf.archDepthA ad df.mvs
subDf.archDepthB ad df.mvs
subDf.archDepthAOf ad df.mvs
subDf.archDepthBOf ad df.mvs

create-glyph 'oe/o' : glyph-proc
local df : include : DivFrame para.diversityMM 3
Expand Down Expand Up @@ -111,24 +111,20 @@ glyph-block Letter-Latin-Lower-AE-OE : begin

define [EShape pShift df body] : begin
local { subDf shift } : SubDfAndShift pShift df OX
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs
return : with-transform [ApparentTranslate shift 0]
body subDf XH
stroke -- df.mvs
ada -- ada
adb -- adb
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB

define [InvEShape pShift df revbody] : begin
local { subDf shift } : SubDfAndShift pShift df OX
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs
return : with-transform [ApparentTranslate shift 0]
with-transform [FlipAround subDf.middle (XH / 2)]
revbody subDf XH
stroke -- df.mvs
ada -- ada
adb -- adb
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB

define Config : object
flatCrossbar { SmallEShape RevSmallEShape }
Expand All @@ -152,9 +148,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin

define df : DivFrame para.diversityMM 3
define { subDf shift } : SubDfAndShift 1 df 0
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs
define sg : UShapeGroup ada adb
define sg : UShapeGroup subDf.smallArchDepthA subDf.smallArchDepthB

foreach { suffix { Base Slabs } } [Object.entries : SmallUConfigT sg] : do
create-glyph "ue/u.\(suffix)" : glyph-proc
Expand All @@ -173,7 +167,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
set-mark-anchor 'cvDecompose' 0 0
include : difference
Base subDf XH df.mvs
intersection [MaskLeft subDf.middle] [MaskAbove (XH - adb)]
intersection [MaskLeft subDf.middle] [MaskAbove (XH - subDf.smallArchDepthB)]
include : Slabs subDf XH
include : ApparentTranslate shift 0
eject-contour 'serifLT'
Expand All @@ -183,24 +177,18 @@ glyph-block Letter-Latin-Lower-AE-OE : begin

define [openOShape df sty styBot] : new-glyph : glyph-proc
local subDf : df.slice 3 2 OX
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs

local lf : CLetterForm subDf sty styBot XH 0
ada -- [subDf.archDepthA SmallArchDepth df.mvs]
adb -- [subDf.archDepthB SmallArchDepth df.mvs]
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB
sw -- df.mvs
include : lf.full
include : FlipAround (subDf.width / 2) (XH / 2)

define FLAT-CONNECTION 3
define [EsTeLeftShape subDf styBot] : new-glyph : glyph-proc
local ada : subDf.archDepthA SmallArchDepth subDf.mvs
local adb : subDf.archDepthB SmallArchDepth subDf.mvs

local lf : CLetterForm subDf FLAT-CONNECTION styBot XH 0
ada -- [subDf.archDepthA SmallArchDepth subDf.mvs]
adb -- [subDf.archDepthB SmallArchDepth subDf.mvs]
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB
sw -- subDf.mvs
include : lf.full

Expand Down
11 changes: 4 additions & 7 deletions packages/font-glyphs/src/letter/latin-ext/lower-db-qp.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ glyph-block Letter-Latin-Lower-DB-QP : begin

define [DbCenterShape df] : glyph-proc
local subDf : df.slice 3 2 OX
local ada : subDf.archDepthA SmallArchDepth df.mvs
local adb : subDf.archDepthB SmallArchDepth df.mvs

include : OBarRight.rounded
left -- df.leftSB
right -- (df.middle + [HSwToV : 0.5 * df.mvs])
yTerminal -- XH
sw -- df.mvs
ada -- ada
adb -- adb
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB
include : OBarLeft.rounded
left -- (df.middle - [HSwToV : 0.5 * df.mvs])
right -- df.rightSB
yTerminal -- (XH / 2)
sw -- df.mvs
ada -- ada
adb -- adb
ada -- subDf.smallArchDepthA
adb -- subDf.smallArchDepthB

create-glyph 'db' 0x238 : glyph-proc
local df : include : DivFrame para.diversityMM 3
Expand Down
4 changes: 2 additions & 2 deletions packages/font-glyphs/src/letter/latin-ext/thorn.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ glyph-block Letter-Latin-Thorn : begin
top -- (CAP - [if st Stroke 0])
bot -- (CAP - [yThornBowlBot CAP st])

create-glyph "ThornStrokeBot.\(suffix)" : glyph-proc
create-glyph "ThornStrokeBottom.\(suffix)" : glyph-proc
include [refer-glyph "Thorn.\(suffix)"] AS_BASE ALSO_METRICS
include : LetterBarOverlay.l.in
x -- xThornLeftStroke
Expand All @@ -78,7 +78,7 @@ glyph-block Letter-Latin-Thorn : begin

select-variant 'Thorn' 0xDE
select-variant 'ThornStroke' 0xA764 (follow -- 'Thorn')
select-variant 'ThornStrokeBot' 0xA766 (follow -- 'Thorn')
select-variant 'ThornStrokeBottom' 0xA766 (follow -- 'Thorn')

create-glyph 'grek/Sho' 0x3F7 : glyph-proc
include : MarkSet.capital
Expand Down
8 changes: 4 additions & 4 deletions packages/font-glyphs/src/letter/latin-ext/upper-ae-oe.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ glyph-block Letter-Latin-Upper-AE-OE : begin
corner eleft 0

define [AEAHalfRoundTop df top eleft sw] : glyph-proc
define ada : df.archDepthA ArchDepth sw
define adb : df.archDepthB ArchDepth sw
define ada : df.archDepthAOf ArchDepth sw
define adb : df.archDepthBOf ArchDepth sw

local yMidLeft : if (top > ada + adb) (top - ada) : mix top 0 (ada / (ada + adb))

Expand Down Expand Up @@ -217,8 +217,8 @@ glyph-block Letter-Latin-Upper-AE-OE : begin
define eleft : df.middle - [HSwToV : sw * [if SLAB (1 / 3) (1 / 4)]]
define swVJut : Math.min sw : (df.rightSB - eleft - [HSwToV sw]) * (4 / 5)

define ada : df.archDepthA ArchDepth sw
define adb : df.archDepthB ArchDepth sw
define ada : df.archDepthAOf ArchDepth sw
define adb : df.archDepthBOf ArchDepth sw

local xMidRight : df.rightSB - sw / 4
local yBar : top * eBarPos
Expand Down
4 changes: 2 additions & 2 deletions packages/font-glyphs/src/letter/latin/c.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ glyph-block Letter-Latin-C : begin
local desc : (-LongVJut) + QuarterStroke
include : ExtendBelowBaseAnchors desc
local lf : CLetterForm df sty styBot XH desc
ada -- [df.archDepthA SmallArchDepth Stroke]
adb -- [df.archDepthB SmallArchDepth Stroke]
ada -- [df.archDepthAOf SmallArchDepth Stroke]
adb -- [df.archDepthBOf SmallArchDepth Stroke]
include : lf.full

create-glyph "cHookTop.\(suffix)" : glyph-proc
Expand Down
Loading
Loading