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

Consolidate Armenian LeftHook/RightHook functions to hook-group.ptl, misc cleanup. #2578

Merged
merged 4 commits into from
Nov 8, 2024
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
21 changes: 15 additions & 6 deletions packages/font-glyphs/src/letter/armenian/feh.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@ glyph-block Letter-Armenian-Feh : begin

define [FehBody df top bot ada adb] : glyph-proc
local midy : mix bot top HBarPos
local midyTop : midy + 0.5 * df.mvs
local midyBot : midy - 0.5 * df.mvs
include : dispiro
widths.lhs df.mvs
straight.left.start df.middle top
g4 df.leftSB [YSmoothMidR top (midy - 0.5 * df.mvs) ada adb]
straight.right.end df.middle (midy - 0.5 * df.mvs) [heading Rightward]
archv
flatside.ld df.leftSB midyBot top ada adb
arcvh
straight.right.end df.middle midyBot [heading Rightward]
include : dispiro
widths.rhs df.mvs
straight.right.start df.middle (midy + 0.5 * df.mvs) [heading Rightward]
flatside.rd df.rightSB 0 (midy + 0.5 * df.mvs) SmallArchDepthA SmallArchDepthB
straight.right.start df.middle midyTop [heading Rightward]
archv
flatside.rd df.rightSB 0 midyTop ada adb
hookend 0 (sw -- df.mvs)
g4 (df.leftSB + OX) Hook

create-glyph 'armn/Feh' 0x556 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.capital
include : FehBody df CAP 0 ArchDepthA ArchDepthB
local ada : df.archDepthA ArchDepth df.mvs
local adb : df.archDepthB ArchDepth df.mvs
include : FehBody df CAP 0 ada adb
include : VBar.m df.middle 0 CAP df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
Expand All @@ -36,7 +43,9 @@ glyph-block Letter-Armenian-Feh : begin
create-glyph 'armn/feh' 0x586 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : FehBody df Ascender 0 ArchDepthA ArchDepthB
local ada : df.archDepthA SmallArchDepth df.mvs
local adb : df.archDepthB SmallArchDepth df.mvs
include : FehBody df Ascender 0 ada adb
include : VBar.m df.middle Descender Ascender df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df Ascender Descender
Expand Down
68 changes: 58 additions & 10 deletions packages/font-glyphs/src/letter/armenian/hook-group.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,68 @@ glyph-block Letter-Armenian-Hook-Group : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : nShoulder uBowl SerifFrame
glyph-block-import Letter-Armenian-Shared-Shapes : ArmHBar LeftHook RightHook
glyph-block-import Letter-Armenian-Shared-Shapes : ArmHBar

define [RightHook df top bot sw _hook _ada _adb] : glyph-proc
local hook : fallback _hook Hook
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMid : if (top - bot > ada + adb) (top - ada) : mix top bot (ada / (ada + adb))
include : dispiro
widths.lhs df.mvs
g4 df.rightSB (top - hook)
hookstart top (sw -- sw)
flat df.leftSB yMid
curl df.leftSB bot [heading Downward]

define [LeftHook df top bot sw _hook _ada _adb] : glyph-proc
local hook : fallback _hook Hook
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMid : if (top - bot > ada + adb) (top - adb) : mix top bot (adb / (ada + adb))
include : dispiro
widths.rhs df.mvs
g4 df.leftSB (top - hook)
hookstart top (sw -- sw)
flat df.rightSB yMid
curl df.rightSB bot [heading Downward]

do "Ben"
create-glyph 'armn/Ben' 0x532 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : RightHook df CAP df.mvs SLAB 0
include : RightHook df CAP 0 df.mvs
include : [ArmHBar.normal df].mid
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.lb.full

do "Da"
create-glyph 'armn/Da' 0x534 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : LeftHook df CAP df.mvs SLAB 0
include : LeftHook df CAP 0 df.mvs
include : [ArmHBar.right df].mid
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.rb.full

do "Ech"
create-glyph 'armn/Ech' 0x535 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : LeftHook df CAP df.mvs SLAB 0
include : LeftHook df CAP 0 df.mvs
include : FlipAround df.middle (CAP / 2)
include : [ArmHBar.normal df].high
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.lt.full

do "Et"
create-glyph 'armn/Et' 0x538 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : RightHook df CAP df.mvs
include : RightHook df CAP 0 df.mvs
include : [ArmHBar.normal df].base
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
Expand Down Expand Up @@ -84,25 +117,34 @@ glyph-block Letter-Armenian-Hook-Group : begin
create-glyph 'armn/Ghat' 0x542 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : LeftHook df CAP df.mvs SLAB 0
include : LeftHook df CAP 0 df.mvs
include : [ArmHBar.right df].base
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.rb.full

do "Nu"
create-glyph 'armn/Nu' 0x546 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : LeftHook df CAP df.mvs SLAB 0
include : LeftHook df CAP 0 df.mvs
include : FlipAround df.middle (CAP / 2)
include : [ArmHBar.left df].cap
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.lt.full

do "Peh"
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 df.mvs SLAB 0 nothing nothing ada adb
include : LeftHook df CAP 0 df.mvs Hook ada adb
include : VBar.m df.middle (XH / 2) (CAP - 0.5 * df.mvs) df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.rb.full

do "Vew"
create-glyph 'armn/Vew' 0x54E : glyph-proc
Expand All @@ -128,13 +170,19 @@ glyph-block Letter-Armenian-Hook-Group : begin
create-glyph 'armn/Reh' 0x550 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : RightHook df CAP df.mvs SLAB 0
include : RightHook df CAP 0 df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.lb.full

do "Dram"
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay
create-glyph 'armn/Dram' 0x58F : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : LeftHook df CAP df.mvs SLAB 0
include : LeftHook df CAP 0 df.mvs
include : LetterBarOverlay.r df.rightSB (CAP * 0.37)
include : LetterBarOverlay.r df.rightSB (CAP * 0.60 - OverlayStroke * 0.25)
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.rb.full
19 changes: 10 additions & 9 deletions packages/font-glyphs/src/letter/armenian/lower-dza-cheh.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,31 @@ glyph-block Letter-Armenian-Lower-Dza-Cheh : begin
include : df.markSet.b
local x1 : mix df.leftSB df.rightSB 0.25
local x2 : mix df.leftSB df.rightSB 0.75
local y2 : Math.min (XH + 0.5 * SmallArchDepthA) : mix XH Ascender 0.5
local y2 : mix XH Ascender 0.5
include : dispiro
widths.center df.mvs
straight.down.start x1 Ascender
straight.down.start x1 Ascender [heading Downward]
arcvh
flat df.middle y2
curl x2 y2 [heading Rightward]

local stemFine : ShoulderFine * (df.mvs / Stroke)
local yMid : Math.max (y2 + 0.5 * df.mvs - 1.5 * SmallArchDepthA) (0 + SmallArchDepthB + TINY)
local fine : ShoulderFine * (df.mvs / Stroke)
define [knots] : list
straight.left.start x2 (y2 + 0.5 * df.mvs)
straight.left.start x2 (y2 + 0.5 * df.mvs) [heading Leftward]
archv
flat df.leftSB (XH - SmallArchDepthA)
flat df.leftSB yMid
curl df.leftSB (0 + SmallArchDepthB) [heading Downward]
include : dispiro
widths.lhs df.mvs
knots
OBarRight.arcEnd 0 df.leftSB df.rightSB df.mvs stemFine SmallArchDepthA SmallArchDepthB
OBarRight.arcEnd 0 df.leftSB df.rightSB df.mvs fine SmallArchDepthA SmallArchDepthB
include : intersection
spiro-outline
knots
corner df.leftSB 0
corner VERY-FAR 0
corner VERY-FAR Ascender
corner VERY-FAR (y2 + 0.5 * df.mvs)
dispiro
widths.rhs df.mvs
flat df.leftSB XH
Expand All @@ -61,15 +62,15 @@ glyph-block Letter-Armenian-Lower-Dza-Cheh : begin
local df : include : DivFrame 1
include : df.markSet.b
local x1 : mix df.leftSB df.rightSB 0.75
local stemFine : ShoulderFine * (df.mvs / Stroke)
local fine : ShoulderFine * (df.mvs / Stroke)
include : dispiro
widths.lhs df.mvs
flat x1 Ascender
curl df.middle Ascender [heading Leftward]
archv
flat df.leftSB (Ascender - SmallArchDepthA)
curl df.leftSB (0 + SmallArchDepthB) [heading Downward]
OBarRight.arcEnd 0 df.leftSB df.rightSB df.mvs stemFine SmallArchDepthA SmallArchDepthB
OBarRight.arcEnd 0 df.leftSB df.rightSB df.mvs fine SmallArchDepthA SmallArchDepthB
include : dispiro
widths.rhs df.mvs
flat (df.leftSB - jut + [HSwToV : 0.5 * df.mvs]) highBarPos
Expand Down
40 changes: 0 additions & 40 deletions packages/font-glyphs/src/letter/armenian/shared.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -51,46 +51,6 @@ glyph-block Letter-Armenian-Shared-Shapes : begin
set [ArmHBar.right df] : ArmHBar JUT-RIGHT df
set [ArmHBar.left df] : ArmHBar JUT-LEFT df

glyph-block-export RightHook
define [RightHook df top sw baseSerif hookSerif _base _hookY _ada _adb] : glyph-proc
local base : fallback _base 0
local hookY : fallback _hookY (top - Hook)
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMidDepth : if (top - base > ada + adb) ada ((top - base) * (ada / (ada + adb)))
include : dispiro
widths.lhs df.mvs
g4 df.rightSB hookY
hookstart top (sw -- sw)
flat df.leftSB (top - yMidDepth)
curl df.leftSB base [heading Downward]
if baseSerif : begin
local sf : SerifFrame.fromDf df top base
include sf.lb.full
if hookSerif : begin
local sf : SerifFrame.fromDf df top hookY
include sf.rb.full

glyph-block-export LeftHook
define [LeftHook df top sw baseSerif hookSerif _base _hookY _ada _adb] : glyph-proc
local base : fallback _base 0
local hookY : fallback _hookY (top - Hook)
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMidDepth : if (top - base > ada + adb) adb ((top - base) * (adb / (ada + adb)))
include : dispiro
widths.rhs df.mvs
g4 df.leftSB hookY
hookstart top (sw -- sw)
flat df.rightSB (top - yMidDepth)
curl df.rightSB base [heading Downward]
if baseSerif : begin
local sf : SerifFrame.fromDf df top base
include sf.rb.full
if hookSerif : begin
local sf : SerifFrame.fromDf df top hookY
include sf.lb.full

glyph-block-export TwoNeck
define [TwoNeck df top bot _left _right _adb _flatp] : begin
local adb : fallback _adb SmallArchDepthB
Expand Down
3 changes: 2 additions & 1 deletion packages/font-glyphs/src/letter/armenian/upper-co.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ glyph-block Letter-Armenian-Upper-Co : begin
include : dispiro
widths.rhs df.mvs
straight.right.start df.middle midyTop [heading Rightward]
flatside.rd df.rightSB 0 midyTop SmallArchDepthA SmallArchDepthB
archv
flatside.rd df.rightSB 0 midyTop ArchDepthA ArchDepthB
hookend 0 (sw -- df.mvs)
g4 (df.leftSB + OX) Hook
14 changes: 7 additions & 7 deletions packages/font-glyphs/src/letter/armenian/upper-dza-group.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ glyph-block Letter-Armenian-Upper-Dza : begin
hookstart CAP (sw -- df.mvs)
flat (df.rightSB - OX) (CAP - ArchDepthB)
curl (df.rightSB - OX) (CAP / 2)
CurlyTail.n df.mvs 0 df.leftSB df.rightSB 0 (yLoopTop -- (CAP - Hook) * 0.5)
CurlyTail.n df.mvs 0 df.leftSB df.rightSB 0 (yLoopTop -- ((CAP - Hook) / 2))

do "Sha"
create-glyph 'armn/Sha' 0x547 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
local fine : df.mvs * (ShoulderFine / Stroke)
local fine : ShoulderFine * (df.mvs / Stroke)
include : dispiro
widths.rhs df.mvs
curl df.leftSB CAP [heading Rightward]
Expand All @@ -45,22 +45,22 @@ glyph-block Letter-Armenian-Upper-Dza : begin
flat df.leftSB ArchDepthB
curl df.leftSB ([mix XH CAP 0.5] - ArchDepthA)
arcvh
flat df.middle [mix XH CAP 0.5] [widths.rhs fine]
g4 df.middle [mix XH CAP 0.5] [widths.rhs fine]

do "Cha"
create-glyph 'armn/Cha' 0x549 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
local fine : df.mvs * (ShoulderFine / Stroke)
local fine : ShoulderFine * (df.mvs / Stroke)
include : dispiro
widths.rhs df.mvs
g4 df.leftSB (CAP - Hook)
hookstart CAP (sw -- df.mvs)
flat df.rightSB (CAP - ArchDepthB)
curl df.rightSB ([mix (0.5 * XH) df.mvs 0.5] - fine + ArchDepthA)
curl df.rightSB ([mix (XH / 2) df.mvs 0.5] - fine + ArchDepthA)
arcvh
flat df.middle ([mix (0.5 * XH) df.mvs 0.5] - fine) [widths.rhs fine]
g4 df.middle ([mix (XH / 2) df.mvs 0.5] - fine) [widths.rhs fine]
include : dispiro
widths.rhs df.mvs
flat [mix df.leftSB df.rightSB 0.1] (0.5 * XH) [heading Rightward]
flat [mix df.leftSB df.rightSB 0.1] (XH / 2) [heading Rightward]
curl [mix df.leftSB df.rightSB 0.9] df.mvs [heading Rightward]
2 changes: 1 addition & 1 deletion packages/font-glyphs/src/letter/armenian/upper-ho.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ glyph-block Letter-Armenian-Upper-Ho : begin
curl df.middle CAP [heading Rightward]
archv
flatside.rd df.rightSB midyBot CAP ArchDepthA ArchDepthB
straight.left.end df.middle midyBot
straight.left.end df.middle midyBot [heading Leftward]

include : dispiro
widths.rhs df.mvs
Expand Down