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

Add IJ-acute ligatures (#2483) #2536

Merged
merged 3 commits into from
Oct 7, 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
3 changes: 2 additions & 1 deletion changes/31.8.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +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).
9 changes: 8 additions & 1 deletion packages/font-glyphs/src/auto-build/composite.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/font-glyphs/src/letter/latin/lower-il.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/font-glyphs/src/letter/latin/lower-j.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/font-glyphs/src/letter/latin/upper-i.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions packages/font-glyphs/src/letter/latin/upper-j.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
17 changes: 13 additions & 4 deletions packages/font-otl/src/gsub-ccmp.ptl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {}
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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 {}
Expand Down
1 change: 1 addition & 0 deletions packages/glyph/src/relation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
10 changes: 10 additions & 0 deletions packages/glyph/src/store.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tools/data-export/src/coverage-export/block-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down