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

Miscellaneous code cleanup. #2583

Merged
merged 4 commits into from
Nov 12, 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
6 changes: 3 additions & 3 deletions packages/font-glyphs/src/auto-build/transformed-jobs-data.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export : define Superscript : list
list 0x1D42 'W'
list 0x1D43 'a'
list 0x1D44 'turna'
list 0x1D45 'scripta'
list 0x1D45 'aScript'
list 0x1D46 'turnae'
list 0x1D47 'b'
list 0x1D48 'd'
Expand Down Expand Up @@ -72,7 +72,7 @@ export : define Superscript : list
list 0x1D60 'grek/phi'
list 0x1D61 'grek/chi'
list 0x1D78 'cyrl/en'
list 0x1D9B 'turnscripta'
list 0x1D9B 'turnaScript'
list 0x1D9C 'c'
list 0x1D9D 'cCurlyTail'
list 0x1D9E 'eth'
Expand Down Expand Up @@ -368,7 +368,7 @@ export : define MedievalComb_e : list
list 0x1DE3 'rRotunda'
list 0x1DE4 's'
list 0x1DE6 'z'
list 0x1DE7 'scripta'
list 0x1DE7 'aScript'
list 0x1DEA 'schwa'
list 0x1DED 'oWithLightCentralizationStroke'
list 0x1DF0 'uWithLightCentralizationStroke'
Expand Down
36 changes: 19 additions & 17 deletions packages/font-glyphs/src/letter/armenian/feh.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,45 @@ glyph-block Letter-Armenian-Feh : begin
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifFrame

define [FehBody df top bot ada adb] : glyph-proc
define [FehBody df top bot sw hook ada adb] : glyph-proc
local midy : mix bot top HBarPos
local midyTop : midy + 0.5 * df.mvs
local midyBot : midy - 0.5 * df.mvs
local midyTop : midy + 0.5 * sw
local midyBot : midy - 0.5 * sw
include : dispiro
widths.lhs df.mvs
widths.lhs sw
straight.left.start df.middle top
archv
flatside.ld df.leftSB midyBot top ada adb
arcvh
straight.right.end df.middle midyBot [heading Rightward]
include : dispiro
widths.rhs df.mvs
widths.rhs sw
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
hookend 0 (sw -- sw)
g4 (df.leftSB + OX) (0 + hook)

create-glyph 'armn/Feh' 0x556 : 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 : FehBody df CAP 0 ada adb
include : VBar.m df.middle 0 CAP df.mvs
local sw : Math.min df.mvs : AdviceStroke2 3 3 CAP df.div
local ada : df.archDepthA ArchDepth sw
local adb : df.archDepthB ArchDepth sw
include : FehBody df CAP 0 sw Hook ada adb
include : VBar.m df.middle 0 CAP sw
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
local sf : SerifFrame.fromDf df CAP 0 (swSerif -- sw)
include sf.mt.right

create-glyph 'armn/feh' 0x586 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
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
local sw : Math.min df.mvs : AdviceStroke2 3 3 Ascender df.div
local ada : df.archDepthA SmallArchDepth sw
local adb : df.archDepthB SmallArchDepth sw
include : FehBody df Ascender 0 sw Hook ada adb
include : VBar.m df.middle Descender Ascender sw
if SLAB : begin
local sf : SerifFrame.fromDf df Ascender Descender
local sf : SerifFrame.fromDf df Ascender Descender (swSerif -- sw)
include sf.mb.full
10 changes: 6 additions & 4 deletions packages/font-glyphs/src/letter/armenian/hook-group.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ glyph-block Letter-Armenian-Hook-Group : begin
glyph-block-import Letter-Shared-Shapes : nShoulder uBowl SerifFrame
glyph-block-import Letter-Armenian-Shared-Shapes : ArmHBar

define [RightHook df top bot sw _hook _ada _adb] : glyph-proc
define [RightHook df top bot _sw _hook _ada _adb] : glyph-proc
local sw : fallback _sw df.mvs
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
widths.lhs sw
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
define [LeftHook df top bot _sw _hook _ada _adb] : glyph-proc
local sw : fallback _sw df.mvs
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
widths.rhs sw
g4 df.leftSB (top - hook)
hookstart top (sw -- sw)
flat df.rightSB yMid
Expand Down
8 changes: 3 additions & 5 deletions packages/font-glyphs/src/letter/armenian/lower-u-group.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
include : VBar.l df.leftSB 0 XH df.mvs

# Combination of nShoulder.knots and the straight 2 shape
local fine : df.mvs * (ShoulderFine / Stroke)
local fine : ShoulderFine * (df.mvs / Stroke)
local left : Math.max (df.rightSB - [HSwToV df.mvs] - jut) df.middle
include : dispiro
widths.rhs fine
Expand All @@ -291,8 +291,7 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
if SLAB : begin
local sf : SerifFrame.fromDf df XH 0
include sf.lt.outer
if [not para.isItalic] : begin
include : composite-proc sf.lb.outer
if [not para.isItalic] : include sf.lb.outer

# Alternate straight 'n' form
# include : nShoulder.shape
Expand All @@ -305,8 +304,7 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
# if SLAB : begin
# local sf : SerifFrame.fromDf df XH 0
# include sf.lt.outer
# if [not para.isItalic] : begin
# include : composite-proc sf.lb.full
# if [not para.isItalic] : include sf.lb.full

do "Seh"
create-glyph 'armn/seh' 0x57D : glyph-proc
Expand Down
27 changes: 14 additions & 13 deletions packages/font-glyphs/src/letter/armenian/shared.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ glyph-block Letter-Armenian-Shared-Shapes : begin
define highBarPos XH
define jut Jut

define JUT-NORMAL 0
define JUT-SHORT 1
define JUT-RIGHT 2
define JUT-LEFT 3
define JUT : object
NORMAL 0
SHORT 1
RIGHT 2
LEFT 3

glyph-block-export ArmHBar
define [ArmHBar hPos df] : namespace
define left : match hPos
[Just JUT-RIGHT] df.rightSB
[Just JUT-LEFT] (df.leftSB - (jut * [if SLAB 1.5 1]) + [HSwToV : 0.5 * df.mvs])
[Just JUT.RIGHT] df.rightSB
[Just JUT.LEFT] (df.leftSB - (jut * [if SLAB 1.5 1]) + [HSwToV : 0.5 * df.mvs])
-- df.leftSB
define right : match hPos
[Just JUT-RIGHT] (df.rightSB + (jut * [if SLAB 1.5 1]) - [HSwToV : 0.5 * df.mvs])
[Just JUT-SHORT] (df.rightSB - (jut - [HSwToV : 0.5 * df.mvs]) * df.div)
[Just JUT-LEFT] df.leftSB
[Just JUT.RIGHT] (df.rightSB + (jut * [if SLAB 1.5 1]) - [HSwToV : 0.5 * df.mvs])
[Just JUT.SHORT] (df.rightSB - (jut - [HSwToV : 0.5 * df.mvs]) * df.div)
[Just JUT.LEFT] df.leftSB
-- df.rightSB

export : define [cap] : glyph-proc
Expand All @@ -46,10 +47,10 @@ glyph-block Letter-Armenian-Shared-Shapes : begin
export : define [at y] : glyph-proc
include : HBar.m left right y df.mvs

set [ArmHBar.normal df] : ArmHBar JUT-NORMAL df
set [ArmHBar.short df] : ArmHBar JUT-SHORT df
set [ArmHBar.right df] : ArmHBar JUT-RIGHT df
set [ArmHBar.left df] : ArmHBar JUT-LEFT df
set [ArmHBar.normal df] : ArmHBar JUT.NORMAL df
set [ArmHBar.short df] : ArmHBar JUT.SHORT df
set [ArmHBar.right df] : ArmHBar JUT.RIGHT df
set [ArmHBar.left df] : ArmHBar JUT.LEFT df

glyph-block-export TwoNeck
define [TwoNeck df top bot _left _right _adb _flatp] : begin
Expand Down
1 change: 1 addition & 0 deletions packages/font-glyphs/src/letter/armenian/upper-ho.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ glyph-block Letter-Armenian-Upper-Ho : begin
curl df.middle CAP [heading Rightward]
archv
flatside.rd df.rightSB midyBot CAP ArchDepthA ArchDepthB
arcvh
straight.left.end df.middle midyBot [heading Leftward]

include : dispiro
Expand Down
5 changes: 3 additions & 2 deletions packages/font-glyphs/src/letter/armenian/upper-yi.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ glyph-block Letter-Armenian-Upper-Yi : begin
local ze : CyrZe 0 0 CAP 0
left -- df.leftSB
right -- df.rightSB
blend -- (1 + 2 * O / (df.rightSB - df.leftSB))
blend -- (1 + (2 * O) / (df.rightSB - df.leftSB))
hook -- Hook
op -- HBarPos
include : ze.Shape
if SLAB : begin
local midy : mix 0 CAP OverlayPos
local midy : mix 0 CAP HBarPos
local vJut : Math.min VJut : CAP - 2 * Hook - df.mvs
include : VBar.l (df.leftSB - 2 * O) (midy - 0.5 * vJut) (midy + 0.5 * vJut) df.mvs
2 changes: 1 addition & 1 deletion packages/font-glyphs/src/letter/cyrillic/orthography.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ glyph-block Letter-Cyrillic-Orthography : begin
link-gr LocalizedForm.SRB.Italic 'cyrl/te/reduced' 'cyrl/te/reduced.SRB'

link-gr LocalizedForm.BGR 'cyrl/ve' 'cyrl/ve.BGR'
link-gr LocalizedForm.BGR 'cyrl/ghe' 'cyrl/ghe.italic'
link-gr LocalizedForm.BGR 'cyrl/ghe' 'cyrl/ghe.BGR'
link-gr LocalizedForm.BGR 'cyrl/De' 'cyrl/De.BGR'
link-gr LocalizedForm.BGR 'cyrl/de' 'cyrl/de.BGR'
link-gr LocalizedForm.BGR 'cyrl/zhe' 'cyrl/zhe.BGR'
Expand Down
4 changes: 2 additions & 2 deletions packages/font-glyphs/src/letter/cyrillic/yeri.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
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]
local trShrink : Math.sqrt : (right - left) / (RightSB - SB)
include : dispiro
widths.rhs stroke
flat (right - Stroke * 0.2) 0 [heading Leftward]
Expand Down Expand Up @@ -215,7 +215,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
define [CyrYeryShape LeftHalf df top fBackYer fTail] : glyph-proc
local sw : if fBackYer [AdviceStroke 3.25 df.div] df.mvs

local jut : Math.min Jut : [Math.pow (sw / Stroke) 0.5] * Jut
local jut : Math.min Jut : [Math.sqrt : sw / Stroke] * Jut
local xm : mix (df.rightSB - [HSwToV sw]) (df.middle + [HSwToV : 0.5 * sw]) 0.75

include : if fBackYer
Expand Down
16 changes: 9 additions & 7 deletions packages/font-glyphs/src/letter/greek/phi.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ glyph-block Letter-Greek-Phi : begin
glyph-block-import Letter-Latin-Lower-AE-OE : SubDfAndShift

define [VarPhiRing fFlatTB df y2 y3] : glyph-proc
local gap : Math.max (0.25 * (df.rightSB - df.leftSB)) : HSwToV df.mvs
include : VBar.m df.middle y2 y3 df.mvs
include : if fFlatTB
OShapeFlatTB y3 y2 df.leftSB df.rightSB df.mvs (ArchDepthA * df.div) (ArchDepthB * df.div) gap
OShapeFlatTB y3 y2 df.leftSB df.rightSB df.mvs (ArchDepthA * df.div) (ArchDepthB * df.div)
Math.max (0.25 * (df.rightSB - df.leftSB)) : HSwToV df.mvs
OShape y3 y2 df.leftSB df.rightSB df.mvs (ArchDepthA * df.div) (ArchDepthB * df.div)

define [CyrlEfSplitRing fFlatTB df y2 y3] : glyph-proc
Expand All @@ -25,17 +25,19 @@ glyph-block Letter-Greek-Phi : begin
local adb : subDf.archDepthB SmallArchDepth df.mvs

include : VBar.m df.middle y2 y3 df.mvs
include : with-transform [ApparentTranslate 0 y2] : union
include : union
OBarRight.shape
top -- (y3 - y2)
top -- y3
bot -- y2
left -- df.leftSB
right -- df.middle + [HSwToV : 0.5 * df.mvs]
right -- (df.middle + [HSwToV : 0.5 * df.mvs])
sw -- df.mvs
ada -- ada
adb -- adb
OBarLeft.shape
top -- (y3 - y2)
left -- df.middle - [HSwToV : 0.5 * df.mvs]
top -- y3
bot -- y2
left -- (df.middle - [HSwToV : 0.5 * df.mvs])
right -- df.rightSB
sw -- df.mvs
ada -- ada
Expand Down
18 changes: 9 additions & 9 deletions packages/font-glyphs/src/letter/latin/lower-a.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ glyph-block Letter-Latin-Lower-A : begin
create-glyph "a.\(suffix)" : glyph-proc
include : MarkSet.e
include : body [DivFrame 1] XH bar no-shape
create-glyph "largescripta.\(suffix)" : glyph-proc
create-glyph "AScript.\(suffix)" : glyph-proc
include : MarkSet.capital
include : body [DivFrame 1] CAP bar SingleStorey.ScriptCut
create-glyph "scripta.\(suffix)" : glyph-proc
create-glyph "aScript.\(suffix)" : glyph-proc
include : MarkSet.e
include : body [DivFrame 1] XH bar SingleStorey.ScriptCut
create-glyph "invscripta.\(suffix)" : glyph-proc
create-glyph "invaScript.\(suffix)" : glyph-proc
include : MarkSet.e
include : body [DivFrame 1] XH bar.inv SingleStorey.InvScriptCut

Expand All @@ -275,15 +275,15 @@ glyph-block Letter-Latin-Lower-A : begin
derive-composites 'aRetroflexHook' 0x1D8F 'a/rtailBase'
RetroflexHook.rSideJut RightSB 0 (yOverflow -- Stroke)

select-variant 'scripta' 0x251 (follow -- [conditional-follow SLAB 'scripta/autoSerifed/slab' 'scripta/autoSerifed/sans'])
select-variant 'largescripta' 0x2C6D (follow -- [conditional-follow SLAB 'scripta/autoSerifed/slab' 'scripta/autoSerifed/sans'])
select-variant 'invscripta' 0xAB64 (follow -- [conditional-follow SLAB 'scripta/autoSerifed/slab' 'scripta/autoSerifed/sans'])
select-variant 'aScript' 0x251 (follow -- [conditional-follow SLAB 'aScript/autoSerifed/slab' 'aScript/autoSerifed/sans'])
select-variant 'AScript' 0x2C6D (follow -- [conditional-follow SLAB 'aScript/autoSerifed/slab' 'aScript/autoSerifed/sans'])
select-variant 'invaScript' 0xAB64 (follow -- [conditional-follow SLAB 'aScript/autoSerifed/slab' 'aScript/autoSerifed/sans'])

derive-composites 'scriptaRetroflexHook' 0x1D90 'scripta.singleStoreySerifless'
derive-composites 'aScriptRetroflexHook' 0x1D90 'aScript.singleStoreySerifless'
RetroflexHook.rSideJut RightSB 0 (yOverflow -- Stroke)

CreateTurnedLetter 'turnscripta' 0x252 'scripta' HalfAdvance (XH / 2)
CreateTurnedLetter 'turnlargescripta' 0x2C70 'largescripta' HalfAdvance (CAP / 2)
CreateTurnedLetter 'turnaScript' 0x252 'aScript' HalfAdvance (XH / 2)
CreateTurnedLetter 'turnAScript' 0x2C70 'AScript' HalfAdvance (CAP / 2)

CreateAccentedComposition 'aDieresis' 0xE4 'a' 'dieresisAbove'
CreateAccentedComposition 'aSbRsbUnderlineBelow' null 'a' 'sbRsbUnderlineBelow'
Expand Down
4 changes: 2 additions & 2 deletions packages/font-glyphs/src/letter/latin/lower-g.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ glyph-block Letter-Latin-Lower-G : begin
include : bodyShape df CAP
include : hookShape df (CAP - hookStart)

create-glyph "gScriptPalatalHook.\(suffix)" : glyph-proc
create-glyph "gPalatalHook.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 1
include : df.markSet.p
set-base-anchor 'overlay' Middle (XH / 2)
Expand All @@ -198,7 +198,7 @@ glyph-block Letter-Latin-Lower-G : begin

select-variant 'gScript' 0x261 (shapeFrom -- 'g') (follow -- 'gScript')
select-variant 'GScript' 0xA7AC (follow -- 'gScript')
select-variant 'gScriptPalatalHook' 0x1D83 (follow -- 'gScript')
select-variant 'gScriptPalatalHook' 0x1D83 (shapeFrom -- 'gPalatalHook') (follow -- 'gScript')

select-variant 'cyrl/de.BGR' (shapeFrom -- 'g') (follow -- [conditional-follow SLAB 'g/singleStorey/autoSerifed/slab' 'g/singleStorey/autoSerifed/sans'])
alias 'cyrl/de.SRB' null 'cyrl/de.BGR'
Expand Down
Loading
Loading