Initial support for ligation in Kitty (#1007)

This commit is contained in:
be5invis 2021-06-02 19:17:49 -07:00
parent f0402d2d40
commit 8a69ab9179
13 changed files with 220 additions and 42 deletions

View file

@ -9,18 +9,21 @@ family = "Iosevka"
desc = "Default"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" off'
export-glyph-names = true
[buildPlans.iosevka-term]
family = "Iosevka Term"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on'
export-glyph-names = true
[buildPlans.iosevka-fixed]
family = "Iosevka Fixed"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on'
export-glyph-names = true
# Slab
[buildPlans.iosevka-slab]
@ -29,6 +32,7 @@ desc = "Slab-serif"
serifs = "slab"
snapshotFamily = 'iosevka-slab'
snapshotFeature = '"NWID" off'
export-glyph-names = true
[buildPlans.iosevka-term-slab]
family = "Iosevka Term Slab"
@ -36,6 +40,7 @@ serifs = "slab"
spacing = "term"
snapshotFamily = 'iosevka-slab'
snapshotFeature = '"NWID" on'
export-glyph-names = true
[buildPlans.iosevka-fixed-slab]
family = "Iosevka Fixed Slab"
@ -43,6 +48,7 @@ serifs = "slab"
spacing = "fixed"
snapshotFamily = 'iosevka-slab'
snapshotFeature = '"NWID" on'
export-glyph-names = true
# Curly
[buildPlans.iosevka-curly]
@ -50,6 +56,7 @@ family = "Iosevka Curly"
desc = "Curly Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss20" on'
export-glyph-names = true
[buildPlans.iosevka-curly.variants]
inherits = "ss20"
@ -58,6 +65,7 @@ family = "Iosevka Term Curly"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss20" on'
export-glyph-names = true
[buildPlans.iosevka-term-curly.variants]
inherits = "ss20"
@ -66,6 +74,7 @@ family = "Iosevka Fixed Curly"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss20" on'
export-glyph-names = true
[buildPlans.iosevka-fixed-curly.variants]
inherits = "ss20"
@ -76,6 +85,7 @@ desc = "Curly Style, Slab-serif"
serifs = "slab"
snapshotFamily = 'iosevka-slab'
snapshotFeature = '"ss20" on'
export-glyph-names = true
[buildPlans.iosevka-curly-slab.variants]
inherits = "ss20"
@ -85,6 +95,7 @@ serifs = "slab"
spacing = "term"
snapshotFamily = 'iosevka-slab'
snapshotFeature = '"NWID" on, "ss20" on'
export-glyph-names = true
[buildPlans.iosevka-term-curly-slab.variants]
inherits = "ss20"
@ -94,6 +105,7 @@ serifs = "slab"
spacing = "fixed"
snapshotFamily = 'iosevka-slab'
snapshotFeature = '"NWID" on, "ss20" on'
export-glyph-names = true
[buildPlans.iosevka-fixed-curly-slab.variants]
inherits = "ss20"
@ -104,6 +116,7 @@ family = "Iosevka SS01"
desc = "Andale Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss01" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss01.variants]
inherits = "ss01"
@ -113,6 +126,7 @@ family = "Iosevka Term SS01"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss01" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss01.variants]
inherits = "ss01"
@ -122,6 +136,7 @@ family = "Iosevka Fixed SS01"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss01" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss01.variants]
inherits = "ss01"
@ -132,6 +147,7 @@ family = "Iosevka SS02"
desc = "Anonymous Pro Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss02" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss02.variants]
inherits = "ss02"
@ -141,6 +157,7 @@ family = "Iosevka Term SS02"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss02" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss02.variants]
inherits = "ss02"
@ -150,6 +167,7 @@ family = "Iosevka Fixed SS02"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss02" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss02.variants]
inherits = "ss02"
@ -160,6 +178,7 @@ family = "Iosevka SS03"
desc = "Consolas Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss03" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss03.variants]
inherits = "ss03"
@ -169,6 +188,7 @@ family = "Iosevka Term SS03"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss03" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss03.variants]
inherits = "ss03"
@ -178,6 +198,7 @@ family = "Iosevka Fixed SS03"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss03" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss03.variants]
inherits = "ss03"
@ -188,6 +209,7 @@ family = "Iosevka SS04"
desc = "Menlo Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss04" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss04.variants]
inherits = "ss04"
@ -197,6 +219,7 @@ family = "Iosevka Term SS04"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss04" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss04.variants]
inherits = "ss04"
@ -206,6 +229,7 @@ family = "Iosevka Fixed SS04"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss04" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss04.variants]
inherits = "ss04"
@ -216,6 +240,7 @@ family = "Iosevka SS05"
desc = "Fira Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss05" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss05.variants]
inherits = "ss05"
@ -225,6 +250,7 @@ family = "Iosevka Term SS05"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss05" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss05.variants]
inherits = "ss05"
@ -234,6 +260,7 @@ family = "Iosevka Fixed SS05"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss05" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss05.variants]
inherits = "ss05"
@ -244,6 +271,7 @@ family = "Iosevka SS06"
desc = "Liberation Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss06" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss06.variants]
inherits = "ss06"
@ -253,6 +281,7 @@ family = "Iosevka Term SS06"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss06" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss06.variants]
inherits = "ss06"
@ -262,6 +291,7 @@ family = "Iosevka Fixed SS06"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss06" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss06.variants]
inherits = "ss06"
@ -272,6 +302,7 @@ family = "Iosevka SS07"
desc = "Monaco Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss07" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss07.variants]
inherits = "ss07"
@ -281,6 +312,7 @@ family = "Iosevka Term SS07"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss07" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss07.variants]
inherits = "ss07"
@ -290,6 +322,7 @@ family = "Iosevka Fixed SS07"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss07" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss07.variants]
inherits = "ss07"
@ -300,6 +333,7 @@ family = "Iosevka SS08"
desc = "Pragmata Pro Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss08" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss08.variants]
inherits = "ss08"
@ -309,6 +343,7 @@ family = "Iosevka Term SS08"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss08" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss08.variants]
inherits = "ss08"
@ -318,6 +353,7 @@ family = "Iosevka Fixed SS08"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss08" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss08.variants]
inherits = "ss08"
@ -328,6 +364,7 @@ family = "Iosevka SS09"
desc = "Source Code Pro Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss09" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss09.variants]
inherits = "ss09"
@ -337,6 +374,7 @@ family = "Iosevka Term SS09"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss09" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss09.variants]
inherits = "ss09"
@ -346,6 +384,7 @@ family = "Iosevka Fixed SS09"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss09" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss09.variants]
inherits = "ss09"
@ -356,6 +395,7 @@ family = "Iosevka SS10"
desc = "Envy Code R Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss10" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss10.variants]
inherits = "ss10"
@ -365,6 +405,7 @@ family = "Iosevka Term SS10"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss10" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss10.variants]
inherits = "ss10"
@ -374,6 +415,7 @@ family = "Iosevka Fixed SS10"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss10" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss10.variants]
inherits = "ss10"
@ -384,6 +426,7 @@ family = "Iosevka SS11"
desc = "X Windows Fixed Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss11" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss11.variants]
inherits = "ss11"
@ -393,6 +436,7 @@ family = "Iosevka Term SS11"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss11" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss11.variants]
inherits = "ss11"
@ -402,6 +446,7 @@ family = "Iosevka Fixed SS11"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss11" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss11.variants]
inherits = "ss11"
@ -412,6 +457,7 @@ family = "Iosevka SS12"
desc = "Ubuntu Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss12" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss12.variants]
inherits = "ss12"
@ -421,6 +467,7 @@ family = "Iosevka Term SS12"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss12" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss12.variants]
inherits = "ss12"
@ -430,6 +477,7 @@ family = "Iosevka Fixed SS12"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss12" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss12.variants]
inherits = "ss12"
@ -440,6 +488,7 @@ family = "Iosevka SS13"
desc = "Lucida Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss13" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss13.variants]
inherits = "ss13"
@ -449,6 +498,7 @@ family = "Iosevka Term SS13"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss13" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss13.variants]
inherits = "ss13"
@ -458,6 +508,7 @@ family = "Iosevka Fixed SS13"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss13" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss13.variants]
inherits = "ss13"
@ -468,6 +519,7 @@ family = "Iosevka SS14"
desc = "JetBrains Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss14" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss14.variants]
inherits = "ss14"
@ -477,6 +529,7 @@ family = "Iosevka Term SS14"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss14" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss14.variants]
inherits = "ss14"
@ -486,6 +539,7 @@ family = "Iosevka Fixed SS14"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss14" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss14.variants]
inherits = "ss14"
@ -496,6 +550,7 @@ family = "Iosevka SS15"
desc = "IBM Plex Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss15" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss15.variants]
inherits = "ss15"
@ -505,6 +560,7 @@ family = "Iosevka Term SS15"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss15" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss15.variants]
inherits = "ss15"
@ -514,6 +570,7 @@ family = "Iosevka Fixed SS15"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss15" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss15.variants]
inherits = "ss15"
@ -524,6 +581,7 @@ family = "Iosevka SS16"
desc = "PT Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss16" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss16.variants]
inherits = "ss16"
@ -533,6 +591,7 @@ family = "Iosevka Term SS16"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss16" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss16.variants]
inherits = "ss16"
@ -542,6 +601,7 @@ family = "Iosevka Fixed SS16"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss16" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss16.variants]
inherits = "ss16"
@ -552,6 +612,7 @@ family = "Iosevka SS17"
desc = "Recursive Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss17" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss17.variants]
inherits = "ss17"
@ -561,6 +622,7 @@ family = "Iosevka Term SS17"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss17" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss17.variants]
inherits = "ss17"
@ -570,6 +632,7 @@ family = "Iosevka Fixed SS17"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss17" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss17.variants]
inherits = "ss17"
@ -580,6 +643,7 @@ family = "Iosevka SS18"
desc = "Input Mono Style"
snapshotFamily = 'iosevka'
snapshotFeature = '"ss18" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-ss18.variants]
inherits = "ss18"
@ -589,6 +653,7 @@ family = "Iosevka Term SS18"
spacing = "term"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss18" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-term-ss18.variants]
inherits = "ss18"
@ -598,6 +663,7 @@ family = "Iosevka Fixed SS18"
spacing = "fixed"
snapshotFamily = 'iosevka'
snapshotFeature = '"NWID" on, "ss18" on'
export-glyph-names = true
no-cv-ss = true
[buildPlans.iosevka-fixed-ss18.variants]
inherits = "ss18"
@ -612,6 +678,7 @@ desc = "Sans-serif"
spacing = "quasi-proportional"
snapshotFamily = 'iosevka-aile'
snapshotFeature = '"NWID" off'
export-glyph-names = true
[buildPlans.iosevka-aile.variants.design]
capital-i = "serifless"
@ -690,6 +757,7 @@ spacing = "quasi-proportional"
serifs = 'slab'
snapshotFamily = 'iosevka-etoile'
snapshotFeature = '"NWID" off'
export-glyph-names = true
[buildPlans.iosevka-etoile.variants.design]
at = 'fourfold'
@ -725,12 +793,14 @@ css = "normal"
family = "Iosevka QP"
desc = "Customizer Preview Only Quasi-proportional Sans"
spacing = "quasi-proportional"
export-glyph-names = true
[buildPlans.iosevka-QP-slab]
family = "Iosevka QP Slab"
desc = "Customizer Preview Only Quasi-proportional Slab"
serifs = 'slab'
spacing = "quasi-proportional"
export-glyph-names = true
###################################################################################################

View file

@ -13,7 +13,7 @@ const { copyFontMetrics } = require("../meta/aesthetics");
module.exports = async function (argv, para) {
const gs = buildGlyphs(para);
const baseFont = EmptyFont();
const baseFont = EmptyFont(argv);
assignFontNames(para, baseFont);
copyFontMetrics(gs.fontMetrics, baseFont);

View file

@ -2,12 +2,12 @@
const { Ot } = require("ot-builder");
module.exports = function () {
module.exports = function (argv) {
let font = {
head: new Ot.Head.Table(),
hhea: new Ot.MetricHead.Hhea(),
os2: new Ot.Os2.Table(4),
post: new Ot.Post.Table(3, 0),
post: new Ot.Post.Table(argv.featureControl.exportGlyphNames ? 2 : 3, 0),
maxp: Ot.Maxp.Table.TrueType(),
name: new Ot.Name.Table()
};

View file

@ -1,5 +1,6 @@
const { Ot } = require("ot-builder");
const Point = require("../../support/point");
const { Joining } = require("../../support/gr");
class MappedGlyphStore {
constructor() {
@ -62,10 +63,12 @@ class MappedGlyphStore {
}
if (preferredName && !conflictSet.has(preferredName)) {
conflictSet.add(preferredName);
return preferredName;
} else {
preferredName = `.gid${gid}`;
}
return `.gid${gid}`;
preferredName = Joining.amendOtName(preferredName, Joining.get(gSrc));
return preferredName;
}
fillReferences(g, rs) {

View file

@ -2,6 +2,7 @@
$$include '../../meta/macros.ptl'
import [mix clamp fallback] from '../../support/utils'
import [Joining] from '../../support/gr'
import [DesignParameters] from '../../meta/aesthetics'
glyph-module
@ -13,6 +14,12 @@ glyph-block Symbol-Ligation : begin
local arrowheadsKern : (2 / 3) * [clamp 0 (Width * 0.4) (Width - OperatorStroke * 3)]
define [SetJoiningKind lk rk] : glyph-proc
local k 0
if (lk !== 'f') : set k : k + Joining.Classes.Left
if (rk !== 'f') : set k : k + Joining.Classes.Right
Joining.set currentGlyph k
define arrowheadSlope : 1 / LessSlope
define [ArrowBarConfig extend kern join doubleBar] : begin
define cleft O
@ -48,7 +55,7 @@ glyph-block Symbol-Ligation : begin
define result {}
foreach [l : items-of : Object.keys lk] : foreach [r : items-of : Object.keys rk]
result.push { (l + r) lk.(l) rk.(r) }
result.push { l r lk.(l) rk.(r) }
return result
local arrowExtend [clamp 0 Width (RightSB - OperatorStroke / 2 * arrowheadSlope)]
@ -57,12 +64,13 @@ glyph-block Symbol-Ligation : begin
define [HyphenNotch x] : union
VBar x (SymbolMid + OperatorStroke / 3) (SymbolMid + OperatorStroke) OperatorStroke
VBar x (SymbolMid - OperatorStroke / 3) (SymbolMid - OperatorStroke) OperatorStroke
foreach [{subclass left right} : items-of [ArrowBarConfig arrowExtend arrowheadsKern arrowJ false]] : begin
create-glyph "hyphen.lig.\(subclass)" : glyph-proc
foreach [{lS rS left right} : items-of [ArrowBarConfig arrowExtend arrowheadsKern arrowJ false]] : begin
create-glyph "hyphen.lig.\(lS)\(rS)" : glyph-proc
include : SetJoiningKind lS rS
include : HBar left right SymbolMid OperatorStroke
set currentGlyph.autoRefPriority (-3)
create-glyph "hyphen.lig.\(subclass).notched" : glyph-proc
create-glyph "hyphen.lig.\(lS)\(rS).notched" : glyph-proc
include : SetJoiningKind lS rS
include : difference
HBar left right SymbolMid OperatorStroke
if (left < SB) [HyphenNotch 0] [glyph-proc]
@ -74,10 +82,12 @@ glyph-block Symbol-Ligation : begin
local dblExtend : clamp 0 Width (RightSB - (dblArrowD - dblArrowSw / 2) * arrowheadSlope)
local dblArrowJ : clamp 0 Width (SB + (dblArrowD - dblArrowSw / 2) * arrowheadSlope)
foreach [{subclass left right} : items-of [ArrowBarConfig dblExtend arrowheadsKern dblArrowJ true]] : create-glyph ('equal.lig.' + subclass) : glyph-proc
include : HBarTop left right (SymbolMid + dblArrowD) dblArrowSw
include : HBarBottom left right (SymbolMid - dblArrowD) dblArrowSw
set currentGlyph.autoRefPriority (-3)
foreach {lS rS left right} [items-of : ArrowBarConfig dblExtend arrowheadsKern dblArrowJ true]
create-glyph "equal.lig.\(lS)\(rS)" : glyph-proc
include : SetJoiningKind lS rS
include : HBarTop left right (SymbolMid + dblArrowD) dblArrowSw
include : HBarBottom left right (SymbolMid - dblArrowD) dblArrowSw
set currentGlyph.autoRefPriority (-3)
do "Waves"
glyph-block-import Shared-Symbol-Shapes : CreateWaveShape
@ -109,6 +119,7 @@ glyph-block Symbol-Ligation : begin
j1 { J (Width + arrowJ + arrowheadsKern) true }
foreach [lS : items-of : Object.keys lk] : foreach [rS : items-of : Object.keys rk] : create-glyph"wave.lig.\(lS)\(rS)" : glyph-proc
include : SetJoiningKind lS rS
local {tL jL djL} lk.(lS)
local {tR jR djR} rk.(rS)
include : WaveShape
@ -197,27 +208,32 @@ glyph-block Symbol-Ligation : begin
glyph-block-import Symbol-Math-Relation-Equal : EqualShape EqualHole IdentShape IdentHole
define joiningOverlap (-Width / 6)
create-glyph 'equal.fc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : difference
EqualShape SB (Width - joiningOverlap)
EqualHole Width
create-glyph 'equal.cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
EqualShape joiningOverlap RightSB
EqualHole 0
create-glyph 'equal.jf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
EqualShape (RightSB - Width + joiningOverlap) RightSB
EqualHole 0
create-glyph 'equal.cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : difference
EqualShape joiningOverlap (Width - joiningOverlap)
EqualHole 0
EqualHole Width
create-glyph 'equal.fc+cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : difference
EqualShape (SB - Width) (Width - joiningOverlap)
EqualHole 0
@ -229,33 +245,39 @@ glyph-block Symbol-Ligation : begin
EqualHole 0
create-glyph 'equal.cc+cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
EqualShape (joiningOverlap - Width) RightSB
EqualHole (-Width)
EqualHole 0
create-glyph 'ident.fc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : difference
IdentShape SB (Width - joiningOverlap)
IdentHole Width
create-glyph 'ident.cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape joiningOverlap RightSB
IdentHole 0
create-glyph 'ident.jf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape (RightSB - Width + joiningOverlap) RightSB
IdentHole 0
create-glyph 'ident.cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : difference
IdentShape joiningOverlap (Width - joiningOverlap)
IdentHole 0
IdentHole Width
create-glyph 'ident.fc+cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : difference
IdentShape (SB - Width) (Width - joiningOverlap)
IdentHole 0
@ -267,6 +289,7 @@ glyph-block Symbol-Ligation : begin
IdentHole 0
create-glyph 'ident.cc+cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : difference
IdentShape (joiningOverlap - Width) RightSB
IdentHole (-Width)
@ -311,15 +334,18 @@ glyph-block Symbol-Ligation : begin
define [TrigRightShape shift] : GreaterShape (SymbolMid + dHTriangle) (SymbolMid - dHTriangle) (Width - trigRight + shift) (Width - trigLeft + shift)
create-glyph 'less.lig.trig' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : TrigLeftShape 0
create-glyph 'bar.lig.trig' : glyph-proc
include : VBar Middle (SymbolMid + dHTriangle + OperatorStroke) (SymbolMid - dHTriangle - OperatorStroke) OperatorStroke
create-glyph 'greater.lig.trig' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : TrigRightShape 0
create-glyph 'less.lig.diamond' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : intersection
TrigLeftShape 0
union
@ -327,6 +353,7 @@ glyph-block Symbol-Ligation : begin
TrigRightShape Width
create-glyph 'greater.lig.diamond' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : intersection
TrigRightShape 0
union
@ -336,12 +363,24 @@ glyph-block Symbol-Ligation : begin
do "Chaining Plus"
glyph-block-import Symbol-Math-Arith : PlusShape
create-glyph 'plus.lig.fc' : PlusShape SB (Width - O)
create-glyph 'plus.lig.fc.s' : PlusShape SB (Width - O) SB
create-glyph 'plus.lig.cc' : PlusShape O (Width - O)
create-glyph 'plus.lig.cf' : PlusShape O RightSB
create-glyph 'plus.lig.cf.s' : PlusShape O RightSB (-SB)
create-glyph 'plus.lig.zf' : PlusShape (-SB + O) RightSB
create-glyph 'plus.lig.fc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : PlusShape SB (Width - O)
create-glyph 'plus.lig.fc.s' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : PlusShape SB (Width - O) SB
create-glyph 'plus.lig.cc' : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : PlusShape O (Width - O)
create-glyph 'plus.lig.cf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : PlusShape O RightSB
create-glyph 'plus.lig.cf.s' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : PlusShape O RightSB (-SB)
create-glyph 'plus.lig.zf' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : PlusShape (-SB + O) RightSB
do 'Less / Greater as arrow'
create-glyph 'greaterArrow' : composite-proc

View file

@ -2,6 +2,7 @@ $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [Box] from '../../../support/box'
import [Joining] from '../../../support/gr'
import [DesignParameters] from '../../../meta/aesthetics'
import '../../../support/point' as Point
@ -418,15 +419,20 @@ glyph-block Symbol-Math-Relation-Inequality : begin
define l2 : l - Width
define r2 : r - Width
create-glyph 'less.lig2' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : LessShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) l r
create-glyph 'greater.lig2' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : GreaterShape (SymbolMid + dH + lessEqDist) (SymbolMid - dH + lessEqDist) l r
create-glyph 'eq.at-lteq.lig2.flat' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : HBar l2 r2 (SymbolMid - dH - lessEqDist) OperatorStroke
create-aliased-glyph 'eq.at-gteq.lig2.flat'
create-glyph 'eq.at-lteq.lig2.slanted' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : LessShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) l2 r2 OperatorStroke
create-glyph 'eq.at-gteq.lig2.slanted' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : GreaterShapeB (SymbolMid + dH - lessEqDist) (SymbolMid - dH - lessEqDist) l2 r2 OperatorStroke
select-variant 'eq.at-lteq.lig2'

View file

@ -2,6 +2,7 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [Joining] from '../../../support/gr'
import [DesignParameters] from '../../../meta/aesthetics'
glyph-module
@ -21,13 +22,17 @@ glyph-block Symbol-Punctuation-Bar : begin
include : ForceUpright
include : BarShape Middle 0
create-glyph 'ligBarInsideBracketLeft' : BarShape
[mix SB RightSB DesignParameters.bracketOutside] + HalfStroke * HVContrast
Stroke + [Math.max [AdviceStroke 5] (XH / 12)]
create-glyph 'ligBarInsideBracketLeft' : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : BarShape
[mix SB RightSB DesignParameters.bracketOutside] + HalfStroke * HVContrast
Stroke + [Math.max [AdviceStroke 5] (XH / 12)]
create-glyph 'ligBarInsideBracketRight' : BarShape
[mix RightSB SB DesignParameters.bracketOutside] - HalfStroke * HVContrast
Stroke + [Math.max [AdviceStroke 5] (XH / 12)]
create-glyph 'ligBarInsideBracketRight' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : BarShape
[mix RightSB SB DesignParameters.bracketOutside] - HalfStroke * HVContrast
Stroke + [Math.max [AdviceStroke 5] (XH / 12)]
define [DoubleBarShape] : glyph-proc
set-base-anchor 'above' Middle ParenTop

View file

@ -2,6 +2,7 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [Joining] from '../../../support/gr'
import [DesignParameters] from '../../../meta/aesthetics'
glyph-module
@ -134,7 +135,9 @@ glyph-block Symbol-Punctuation-Brackets : begin
refer-glyph 'bracketLeft'
MaskBelow SymbolMid
create-glyph 'ligExtBracketLeft' : BracketShape ParenTop ParenBot (Middle - HalfStroke * HVContrast) [mix SB RightSB DesignParameters.bracketInside]
create-glyph 'ligExtBracketLeft' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : BracketShape ParenTop ParenBot (Middle - HalfStroke * HVContrast) [mix SB RightSB DesignParameters.bracketInside]
create-glyph 'bracketLeftUpper' 0x23A1 : glyph-proc
include : ForceUpright
@ -175,13 +178,17 @@ glyph-block Symbol-Punctuation-Brackets : begin
turned 'bracketRight' ']' 'bracketLeft' Middle SymbolMid
turned 'bracketRightUHalf' 0x2E23 'bracketLeftLHalf' Middle SymbolMid
turned 'bracketRightLHalf' 0x2E25 'bracketLeftUHalf' Middle SymbolMid
turned 'ligExtBracketRight' null 'ligExtBracketLeft' Middle SymbolMid
turned 'bracketRightLower' 0x23A6 'bracketLeftUpper' Middle SymbolMid
turned 'bracketRightExtension' 0x23A5 'bracketLeftExtension' Middle SymbolMid
turned 'bracketRightUpper' 0x23A4 'bracketLeftLower' Middle SymbolMid
turned 'dblBracketRight' 0x27E7 'dblBracketLeft' Middle SymbolMid
turned 'bracketBarRight' 0x2046 'bracketBarLeft' Middle SymbolMid
create-glyph 'ligExtBracketRight' : glyph-proc
include [refer-glyph 'ligExtBracketLeft'] AS_BASE ALSO_METRICS
include : FlipAround Middle SymbolMid
Joining.set currentGlyph Joining.Classes.Left
define [BraceDim] : begin
local parenCenter [mix SB RightSB [mix DesignParameters.braceInside DesignParameters.braceOutside 0.5]]
local radius : Math.min
@ -247,6 +254,7 @@ glyph-block Symbol-Punctuation-Brackets : begin
include : BraceLowerHalfShape SymbolMid bot Stroke
create-glyph 'ligExtBraceLeft.straight' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : BraceUpperHalfShape top SymbolMid Stroke 1
include : BraceLowerHalfShape SymbolMid bot Stroke 1
@ -267,11 +275,15 @@ glyph-block Symbol-Punctuation-Brackets : begin
include : BraceExtensionShape top bot Stroke
turned 'braceRight.straight' null 'braceLeft.straight' Middle SymbolMid
turned 'ligExtBraceRight.straight' null 'ligExtBraceLeft.straight' Middle SymbolMid
turned 'braceRightLower' 0x23AD 'braceLeftUpper' Middle SymbolMid
turned 'braceRightUpper' 0x23AB 'braceLeftLower' Middle SymbolMid
turned 'braceRightMiddle' 0x23AC 'braceLeftMiddle' Middle SymbolMid
create-glyph 'ligExtBraceRight.straight' : glyph-proc
include [refer-glyph 'ligExtBraceLeft.straight'] AS_BASE ALSO_METRICS
include : FlipAround Middle SymbolMid
Joining.set currentGlyph Joining.Classes.Left
define [CurlyBraceShape sw pExt] : glyph-proc
local hs : sw / 2
local xIns : mix SB RightSB DesignParameters.braceInside
@ -305,10 +317,15 @@ glyph-block Symbol-Punctuation-Brackets : begin
straight.left.end xOus SymbolMid [heading Leftward]
create-glyph 'braceLeft.curly' : CurlyBraceShape Stroke 0
create-glyph 'ligExtBraceLeft.curly' : CurlyBraceShape Stroke 1
turned 'braceRight.curly' null 'braceLeft.curly' Middle SymbolMid
turned 'ligExtBraceRight.curly' null 'ligExtBraceLeft.curly' Middle SymbolMid
create-glyph 'ligExtBraceLeft.curly' : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : CurlyBraceShape Stroke 1
create-glyph 'ligExtBraceRight.curly' : glyph-proc
include [refer-glyph 'ligExtBraceLeft.curly'] AS_BASE ALSO_METRICS
include : FlipAround Middle SymbolMid
Joining.set currentGlyph Joining.Classes.Left
select-variant 'braceLeft' '{'
select-variant 'braceRight' '}'

View file

@ -2,6 +2,7 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [Joining] from '../../../support/gr'
import [DesignParameters] from '../../../meta/aesthetics'
glyph-module
@ -26,7 +27,9 @@ glyph-block Symbol-Punctuation-Dashes : begin
foreach { suffix { yBar } } [Object.entries UnderScoreConfig] : do
create-glyph "underscore.\(suffix)" : HBarBottom SB RightSB yBar
create-glyph "underscore.jr.\(suffix)" : HBarBottom (joiningOverlap - SB) RightSB yBar
create-glyph "underscore.jr.\(suffix)" : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
HBarBottom (joiningOverlap - SB) RightSB yBar
create-glyph "doubleUnderscore.\(suffix)" : composite-proc
HBarBottom SB RightSB yBar
HBarBottom SB RightSB (yBar - openBoxGap)

View file

@ -2,6 +2,7 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [Joining] from '../../../support/gr'
import [DesignParameters] from '../../../meta/aesthetics'
glyph-module
@ -48,6 +49,7 @@ glyph-block Symbol-Other-Phonetic : begin
foreach toneStart [range 4 downtill 0] : foreach toneEnd [range 4 downtill 0] : begin
create-glyph ('toneStart' + toneStart + toneEnd) : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : intersection
Rect CAP 0 Middle Width
dispiro
@ -55,6 +57,7 @@ glyph-block Symbol-Other-Phonetic : begin
corner (Width / 2) [yOfTone toneStart]
corner (Width + Width / 2) [yOfTone toneEnd]
create-glyph ('toneSandhiStart' + toneStart + toneEnd) : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : intersection
Rect CAP 0 Middle Width
dispiro
@ -65,6 +68,7 @@ glyph-block Symbol-Other-Phonetic : begin
foreach toneStart [range 4 downtill 0] : foreach toneEnd [range 4 downtill 0] : begin
create-glyph ('toneEnd' + toneStart + toneEnd) : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : intersection
Rect CAP 0 0 Middle
dispiro
@ -73,6 +77,7 @@ glyph-block Symbol-Other-Phonetic : begin
corner (Width + Width / 2) [yOfTone : mix toneStart toneEnd 2]
include : VBar Middle 0 CAP OperatorStroke
create-glyph ('toneSandhiEnd' + toneStart + toneEnd) : glyph-proc
Joining.set currentGlyph Joining.Classes.Left
include : intersection
Rect CAP 0 0 Width
dispiro
@ -82,6 +87,7 @@ glyph-block Symbol-Other-Phonetic : begin
foreach toneStart [range 4 downtill 0] : foreach toneMid [range 4 downtill 0] : foreach toneEnd [range 4 downtill 0] : begin
create-glyph ('toneMid' + toneStart + toneMid + toneEnd) : glyph-proc
Joining.set currentGlyph Joining.Classes.Mid
include : intersection
Rect CAP 0 0 Width
union
@ -104,3 +110,4 @@ glyph-block Symbol-Other-Phonetic : begin
corner (Width + Width / 2) [yOfTone toneEnd]
create-glyph ('toneSandhiMid' + toneStart + toneMid + toneEnd) : glyph-proc
include [refer-glyph ('toneMid' + toneStart + toneMid + toneEnd)] AS_BASE ALSO_METRICS
Joining.set currentGlyph Joining.Classes.Mid

View file

@ -2,6 +2,7 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../../support/utils'
import [Joining] from '../../../support/gr'
import [DesignParameters] from '../../../meta/aesthetics'
glyph-module
@ -124,13 +125,10 @@ glyph-block Symbol-Punctuation-Slashes-And-Number-Sign : begin
define l : SB - fine / 2
define r : RightSB + fine / 2
create-glyph "numberSign.\(suffix)" : union
FHBars l l r p
FVBars l l r p
create-glyph "numberSign.jr.\(suffix)" : union
FHBars (r - Width) l r p
FVBars (r - Width) l r p
create-glyph "numberSign.\(suffix)" : union [FHBars l l r p] [FVBars l l r p]
create-glyph "numberSign.jr.\(suffix)" : glyph-proc
Joining.set currentGlyph Joining.Classes.Right
include : union [FHBars (r - Width) l r p] [FVBars (r - Width) l r p]
select-variant 'numberSign' '#'
select-variant 'numberSign.jr' (follow -- 'numberSign')

View file

@ -108,6 +108,34 @@ const RequireCcmpDecompose = {
}
};
const Joining = {
get(glyph) {
if (glyph && glyph.related) return glyph.related.joining || 0;
else return 0;
},
set(glyph, cls) {
if (!glyph.related) glyph.related = {};
glyph.related.joining = cls;
},
amendOtName(baseName, cl) {
switch (cl) {
case Joining.Classes.Left:
return `${baseName}.join-l`;
case Joining.Classes.Right:
return `${baseName}.join-r`;
case Joining.Classes.Mid:
return `${baseName}.join-m`;
default:
return baseName;
}
},
Classes: {
Left: 1,
Right: 2,
Mid: 3
}
};
const CvTagCache = new Map();
function Cv(tag, rank) {
const key = tag + "#" + rank;
@ -363,6 +391,7 @@ exports.TieMark = TieMark;
exports.TieGlyph = TieGlyph;
exports.Radical = Radical;
exports.RequireCcmpDecompose = RequireCcmpDecompose;
exports.Joining = Joining;
exports.AnyDerivingCv = AnyDerivingCv;
exports.CcmpDecompose = CcmpDecompose;
exports.CvDecompose = CvDecompose;
@ -370,4 +399,4 @@ exports.createGrDisplaySheet = createGrDisplaySheet;
exports.DollarShrinkKernel = DollarShrinkKernel;
exports.DollarShorterBar = DollarShorterBar;
exports.MathSansSerif = MathSansSerif;
exports.SvInheritableRelations = [DollarShrinkKernel, DollarShorterBar];
exports.SvInheritableRelations = [DollarShrinkKernel, DollarShorterBar, Joining];

View file

@ -178,7 +178,8 @@ const FontInfoOf = computed.group("metadata:font-info-of", async (target, fileNa
derivingVariants: bp.derivingVariants,
featureControl: {
noCvSs: bp["no-cv-ss"] || false,
noLigation: bp["no-ligation"] || false
noLigation: bp["no-ligation"] || false,
exportGlyphNames: bp["export-glyph-names"] || false
},
// Ligations
ligations: bp.ligations || null,