Skip to content

Commit

Permalink
Add variant selectors for Greek lower Phi/Psi (Last for forseeable fu…
Browse files Browse the repository at this point in the history
…ture). (#2456)

* Add variant selectors for Greek lower Phi/Psi.

* fix
  • Loading branch information
jmcwilliams403 authored Aug 4, 2024
1 parent d4050f9 commit 07c93a3
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 58 deletions.
1 change: 1 addition & 0 deletions changes/31.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add variant selectors for Greek lower Phi/Psi (`VXAG`, `VXAH`).
3 changes: 1 addition & 2 deletions packages/font-glyphs/src/letter/greek.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export : define [apply] : begin
run-glyph-module "./greek/upper-xi.mjs"
run-glyph-module "./greek/pi.mjs"
run-glyph-module "./greek/upper-sigma.mjs"
run-glyph-module "./greek/upper-phi.mjs"
run-glyph-module "./greek/phi.mjs"
run-glyph-module "./greek/psi.mjs"
run-glyph-module "./greek/upper-omega.mjs"

Expand All @@ -24,7 +24,6 @@ export : define [apply] : begin
run-glyph-module "./greek/lower-sigma.mjs"
run-glyph-module "./greek/lower-sigma-final.mjs"
run-glyph-module "./greek/lower-upsilon.mjs"
run-glyph-module "./greek/lower-phi.mjs"
run-glyph-module "./greek/lower-omega.mjs"

run-glyph-module "./greek/sampi.mjs"
Expand Down
37 changes: 0 additions & 37 deletions packages/font-glyphs/src/letter/greek/lower-phi.ptl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import [DesignParameters] from "../../meta/aesthetics.mjs"

glyph-module

glyph-block Letter-Greek-Upper-Phi : begin
glyph-block Letter-Greek-Phi : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors ExtendBelowBaseAnchors
Expand Down Expand Up @@ -41,6 +41,24 @@ glyph-block Letter-Greek-Upper-Phi : begin
ada -- ada
adb -- adb

define [GrekLowerPhiCursiveRing fFlatTB df y1 y2] : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.e

local l : df.leftSB + OX * 2
local r : df.width - l
include : dispiro
widths.lhs df.mvs
g4 [mix df.leftSB df.rightSB 0.1] y2
g4 l [mix y1 y2 0.55]
arch.lhs y1 (sw -- df.mvs)
g4 r [mix y1 y2 0.55]
arcvh 8
g4.left.mid [mix r (df.middle - [HSwToV : 0.5 * df.mvs]) 0.525] y2 [heading Leftward]
archv
flat (df.middle - [HSwToV : 0.5 * df.mvs]) [mix y1 y2 0.66]
curl (df.middle - [HSwToV : 0.5 * df.mvs]) (y1 + 0.2 * df.mvs) [heading Downward]

define [StraightBar df bot y1 y2 top] : glyph-proc
include : VBar.m df.middle bot (y1 + HalfStroke)
include : VBar.m df.middle (y2 - HalfStroke) top
Expand Down Expand Up @@ -108,13 +126,32 @@ glyph-block Letter-Greek-Upper-Phi : begin
include : tagged 'serifMT' : HSerif.mt df.middle top MidJutSide
include : tagged 'serifMB' : HSerif.mb df.middle bot MidJutSide

create-glyph 'grek/varphi' 0x3D5 : glyph-proc
create-glyph 'taillessphi' 0x2C77 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : df.markSet.e
include : GrekLowerPhiCursiveRing 0 df 0 XH

create-glyph 'grek/phi.cursive' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : GrekLowerPhiCursiveRing 0 df 0 XH
include : VBar.m df.middle Descender (0.2 * df.mvs)

create-glyph 'grek/phi.straight' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : VarPhiRing 0 df 0 XH
include : StraightBar df Descender 0 XH Ascender

create-glyph 'grek/phi.neohellenic' : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : VarPhiRing 0 df 0 XH
include : VBar.m df.middle Descender (0.2 * df.mvs)

select-variant 'grek/phi' 0x3C6
alias 'grek/varphi' 0x3D5 'grek/phi.straight'

create-glyph 'latn/phi' 0x278 : glyph-proc
local df : include : DivFrame para.diversityM 3
include [refer-glyph 'grek/varphi'] AS_BASE ALSO_METRICS
Expand Down
31 changes: 19 additions & 12 deletions packages/font-glyphs/src/letter/greek/psi.ptl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
$$include '../../meta/macros.ptl'

import [mix linreg clamp fallback] from "@iosevka/util"
import [mix linreg clamp fallback SuffixCfg] from "@iosevka/util"
import [DesignParameters] from "../../meta/aesthetics.mjs"
import [MathSansSerif] from "@iosevka/glyph/relation"

glyph-module

Expand Down Expand Up @@ -39,14 +40,20 @@ glyph-block Letter-Greek-Psi : begin
include : df.markSet.e
include : PsiBaseShape df 0 (XH * 0.3) XH XH SLAB false SLAB SLAB


create-glyph 'grek/psi' 0x3C8 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.bp
include : PsiBaseShape df Descender 0 XH Ascender false false SLAB false

create-glyph 'cyrl/psi' 0x471 : glyph-proc
local df : include : DivFrame para.diversityM 3
include : df.markSet.p
include : PsiBaseShape df Descender 0 XH XH false false SLAB false

define GrekLowerPsiConfig : SuffixCfg.weave
object # yBar
"" Ascender
flatTop XH
object # slab
serifless false
serifed true

foreach { suffix { yBar slab } } [Object.entries GrekLowerPsiConfig] : do
create-glyph "grek/psi.\(suffix)" : glyph-proc
local df : include : DivFrame para.diversityM 3
include : if (yBar > XH) [df.markSet.bp] [df.markSet.p]
include : PsiBaseShape df Descender 0 XH yBar false false slab false

select-variant 'grek/psi' 0x3C8
link-reduced-variant 'grek/psi/sansSerif' 'grek/psi' MathSansSerif
select-variant 'cyrl/psi' 0x471 (shapeFrom -- 'grek/psi')
86 changes: 86 additions & 0 deletions params/variants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5970,6 +5970,29 @@ selectorAffix."grek/upsilon/sansSerif" = "serifless"



[prime.lower-phi]
sampler = "φ"
samplerExplain = "Greek lower Phi"
nonBreakingTagForNewVariantSelector = "VXAG" # REMOVE IN NEXT MAJOR VERSION CHANGE
tagKind = "letter"

[prime.lower-phi.variants.straight]
rank = 1
description = "Greek lower Phi (`φ`) with straight shape"
selector."grek/phi" = "straight"

[prime.lower-phi.variants.cursive]
rank = 2
description = "Greek lower Phi (`φ`) with cursive shape"
selector."grek/phi" = "cursive"

[prime.lower-phi.variants.neo-hellenic]
rank = 3
description = "Greek lower Phi (`ν`) with neo-hellenic shape"
selector."grek/phi" = "neohellenic"



[prime.lower-chi]
sampler = "χ"
samplerExplain = "Greek lower Chi"
Expand Down Expand Up @@ -6052,6 +6075,50 @@ selectorAffix."grek/chi/sansSerif" = "serifless"



[prime.lower-psi]
sampler = "ψ"
samplerExplain = "Greek lower Psi"
nonBreakingTagForNewVariantSelector = "VXAH" # REMOVE IN NEXT MAJOR VERSION CHANGE
tagKind = "letter"

[prime.lower-psi.variants-buildup]
entry = "body"
descriptionLeader = "Greek lower Psi (`ψ`)"

[prime.lower-psi.variants-buildup.stages.body."*"]
next = "serifs"

[prime.lower-psi.variants-buildup.stages.body.normal]
rank = 1
keyAffix = ""
selectorAffix."grek/psi" = ""
selectorAffix."grek/psi/sansSerif" = ""
selectorAffix."cyrl/psi" = "flatTop"

[prime.lower-psi.variants-buildup.stages.body.flat-top]
rank = 2
descriptionAffix = "flat top"
selectorAffix."grek/psi" = "flatTop"
selectorAffix."grek/psi/sansSerif" = "flatTop"
selectorAffix."cyrl/psi" = "flatTop"

[prime.lower-psi.variants-buildup.stages.serifs.serifless]
rank = 1
descriptionAffix = "serifs"
descriptionJoiner = "without"
selectorAffix."grek/psi" = "serifless"
selectorAffix."grek/psi/sansSerif" = "serifless"
selectorAffix."cyrl/psi" = "serifless"

[prime.lower-psi.variants-buildup.stages.serifs.serifed]
rank = 2
descriptionAffix = "serifs"
selectorAffix."grek/psi" = "serifed"
selectorAffix."grek/psi/sansSerif" = "serifless"
selectorAffix."cyrl/psi" = "serifed"



[prime.cyrl-a]
sampler = "а"
samplerExplain = "Cyrillic A"
Expand Down Expand Up @@ -8515,7 +8582,9 @@ lower-xi = "flat-top"
lower-pi = "tailed"
lower-tau = "semi-tailed"
lower-upsilon = "casual-serifless"
lower-phi = "cursive"
lower-chi = "straight-serifless"
lower-psi = "serifless"
cyrl-a = "double-storey-serifless"
cyrl-ve = "standard-serifless"
cyrl-capital-zhe = "symmetric-connected"
Expand Down Expand Up @@ -8672,6 +8741,7 @@ lower-lambda = "straight-turn"
lower-mu = "tailed-serifed"
lower-upsilon = "casual-serifed"
lower-chi = "straight-bilateral-motion-serifed"
lower-psi = "serifed"
cyrl-a = "double-storey-serifed"
cyrl-ve = "standard-bilateral-serifed"
cyrl-capital-ze = "unilateral-serifed"
Expand Down Expand Up @@ -8765,6 +8835,7 @@ lower-mu = "toothed-serifless"
lower-nu = "straight"
lower-pi = "tailless"
lower-tau = "tailless"
lower-phi = "straight"
lower-chi = "semi-chancery-straight-serifless"
cyrl-a = "double-storey-serifless"
cyrl-ve = "standard-serifless"
Expand Down Expand Up @@ -8969,6 +9040,7 @@ lower-beta = "standard"
lower-chi = "semi-chancery-straight-serifless"
lower-eth = "straight-bar"
lower-lambda = "tailed-turn"
lower-phi = "straight"
cyrl-a = "double-storey-serifless"
cyrl-ve = "standard-serifless"
cyrl-capital-zhe = "symmetric-touching"
Expand Down Expand Up @@ -9006,6 +9078,7 @@ l = "tailed"
long-s = "flat-hook-descending"
eszet = "longs-s-lig-descending-serifless"
lower-beta = "cursive"
lower-phi = "cursive"
cyrl-a = "single-storey-serifless"
cyrl-ve = "cursive-tall"
cyrl-zhe = "symmetric-connected"
Expand Down Expand Up @@ -9093,6 +9166,7 @@ lower-lambda = "straight-turn"
lower-tau = "flat-tailed"
lower-upsilon = "casual-serifed"
lower-chi = "semi-chancery-straight-serifless"
lower-psi = "flat-top-serifless"
cyrl-a = "double-storey-serifless"
cyrl-ve = "standard-serifless"
cyrl-capital-zhe = "straight"
Expand Down Expand Up @@ -9154,6 +9228,7 @@ capital-eszet = "rounded-serifed"
long-s = "flat-hook-double-serifed"
eszet = "longs-s-lig-bottom-serifed"
lower-mu = "tailed-serifed"
lower-psi = "flat-top-serifed"
cyrl-a = "double-storey-serifed"
cyrl-ve = "standard-bilateral-serifed"
cyrl-ze = "unilateral-serifed"
Expand Down Expand Up @@ -9202,6 +9277,7 @@ lower-lambda = "straight-turn"
lower-mu = "toothed-serifless"
lower-xi = "rounded"
lower-tau = "semi-tailed"
lower-psi = "flat-top-serifless"
cyrl-a = "double-storey-tailed"
cyrl-ve = "standard-serifless"
cyrl-em = "slanted-sides-hanging-serifless"
Expand Down Expand Up @@ -9258,6 +9334,7 @@ capital-eszet = "rounded-serifed"
long-s = "bent-hook-bottom-serifed"
eszet = "longs-s-lig-bottom-serifed"
lower-mu = "toothed-serifed"
lower-psi = "flat-top-serifed"
cyrl-ve = "standard-bilateral-serifed"
cyrl-ze = "unilateral-serifed"
cyrl-ka = "symmetric-connected-serifed"
Expand Down Expand Up @@ -9627,6 +9704,7 @@ long-s = "flat-hook-middle-serifed"
eszet = "longs-s-lig-serifless"
lower-lambda = "straight-turn"
lower-tau = "short-tailed"
lower-phi = "straight"
cyrl-a = "double-storey-serifless"
cyrl-ve = "standard-serifless"
cyrl-capital-u = "straight-turn-serifless"
Expand Down Expand Up @@ -9860,6 +9938,8 @@ lower-nu = "straight"
lower-xi = "rounded"
lower-pi = "small-capital"
lower-upsilon = "straight-serifless"
lower-phi = "neo-hellenic"
lower-psi = "flat-top-serifless"
cyrl-a = "double-storey-tailed"
cyrl-capital-zhe = "symmetric-touching"
cyrl-zhe = "symmetric-touching"
Expand Down Expand Up @@ -9928,6 +10008,7 @@ eszet = "longs-s-lig-bottom-serifed"
capital-gamma = "serifed"
lower-mu = "toothless-corner-serifed"
lower-upsilon = "straight-serifed"
lower-psi = "flat-top-serifed"
cyrl-capital-ka = "symmetric-touching-serifed"
cyrl-ka = "symmetric-touching-serifed"
cyrl-em = "slanted-sides-hanging-serifed"
Expand Down Expand Up @@ -9987,6 +10068,7 @@ lower-lambda = "straight-turn"
lower-mu = "toothed-serifless"
lower-pi = "tailless"
lower-tau = "tailless"
lower-phi = "straight"
cyrl-a = "double-storey-tailed"
cyrl-ve = "standard-serifless"
cyrl-capital-u = "straight-turn-serifless"
Expand Down Expand Up @@ -10091,6 +10173,7 @@ lower-nu = "straight"
lower-xi = "rounded"
lower-tau = "flat-tailed"
lower-upsilon = "straight-serifless"
lower-psi = "flat-top-serifless"
cyrl-a = "double-storey-serifless"
cyrl-ve = "standard-serifless"
cyrl-em = "hanging-serifless"
Expand Down Expand Up @@ -10152,6 +10235,7 @@ eszet = "sulzbacher-bottom-serifed"
lower-alpha = "barred-double-serifed"
lower-mu = "toothed-serifed"
lower-upsilon = "straight-serifed"
lower-psi = "flat-top-serifed"
cyrl-a = "double-storey-serifed"
cyrl-ve = "standard-bilateral-serifed"
cyrl-ka = "symmetric-connected-serifed"
Expand Down Expand Up @@ -10629,6 +10713,7 @@ lower-gamma = "straight"
lower-lambda = "straight-turn"
lower-tau = "short-tailed"
lower-upsilon = "straight-serifless"
lower-psi = "flat-top-serifless"
cyrl-a = "double-storey-tailed"
cyrl-ve = "standard-serifless"
cyrl-em = "hanging-serifless"
Expand Down Expand Up @@ -10678,6 +10763,7 @@ long-s = "flat-hook-double-serifed-xh"
eszet = "longs-s-lig-bottom-serifed"
lower-alpha = "barred-tailed-serifed"
lower-upsilon = "straight-serifed"
lower-psi = "flat-top-serifed"
cyrl-ve = "standard-bilateral-serifed"
cyrl-ka = "symmetric-connected-serifed"
cyrl-em = "hanging-serifed"
Expand Down
4 changes: 2 additions & 2 deletions tools/generate-samples/src/templates/package-sample.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import * as themes from "../themes/index.mjs";
// prettier-ignore
export const ssStrings = [
["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"],
["!iIlL17|¦ ¢coO08BbDQ $5SZ2zs 96µm", "float il1[]={1-2/3.4,5+6=7/8%90};"],
["!iIlL17|¦ ¢coO08BDQ $5SZ2zs 96µm", "float il1[]={1-2/3.4,5+6=7/8%90};"],
["1234567890 ,._-+= >< «¯-¬_» ~–÷+×", "{*}[]()<>`+-=$/#_%^@\\&|~?'\" !,.;:"],
["CG6Qg9q¶ Þẞðþſß ΓΔΛαβγδιλμνξπτυχ∂", [..."ЖЗКНРУЭЯавжзклмнруфчьыэя ", "<=", " ", "!=", " ", "=="]]
["G6Qg9q¶ Þẞðþſß ΓΔΛαβγδιλμνξπτυφχψ", [..."ЖЗКНРУЭЯавжзклмнруфчьыэя ", "<=", " ", "!=", " ", "=="]]
];

function* makeSample(lbm, hotChars) {
Expand Down
Loading

0 comments on commit 07c93a3

Please sign in to comment.