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

Reduce/Eliminate remaning variant behavior of Armenian lookalike letters. #2565

Merged
merged 5 commits into from
Oct 29, 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
7 changes: 1 addition & 6 deletions packages/font-glyphs/src/letter/armenian/aliases.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ glyph-block Letter-Armenian-Aliases : begin
alias 'armn/Tiun' 0x54F 'S.serifless'
alias 'armn/Piur' 0x553 'grek/Phi'
alias 'armn/Oh' 0x555 'O'
alias 'armn/aybTurned' 0x560 'm'
alias 'armn/ayb' 0x561 'turnm'
alias 'armn/ho' 0x570 'h'
alias 'armn/yi' 0x575 'dotlessj.flatHook'
alias 'armn/vo' 0x578 'n'
alias 'armn/seh' 0x57D 'u'
alias 'armn/co' 0x581 'cyrl/de.BGR'
alias 'armn/co' 0x581 'g.singleStorey'
alias 'armn/oh' 0x585 'o'
alias 'armn/yiBar' 0x588 'dotlessjBar.flatHook'
37 changes: 24 additions & 13 deletions packages/font-glyphs/src/letter/armenian/lower-q-group.ptl
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
$$include '../../meta/macros.ptl'

import [mix linreg clamp fallback SuffixCfg] from "@iosevka/util"
import [mix linreg clamp fallback] from "@iosevka/util"
import [DependentSelector] from "@iosevka/glyph/relation"

glyph-module

glyph-block Letter-Armenian-Lower-Q-Group : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifFrame
glyph-block-import Letter-Shared-Shapes : SerifFrame OBarRight
glyph-block-import Letter-Armenian-Shared-Shapes : ArmHBar
glyph-block-import Letter-Latin-Lower-Q : QConfig

foreach { suffix { Body {terminal fTail} {sRT sRB} } } [Object.entries QConfig] : if [not fTail] : do
create-glyph "armn/gim.\(suffix)" : glyph-proc
include [refer-glyph "q.\(suffix)"] AS_BASE ALSO_METRICS
include : [ArmHBar.right [DivFrame 1] 0].base
do "Gim"
create-glyph 'armn/gim' 0x563 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.p
include : OBarRight.shape (top -- XH)
include : VBar.r df.rightSB Descender XH
include : [ArmHBar.right df 0].base
if SLAB : begin
local sf : SerifFrame.fromDf df XH Descender
include sf.rb.fullSide
if [not para.isItalic] : begin
include sf.rt.outer

if [not sRB] : create-glyph "armn/za.\(suffix)" : glyph-proc
include [refer-glyph "q.\(suffix)"] AS_BASE ALSO_METRICS
include : [ArmHBar.right [DivFrame 1] 0].desc

select-variant 'armn/gim' 0x563 (follow -- 'q/tailless')
select-variant 'armn/za' 0x566 (follow -- 'qRTail')
do "Za"
create-glyph 'armn/za' 0x566 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.p
include : OBarRight.shape (top -- XH)
include : VBar.r df.rightSB Descender XH
include : [ArmHBar.right df 0].desc
if (SLAB && [not para.isItalic]) : begin
local sf : SerifFrame.fromDf df XH Descender
include sf.rt.outer
80 changes: 78 additions & 2 deletions packages/font-glyphs/src/letter/armenian/lower-u-group.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,38 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
glyph-block-import Letter-Shared-Shapes : SerifFrame
glyph-block-import Letter-Armenian-Shared-Shapes : ArmHBar TwoNeck
glyph-block-import Letter-Latin-U : USerifs
glyph-block-import Letter-Latin-Lower-M : SmallMArches

# Common Params
define barPos : XH / 2
define highBarPos XH
define jut Jut

do "Turned Ayb"
create-glyph 'armn/aybTurned' 0x560 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
include : SmallMArches df XH 0 0 0
if SLAB : begin
local sf : SerifFrame.fromDf df XH 0
include : if para.isItalic
composite-proc sf.lt.outer sf.rb.outer
if sf.enoughSpaceForFullSerifs
composite-proc sf.lt.outer sf.lb.full sf.mb.full sf.rb.full
composite-proc sf.lt.outer sf.lb.outer sf.rb.outer

do "Ayb"
create-glyph 'armn/ayb' 0x561 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e
include : SmallMArches df XH 0 0 0
include : FlipAround df.middle (XH / 2)
if SLAB : begin
local sf : SerifFrame.fromDf df XH 0
include : if ([not para.isItalic] && sf.enoughSpaceForFullSerifs)
composite-proc sf.lt.outer sf.mt.left sf.rt.inner sf.rb.outer
composite-proc sf.lt.outer sf.rb.outer

do "Ben"
create-glyph 'armn/ben' 0x562 : glyph-proc
local df : include : DivFrame 1
Expand Down Expand Up @@ -155,6 +181,23 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
include sf2.rb.fullSide
include : composite-proc sf2.rt.inner sf2.rb.fullSide

do "Ho"
create-glyph 'armn/ho' 0x570 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.b
include : VBar.l df.leftSB 0 Ascender df.mvs
include : nShoulder
left -- (df.leftSB + [HSwToV df.mvs])
right -- df.rightSB
top -- XH
bottom -- 0
stroke -- df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df Ascender 0
include : if para.isItalic
composite-proc sf.lt.outer sf.rb.outer
composite-proc sf.lt.outer sf.lb.full sf.rb.full

do "Ghat"
create-glyph 'armn/ghat' 0x572 : glyph-proc
local df : include : DivFrame 1
Expand Down Expand Up @@ -208,9 +251,24 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
include sf.rb.outer
if [not para.isItalic] : include sf.rt.inner

do "Peh"
glyph-block-import Letter-Latin-Lower-M : SmallMArches
do "Vo"
create-glyph 'armn/vo' 0x578 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.e
include : VBar.l df.leftSB 0 XH df.mvs
include : nShoulder
left -- (df.leftSB + [HSwToV df.mvs])
right -- df.rightSB
top -- XH
bottom -- 0
stroke -- df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df XH 0
include : if para.isItalic
composite-proc sf.lt.outer sf.rb.outer
composite-proc sf.lt.outer sf.lb.full sf.rb.full

do "Peh"
create-glyph 'armn/peh' 0x57A : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
Expand Down Expand Up @@ -259,6 +317,24 @@ glyph-block Letter-Armenian-Lower-U-Group : begin
# if [not para.isItalic] : begin
# include : composite-proc sf.lb.full

do "Seh"
create-glyph 'armn/seh' 0x57D : glyph-proc
local df : include : DivFrame 1
include : df.markSet.e
include : nShoulder
top -- 0
bottom -- (-XH)
left -- (df.leftSB + [HSwToV df.mvs])
right -- df.rightSB
stroke -- df.mvs
include : FlipAround df.middle 0
include : VBar.r df.rightSB 0 XH df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df XH 0
include : if para.isItalic
composite-proc sf.lt.outer sf.rb.outer
composite-proc sf.lt.outer sf.rt.inner sf.rb.outer

do "Vew"
create-glyph 'armn/vew' 0x57E : glyph-proc
local df : include : DivFrame 1
Expand Down
4 changes: 2 additions & 2 deletions packages/font-glyphs/src/letter/armenian/shared.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ glyph-block Letter-Armenian-Shared-Shapes : begin
local hookY : fallback _hookY (top - Hook)
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMidDepth : if (top > ada + adb) ada (top * (ada / (ada + adb)))
local yMidDepth : if (top - base > ada + adb) ada ((top - base) * (ada / (ada + adb)))
include : dispiro
widths.lhs df.mvs
g4 df.rightSB hookY
Expand All @@ -75,7 +75,7 @@ glyph-block Letter-Armenian-Shared-Shapes : begin
local hookY : fallback _hookY (top - Hook)
local ada : fallback _ada ArchDepthA
local adb : fallback _adb ArchDepthB
local yMidDepth : if (top > ada + adb) adb (top * (adb / (ada + adb)))
local yMidDepth : if (top - base > ada + adb) adb ((top - base) * (adb / (ada + adb)))
include : dispiro
widths.rhs df.mvs
g4 df.leftSB hookY
Expand Down
3 changes: 2 additions & 1 deletion packages/font-glyphs/src/letter/latin/lower-g.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ glyph-block Letter-Latin-Lower-G : begin

export : define [AutoSerifedBody df top] : glyph-proc
include : SeriflessBody df top
if SLAB : include : tagged 'serifRT' : HSerif.rt df.rightSB top SideJut
if (SLAB && [not para.isItalic]) : include : tagged 'serifRT' : HSerif.rt df.rightSB top SideJut

export : define [EarlessCornerBody df top] : glyph-proc
include : OBarLeft.toothless
Expand All @@ -154,6 +154,7 @@ glyph-block Letter-Latin-Lower-G : begin
singleStorey SingleStorey.RoundHook
singleStoreyFlatHook SingleStorey.FlatHook
object # ear/serif
"" { SingleStorey.AutoSerifedBody 0 }
serifless { SingleStorey.SeriflessBody 0 }
serifed { SingleStorey.SerifedBody 0 }
earlessCorner { SingleStorey.EarlessCornerBody DToothlessRise }
Expand Down
1 change: 0 additions & 1 deletion packages/font-glyphs/src/letter/latin/lower-q.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ glyph-block Letter-Latin-Lower-Q : begin
HSerif.rb (RightSB - [HSwToV HalfStroke]) y Jut
define [RbSerifAuto y] : NeedSlab SLAB : RbSerif y

glyph-block-export QConfig
define QConfig : SuffixCfg.weave
object # body
"" EaredBody
Expand Down
11 changes: 0 additions & 11 deletions params/variants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3951,7 +3951,6 @@ keyAffix = ""
selectorAffix.q = ""
selectorAffix."q/sansSerif" = ""
selectorAffix."q/hookTopBase" = ""
selectorAffix."q/tailless" = ""
selectorAffix.qRTail = ""
selectorAffix.gha = ""

Expand All @@ -3961,7 +3960,6 @@ descriptionAffix = "earless (cornered) shape"
selectorAffix.q = "earlessCorner"
selectorAffix."q/sansSerif" = "earlessCorner"
selectorAffix."q/hookTopBase" = "earlessCorner"
selectorAffix."q/tailless" = "earlessCorner"
selectorAffix.qRTail = "earlessCorner"
selectorAffix.gha = ""

Expand All @@ -3971,7 +3969,6 @@ descriptionAffix = "earless (rounded) shape"
selectorAffix.q = "earlessRounded"
selectorAffix."q/sansSerif" = "earlessRounded"
selectorAffix."q/hookTopBase" = ""
selectorAffix."q/tailless" = "earlessRounded"
selectorAffix.qRTail = "earlessRounded"
selectorAffix.gha = ""

Expand All @@ -3984,7 +3981,6 @@ descriptionAffix = "straight terminal"
selectorAffix.q = "straight"
selectorAffix."q/sansSerif" = "straight"
selectorAffix."q/hookTopBase" = "straight"
selectorAffix."q/tailless" = "straight"
selectorAffix.qRTail = "straight"
selectorAffix.gha = "straight"

Expand All @@ -3994,7 +3990,6 @@ descriptionAffix = "tailed terminal"
selectorAffix.q = "tailed"
selectorAffix."q/sansSerif" = "tailed"
selectorAffix."q/hookTopBase" = "tailed"
selectorAffix."q/tailless" = "straight"
selectorAffix.qRTail = "straight"
selectorAffix.gha = "tailed"

Expand All @@ -4004,7 +3999,6 @@ descriptionAffix = "diagonally tailed terminal"
selectorAffix.q = "diagonalTailed"
selectorAffix."q/sansSerif" = "diagonalTailed"
selectorAffix."q/hookTopBase" = "diagonalTailed"
selectorAffix."q/tailless" = "straight"
selectorAffix.qRTail = "straight"
selectorAffix.gha = "diagonalTailed"

Expand All @@ -4015,7 +4009,6 @@ descriptionJoiner = "without"
selectorAffix.q = "serifless"
selectorAffix."q/sansSerif" = "serifless"
selectorAffix."q/hookTopBase" = "serifless"
selectorAffix."q/tailless" = "serifless"
selectorAffix.qRTail = "serifless"
selectorAffix.gha = "serifless"

Expand All @@ -4026,7 +4019,6 @@ descriptionAffix = "serif at bottom"
selectorAffix.q = "bottomSerifed"
selectorAffix."q/sansSerif" = "serifless"
selectorAffix."q/hookTopBase" = "bottomSerifed"
selectorAffix."q/tailless" = "bottomSerifed"
selectorAffix.qRTail = "serifless"
selectorAffix.gha = "bottomSerifed"

Expand All @@ -4037,7 +4029,6 @@ descriptionAffix = "motion serifs"
selectorAffix.q = "motionSerifed"
selectorAffix."q/sansSerif" = "serifless"
selectorAffix."q/hookTopBase" = "serifless"
selectorAffix."q/tailless" = "motionSerifed"
selectorAffix.qRTail = "motionSerifed"
selectorAffix.gha = "serifless"

Expand All @@ -4049,7 +4040,6 @@ descriptionAffix = "serifs"
selectorAffix.q = "serifed"
selectorAffix."q/sansSerif" = "serifless"
selectorAffix."q/hookTopBase" = "bottomSerifed"
selectorAffix."q/tailless" = "serifed"
selectorAffix.qRTail = "motionSerifed"
selectorAffix.gha = "bottomSerifed"

Expand All @@ -4061,7 +4051,6 @@ descriptionAffix = "serifs"
selectorAffix.q = "bottomSerifed"
selectorAffix."q/sansSerif" = "serifless"
selectorAffix."q/hookTopBase" = "bottomSerifed"
selectorAffix."q/tailless" = "bottomSerifed"
selectorAffix.qRTail = "serifless"
selectorAffix.gha = "bottomSerifed"

Expand Down
Loading