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

Draft: Armenian Letters (again) #2556

Merged
merged 14 commits into from
Oct 24, 2024
116 changes: 55 additions & 61 deletions packages/font-glyphs/src/common/shapes.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -192,34 +192,17 @@ glyph-block CommonShapes : begin
local width : fallback _width Stroke
local ada : fallback _ada SmallArchDepthA
local adb : fallback _adb SmallArchDepthB
if (u - d > ada + adb) : then : begin
return : sink
widths width 0
arch.lhs.centerAt.rtl.t middle u (sw -- width)
archv
flat (l + OX) (u - ada)
curl (l + OX) (d + adb)
arcvh
arch.lhs.centerAt.ltr.b middle d (sw -- width)
archv
flat (r - OX) (d + ada)
curl (r - OX) (u - adb)
arcvh
close
: else : begin
local ymiddlea : mix d u (adb / (ada + adb))
local ymiddleb : mix d u (ada / (ada + adb))
return : sink
widths width 0
arch.lhs.centerAt.rtl.t middle u (sw -- width)
archv
g4 (l + OX) ymiddlea
arcvh
arch.lhs.centerAt.ltr.b middle d (sw -- width)
archv
g4 (r - OX) ymiddleb
arcvh
close
return : sink
widths width 0
arch.lhs.centerAt.rtl.t middle u (sw -- width)
archv
flatside.ld (l + OX) d u ada adb
arcvh
arch.lhs.centerAt.ltr.b middle d (sw -- width)
archv
flatside.ru (r - OX) d u ada adb
arcvh
close

glyph-block-export OShape
define [OShape u d l r _width _ada _adb] : OShapeT dispiro u d l r _width _ada _adb
Expand All @@ -235,39 +218,20 @@ glyph-block CommonShapes : begin
local width : fallback _width Stroke
local ada : fallback _ada SmallArchDepthA
local adb : fallback _adb SmallArchDepthB
if (u - d > ada + adb) : then : begin
include : dispiro
widths.lhs width
arch.lhs.centerAt.rtl.t middle u (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.rtl.t (middle - gap / 2) u (sw -- width) (knot-ty -- curl)
archv
flat (l + OX) (u - ada)
curl (l + OX) (d + adb)
arcvh
arch.lhs.centerAt.ltr.b (middle - gap / 2) d (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.ltr.b (middle + gap / 2) d (sw -- width) (knot-ty -- curl)
archv
flat (r - OX) (d + ada)
curl (r - OX) (u - adb)
arcvh
arch.lhs.centerAt.rtl.t (middle + gap / 2) u (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.rtl.t middle u (sw -- width) (knot-ty -- curl)
: else : begin
local ymiddlea : mix d u (adb / (ada + adb))
local ymiddleb : mix d u (ada / (ada + adb))
include : dispiro
arch.lhs.centerAt.rtl.t middle u (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.rtl.t (middle - gap / 2) u (sw -- width) (knot-ty -- curl)
archv
g4 (l + OX) ymiddlea
arcvh
arch.lhs.centerAt.ltr.b (middle - gap / 2) d (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.ltr.b (middle + gap / 2) d (sw -- width) (knot-ty -- curl)
archv
g4 (r - OX) ymiddleb
arcvh
arch.lhs.centerAt.rtl.t (middle + gap / 2) u (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.rtl.t middle u (sw -- width) (knot-ty -- curl)
include : dispiro
widths.lhs width
arch.lhs.centerAt.rtl.t middle u (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.rtl.t (middle - gap / 2) u (sw -- width) (knot-ty -- curl)
archv
flatside.ld (l + OX) d u ada adb
arcvh
arch.lhs.centerAt.ltr.b (middle - gap / 2) d (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.ltr.b (middle + gap / 2) d (sw -- width) (knot-ty -- curl)
archv
flatside.ru (r - OX) d u ada adb
arcvh
arch.lhs.centerAt.rtl.t (middle + gap / 2) u (sw -- width) (knot-ty -- flat)
arch.lhs.centerAt.rtl.t middle u (sw -- width) (knot-ty -- curl)

glyph-block-export HSerif
define HSerif : namespace
Expand Down Expand Up @@ -530,6 +494,36 @@ glyph-block CommonShapes : begin
local args : object [yRef y] sw swTerminal isTail noSwash [overshoot o]
return : WithKnotProxy [hookProxy args] : new FunctionInterpolator hookEndBlender args

glyph-block-export flatside
define flatside : namespace
export : define [ld l d u ada adb _af] : return
Logo121 marked this conversation as resolved.
Show resolved Hide resolved
if (u - d > ada + adb)
list
flat l (u - ada) _af
curl l (d + adb)
g4 l [mix d u (adb / (ada + adb))] _af

export : define [lu l d u ada adb _af] : return
if (u - d > ada + adb)
list
flat l (d + adb) _af
curl l (u - ada)
g4 l [mix d u (adb / (ada + adb))] _af

export : define [rd r d u ada adb _af] : return
if (u - d > ada + adb)
list
flat r (u - adb) _af
curl r (d + ada)
g4 r [mix d u (ada / (ada + adb))] _af

export : define [ru r d u ada adb _af] : return
if (u - d > ada + adb)
list
flat r (d + ada) _af
curl r (u - adb)
g4 r [mix d u (ada / (ada + adb))] _af

glyph-block-export arch
define arch : namespace
export : define adjust-x : namespace
Expand Down
1 change: 1 addition & 0 deletions packages/font-glyphs/src/index.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export : define [buildGlyphs para recursive] : begin
run-glyph-module "./letter/latin.mjs"
run-glyph-module "./letter/greek.mjs"
run-glyph-module "./letter/cyrillic.mjs"
run-glyph-module "./letter/armenian.mjs"

# Numbers
run-glyph-module "./number/index.mjs"
Expand Down
25 changes: 25 additions & 0 deletions packages/font-glyphs/src/letter/armenian.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$$include '../meta/macros.ptl'

export : define [apply] : begin
define $$Capture$$ this
run-glyph-module "./armenian/shared.mjs"
run-glyph-module "./armenian/upper-u-group.mjs"
run-glyph-module "./armenian/lower-u-group.mjs"
run-glyph-module "./armenian/hook-group.mjs"
run-glyph-module "./armenian/upper-gim-group.mjs"
run-glyph-module "./armenian/lower-q-group.mjs"
run-glyph-module "./armenian/upper-za-group.mjs"
run-glyph-module "./armenian/eh-liun-hiun.mjs"
run-glyph-module "./armenian/to.mjs"
run-glyph-module "./armenian/upper-xeh.mjs"
run-glyph-module "./armenian/ca.mjs"
run-glyph-module "./armenian/upper-ho.mjs"
run-glyph-module "./armenian/upper-dza-group.mjs"
run-glyph-module "./armenian/lower-dza-cheh.mjs"
run-glyph-module "./armenian/upper-cheh.mjs"
run-glyph-module "./armenian/upper-yi.mjs"
run-glyph-module "./armenian/lower-sha-group.mjs"
run-glyph-module "./armenian/upper-co.mjs"
run-glyph-module "./armenian/keh.mjs"
run-glyph-module "./armenian/feh.mjs"
run-glyph-module "./armenian/other.mjs"
67 changes: 67 additions & 0 deletions packages/font-glyphs/src/letter/armenian/ca.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
$$include '../../meta/macros.ptl'

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

glyph-module

glyph-block Letter-Armenian-Ca : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifFrame

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

do "Ca"
create-glyph 'armn/Ca' 0x53E : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : VBar.l df.leftSB (CAP - VJut) CAP df.mvs
local yStart : CAP - VJut + df.mvs
include : dispiro
widths.rhs.heading df.mvs Rightward
flat df.leftSB yStart
curl df.middle yStart
archv
flat df.rightSB (yStart - ArchDepthB)
curl df.rightSB (0 + ArchDepthA)
arch.rhs 0 (sw -- df.mvs)
flat df.leftSB (0 + ArchDepthB)
curl df.leftSB (yStart - ArchDepthA)
arcvh
flat df.rightSB CAP
curl (df.rightSB + jut - [HSwToV : 0.5 * df.mvs]) CAP

create-glyph 'armn/ca' 0x56E : glyph-proc
local df : include : DivFrame 1
include : df.markSet.b

local x1 : mix df.leftSB df.rightSB 0.45
local x2 : mix df.leftSB df.rightSB 0.3
local xOffset : 0.5 * [HSwToV df.mvs]
local y2 : mix Ascender XH 0.5
include : dispiro
widths.rhs df.mvs
flat (x1 + xOffset) Ascender [heading Downward]
curl (x2 + xOffset) y2 [heading Downward]

local x3 : mix df.leftSB df.rightSB 0.1
local x4 : mix df.leftSB df.rightSB 0.6

include : intersection [MaskBelowLine (x1 - xOffset) Ascender (x2 - xOffset) y2 100] : dispiro
widths.rhs df.mvs
flat (x3 + xOffset) Ascender
curl (x4 + xOffset) XH
# arcvh
straight.down.end (df.rightSB + OX) (XH - SmallArchDepthB)
curl (df.rightSB + OX) (0 + SmallArchDepthA)
arch.rhs 0 (sw -- df.mvs)
flat (df.leftSB - OX) (0 + SmallArchDepthB)
Logo121 marked this conversation as resolved.
Show resolved Hide resolved
curl (df.leftSB - OX) (XH - SmallArchDepthA)
arcvh
flat df.middle XH
curl df.rightSB XH

79 changes: 79 additions & 0 deletions packages/font-glyphs/src/letter/armenian/eh-liun-hiun.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
$$include '../../meta/macros.ptl'

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

glyph-module

glyph-block Letter-Armenian-Eh-Liun-Hiun : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifFrame
glyph-block-import Letter-Armenian-Shared-Shapes : ArmHBar

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

do "Eh"
create-glyph 'armn/Eh' 0x537 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : VBar.l df.leftSB 0 CAP df.mvs
include : [ArmHBar.short df 1].base
include : [ArmHBar.normal df 1].high
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include : composite-proc sf.lt.full sf.lb.outer

create-glyph 'armn/eh' 0x567 : glyph-proc
local df : include : DivFrame para.diversityF
include : df.markSet.b
include : VBar.l df.leftSB 0 Ascender df.mvs
include : [ArmHBar.short df 0].base
include : [ArmHBar.normal df 0].high
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.lt.outer
if [not para.isItalic] : include sf.lb.outer

do "Liun"
create-glyph 'armn/Liun' 0x53C : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : VBar.l df.leftSB 0 CAP df.mvs
include : [ArmHBar.normal df 1].base
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include : composite-proc sf.lt.full sf.lb.outer

create-glyph 'armn/liun' 0x56C : glyph-proc
local df : include : DivFrame para.diversityII
include : df.markSet.p
local xMiddle : df.middle - [IBalance2 df]
include : VBar.m xMiddle Descender XH df.mvs
include : HBar.b xMiddle (xMiddle + LongJut * df.div) Descender df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df XH Descender
include : sf.mt.leftAt xMiddle

do "Hiun"
create-glyph 'armn/Hiun' 0x552 : glyph-proc
local df : include : DivFrame 1
include : df.markSet.capital
include : VBar.l df.leftSB 0 CAP df.mvs
include : [ArmHBar.normal df 1].high
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include : composite-proc sf.lt.full sf.lb.full

create-glyph 'armn/hiun' 0x582 : glyph-proc
local df : include : DivFrame para.diversityF
include : VBar.l df.leftSB 0 XH df.mvs
include : [ArmHBar.normal df 1].base
if SLAB : begin
local sf : SerifFrame.fromDf df XH 0
include sf.lt.outer
if [not para.isItalic] : begin
include sf.lb.full
43 changes: 43 additions & 0 deletions packages/font-glyphs/src/letter/armenian/feh.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
$$include '../../meta/macros.ptl'

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

glyph-module

glyph-block Letter-Armenian-Feh : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : SerifFrame

define [FehBody df top bot ada adb] : glyph-proc
local midy : mix bot top HBarPos
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]
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
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
include : VBar.m df.middle 0 CAP df.mvs
if SLAB : begin
local sf : SerifFrame.fromDf df CAP 0
include sf.mt.right

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
include : VBar.m df.middle Descender Ascender df.mvs
if (SLAB && [not para.Italic]) : begin
local sf : SerifFrame.fromDf df Ascender Descender
include sf.mb.full
Loading