From 8b6eca028c4fa44f22674481951a897f82747706 Mon Sep 17 00:00:00 2001 From: be5invis Date: Sun, 6 Oct 2024 16:18:08 -0700 Subject: [PATCH 1/3] Add IJ-acute ligatures (#2483). --- changes/31.8.1.md | 1 + .../font-glyphs/src/auto-build/composite.ptl | 9 ++++++++- .../font-glyphs/src/letter/latin/lower-il.ptl | 2 ++ .../font-glyphs/src/letter/latin/lower-j.ptl | 2 ++ .../font-glyphs/src/letter/latin/upper-i.ptl | 2 ++ .../font-glyphs/src/letter/latin/upper-j.ptl | 3 +++ packages/font-otl/src/gsub-ccmp.ptl | 17 +++++++++++++---- packages/glyph/src/relation.mjs | 1 + packages/glyph/src/store.mjs | 10 ++++++++++ 9 files changed, 42 insertions(+), 5 deletions(-) diff --git a/changes/31.8.1.md b/changes/31.8.1.md index 09d46eedef..7d53372496 100644 --- a/changes/31.8.1.md +++ b/changes/31.8.1.md @@ -4,3 +4,4 @@ * Optimize glyphs for Volapük Ae/Oe/Ue (`U+A79A`..`U+A79F`). * Optimize glyph for Cyrillic Lower Dzze (`U+A689`) under italics. * Allowed customizing menu WWS value to name map (#2488). +* Add IJ-acute ligatures (#2483). diff --git a/packages/font-glyphs/src/auto-build/composite.ptl b/packages/font-glyphs/src/auto-build/composite.ptl index c604acd28d..327e270322 100644 --- a/packages/font-glyphs/src/auto-build/composite.ptl +++ b/packages/font-glyphs/src/auto-build/composite.ptl @@ -2,7 +2,7 @@ $$include '../meta/macros.ptl' import [mix linreg clamp fallback] from "@iosevka/util" -import [getGrMesh AnyCvOrCherryPicking CvDecompose Joining hashCv IsCompositeOrLigature] from "@iosevka/glyph/relation" +import [getGrMesh AnyCvOrCherryPicking CvDecompose Joining hashCv IsCompositeOrLigature NLDAcuteVariant] from "@iosevka/glyph/relation" import [hashGeometry] from "@iosevka/geometry" import [Transform] from "@iosevka/geometry/transform" extern Map @@ -1437,10 +1437,17 @@ glyph-block Autobuild-Ligatures : begin applyRelations jobs.relApplications + # Dutch IJ define ijShrink : clamp 0.6 0.75 : StrokeWidthBlend 0.6 0.75 createLigatures 'compatLigature1' ijShrink ijShrink 1 1 [if (para.diversityI < 1) 0 0.2] : list list 0x132 { 'I' 'J' } list 0x133 { 'i' 'j' } + list 0xEF11 { 'IAcute' 'JAcute' } + list 0xEF12 { 'iAcute' 'jAcute' } + + # Link Gr for acuted variants + NLDAcuteVariant.set [glyphStore.queryByUnicodeEnsured 0x132] [glyphStore.queryNameByUnicodeEnsured 0xEF11] + NLDAcuteVariant.set [glyphStore.queryByUnicodeEnsured 0x133] [glyphStore.queryNameByUnicodeEnsured 0xEF12] define stdShrink : clamp 0.75 0.9 : StrokeWidthBlend 0.75 0.9 createLigatures 'compatLigature2' stdShrink stdShrink 1 1 0 : list diff --git a/packages/font-glyphs/src/letter/latin/lower-il.ptl b/packages/font-glyphs/src/letter/latin/lower-il.ptl index b070d0d4dd..765bce69f1 100644 --- a/packages/font-glyphs/src/letter/latin/lower-il.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-il.ptl @@ -327,6 +327,8 @@ glyph-block Letter-Latin-Lower-I : begin CreateAccentedComposition 'iBarOver' 0x268 'dotlessiBarOver' 'tittleAbove' CreateAccentedComposition 'iRetroflexHook' 0x1D96 'dotlessiRetroflexHook' 'tittleAbove' + CreateAccentedComposition 'iAcute' 0xED 'dotlessi' 'acuteAbove' + do "l glyphs" select-variant 'l' 'l' link-reduced-variant 'l/sansSerif' 'l' MathSansSerif diff --git a/packages/font-glyphs/src/letter/latin/lower-j.ptl b/packages/font-glyphs/src/letter/latin/lower-j.ptl index ad502922b3..a3500e154d 100644 --- a/packages/font-glyphs/src/letter/latin/lower-j.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-j.ptl @@ -149,6 +149,8 @@ glyph-block Letter-Latin-Lower-J : begin select-variant 'dotlessjCurlyTail' CreateAccentedComposition 'jCurlyTail' 0x29D 'dotlessjCurlyTail' 'tittleAbove' + CreateAccentedComposition 'jAcute' null 'dotlessj' 'acuteAbove' + create-glyph 'mathbb/dotlessj' : glyph-proc include : MarkSet.p local center : Middle + JBalance + BBD / 2 diff --git a/packages/font-glyphs/src/letter/latin/upper-i.ptl b/packages/font-glyphs/src/letter/latin/upper-i.ptl index 6ceaa4a80d..73be3e8a7e 100644 --- a/packages/font-glyphs/src/letter/latin/upper-i.ptl +++ b/packages/font-glyphs/src/letter/latin/upper-i.ptl @@ -62,6 +62,8 @@ glyph-block Letter-Latin-Upper-I : begin select-variant 'ISideways' 0xA7F7 (follow -- 'I') select-variant 'ILonga' 0xA7FE (follow -- 'I') + CreateAccentedComposition 'IAcute' 0xCD 'I' 'acuteAbove' + create-glyph 'smcpI' 0x26A : glyph-proc local df : include : DivFrame para.diversityI include : df.markSet.e diff --git a/packages/font-glyphs/src/letter/latin/upper-j.ptl b/packages/font-glyphs/src/letter/latin/upper-j.ptl index 18d0b46255..b11a46d05e 100644 --- a/packages/font-glyphs/src/letter/latin/upper-j.ptl +++ b/packages/font-glyphs/src/letter/latin/upper-j.ptl @@ -8,6 +8,7 @@ glyph-module glyph-block Letter-Latin-Upper-J : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives + glyph-block-import Letter-Shared : CreateAccentedComposition glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth glyph-block-import Letter-Blackboard : BBS BBD glyph-block-import Letter-Latin-Lower-J : FlatHookDotlessJShape @@ -149,6 +150,8 @@ glyph-block Letter-Latin-Upper-J : begin alias 'grek/Yot' 0x37F 'J' select-variant 'JCurlyTail' 0xA7B2 + CreateAccentedComposition 'JAcute' null 'J' 'acuteAbove' + create-glyph 'mathbb/J' 0x1D541 : glyph-proc local hookx (0.75 * SB) diff --git a/packages/font-otl/src/gsub-ccmp.ptl b/packages/font-otl/src/gsub-ccmp.ptl index 123cd83852..c0650ae173 100644 --- a/packages/font-otl/src/gsub-ccmp.ptl +++ b/packages/font-otl/src/gsub-ccmp.ptl @@ -1,9 +1,10 @@ $$include './meta/macros.ptl' import [UkMapToLookup UkLigatureToLookup] from "./table-util.mjs" -import [Dotless TieMark TieGlyph OgonekTrY IsSuperscript IsSubscript LeaningMark LeaningMarkSpacer] from "@iosevka/glyph/relation" +import [Dotless TieMark TieGlyph OgonekTrY IsSuperscript IsSubscript LeaningMark LeaningMarkSpacer NLDAcuteVariant] from "@iosevka/glyph/relation" import as UnicodeKnowledge from "@iosevka/font-glyphs/unicode-knowledge" +extern Map extern Set define-macro Ccmp-Group : syntax-rules @@ -42,7 +43,6 @@ export : define [buildCCMP gsub glyphStore markGlyphs] : begin export-lookup combineLookup Ccmp-Group "Mark transforms" : begin - define groupGrekUpperTonos {} define groupLF {} define dotlessFrom {} @@ -121,6 +121,17 @@ export : define [buildCCMP gsub glyphStore markGlyphs] : begin object [from : list "h" "dotAbove"] [to "hDot"] object [from : list "k" "dotAbove"] [to "kDot"] + Ccmp-Group "IJ-Acute composites" : begin + local substitutions {} + foreach { gn g } [glyphStore.namedEntries] : begin + local nldVariant : NLDAcuteVariant.get g + if nldVariant : substitutions.push + object [from : list gn 'acuteAbove'] [to nldVariant] + + export-lookup : gsub.createLookup : object + .type 'gsub_ligature' + .substitutions substitutions + Ccmp-Group "Leaning Mark Trasnform" : begin define LeaningAnchorMap : list list 'above' 'leaningAbove' @@ -155,8 +166,6 @@ export : define [buildCCMP gsub glyphStore markGlyphs] : begin .inputEnds 2 .apply {{.at 1 .lookup lookupTurnMarkIntoLeaningAndSpacer}} - - Ccmp-Group "Rhotic Hook Transform" : begin define superscripts {} define subscripts {} diff --git a/packages/glyph/src/relation.mjs b/packages/glyph/src/relation.mjs index 88c5890c11..8e2db1aca1 100644 --- a/packages/glyph/src/relation.mjs +++ b/packages/glyph/src/relation.mjs @@ -23,6 +23,7 @@ export const VS01 = LinkedGlyphProp("VS01"); export const TieMark = LinkedGlyphProp("TieMark"); export const LeaningMark = LinkedGlyphProp("LeaningMark"); export const LeaningMarkSpacer = LinkedGlyphProp("LeaningMarkSpacer"); +export const NLDAcuteVariant = LinkedGlyphProp("NLDAcuteVariant"); export const LocalizedForm = { SRB: { diff --git a/packages/glyph/src/store.mjs b/packages/glyph/src/store.mjs index 68e135cff2..9c90b963fd 100644 --- a/packages/glyph/src/store.mjs +++ b/packages/glyph/src/store.mjs @@ -88,11 +88,21 @@ export class GlyphStore { queryByUnicode(u) { return this.encodingForward.get(u); } + queryByUnicodeEnsured(u) { + const g = this.encodingForward.get(u); + if (!g) throw new Error(`Glyph for Unicode ${u} doesn't exist.`); + return g; + } queryNameByUnicode(u) { const g = this.queryByUnicode(u); if (!g) return undefined; return this.queryNameOf(g); } + queryNameByUnicodeEnsured(u) { + const g = this.queryByUnicode(u); + if (!g) throw new Error(`Glyph for Unicode ${u} doesn't exist.`); + return this.queryNameOf(g); + } queryUnicodeOf(g) { const s = this.encodingBackward.get(g); if (!s || !s.size) return null; From c1063d7422749f7361a6e0670b94730dbafbbf72 Mon Sep 17 00:00:00 2001 From: be5invis Date: Sun, 6 Oct 2024 16:18:34 -0700 Subject: [PATCH 2/3] Doc --- changes/31.8.1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changes/31.8.1.md b/changes/31.8.1.md index 7d53372496..da9b4de01b 100644 --- a/changes/31.8.1.md +++ b/changes/31.8.1.md @@ -1,7 +1,7 @@ +* Add IJ-acute ligatures (#2483). +* Allowed customizing menu WWS value to name map (#2488). * Optimize glyphs for `rounded-serifless` and `rounded-serifed` variants for Capital Eszett (`ẞ`). * Optimize glyphs for closed epsilon shapes (`U+025E`, `U+029A`). * Optimize glyphs for cursive variants for Greek Lower Beta (`β`) and Cyrillic Lower Ve (`в`). * Optimize glyphs for Volapük Ae/Oe/Ue (`U+A79A`..`U+A79F`). * Optimize glyph for Cyrillic Lower Dzze (`U+A689`) under italics. -* Allowed customizing menu WWS value to name map (#2488). -* Add IJ-acute ligatures (#2483). From c19a503c51df8b0d01828f18c32dec6319246d4b Mon Sep 17 00:00:00 2001 From: be5invis Date: Sun, 6 Oct 2024 16:20:48 -0700 Subject: [PATCH 3/3] Now 0xEF## is no longer just dingbats --- tools/data-export/src/coverage-export/block-data.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/data-export/src/coverage-export/block-data.mjs b/tools/data-export/src/coverage-export/block-data.mjs index 838802ef5f..43bbe13376 100644 --- a/tools/data-export/src/coverage-export/block-data.mjs +++ b/tools/data-export/src/coverage-export/block-data.mjs @@ -4,7 +4,7 @@ export async function collectBlockData() { const BlockData = [ [[0xe0a0, 0xe0df], "Private Use Area — Powerline"], [[0xee00, 0xee0f], "Private Use Area — Progress Bar"], - [[0xef10, 0xef1f], "Private Use Area — Iosevka Private Dingbats"], + [[0xef10, 0xef1f], "Private Use Area — Iosevka Privates"], ]; for (const id of UnicodeDataIndex.Block) {