Skip to content

Commit

Permalink
Merge branch 'prerelease'
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Sep 4, 2023
2 parents 8ce3d8d + 541f562 commit 1642489
Show file tree
Hide file tree
Showing 13 changed files with 720 additions and 649 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Modifications since last major version

### 26.3.2

* Remove duplicate serifed variant for LATIN SMALL LETTER N WITH LEFT HOOK (`U+0272`).
* Add special k-dot shape (#1978).


### 26.3.1

* Fix TTFA control generator to fix broken superscript letters (#1976).
Expand Down
2 changes: 2 additions & 0 deletions changes/26.3.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Remove duplicate serifed variant for LATIN SMALL LETTER N WITH LEFT HOOK (`U+0272`).
* Add special k-dot shape (#1978).
282 changes: 141 additions & 141 deletions doc/PACKAGE-LIST.md

Large diffs are not rendered by default.

912 changes: 456 additions & 456 deletions doc/packages-sha.txt

Large diffs are not rendered by default.

115 changes: 74 additions & 41 deletions font-src/gen/ttfa-controls/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,95 @@ import ttfaRanges from "../../generated/ttfa-ranges.mjs";
import * as Gr from "../../support/gr.mjs";
import { ArrayUtil } from "../../support/utils.mjs";

export async function generateTtfaControls(gsOrig, gs) {
export async function generateTtfaControls(gsOrig, gsTtf) {
let ttfaControls = [`# Machine generated. Do not modify.`];

for (const alignment of ttfaRanges) {
generateTTFAAlignments(ttfaControls, alignment, gsOrig, gs);
let alignments = [];
for (const cfg of ttfaRanges) {
const alignment = new Alignment(cfg.scriptTag, cfg.featureTag, cfg.ranges);
alignment.collectDefault(gsOrig, gsTtf);
alignments.push(alignment);
}

for (const go of gsOrig.glyphs()) {
const hc = Gr.HintClass.get(go);
if (!hc) continue;
const gd = gsTtf.queryBySourceGlyph(go);
if (!gd) continue;
const [s, f] = hc;
for (const alignment of alignments) {
if (s === alignment.scriptTag && f === alignment.featureTag)
alignment.allGlyphs.set(go, gd);
}
}

for (const alignment of alignments) {
alignment.extend(gsOrig, gsTtf);
alignment.write(ttfaControls, gsTtf);
}

return ttfaControls;
}

function generateTTFAAlignments(sink, alignment, gsOrig, gsTtf) {
let allGlyphs = new Map();
let defaultGlyphs = new Map();
for (const [lo, hi] of alignment.ranges) {
for (let lch = lo; lch <= hi; lch++) {
const go = gsOrig.queryByUnicode(lch);
if (!go) continue;
const gd = gsTtf.queryBySourceGlyph(go);
if (!gd) continue;
allGlyphs.set(go, gd);
defaultGlyphs.set(go, gd);
}
class Alignment {
constructor(scriptTag, featureTag, ranges) {
this.scriptTag = scriptTag;
this.featureTag = featureTag;
this.ranges = ranges;

this.defaultGlyphs = new Map();
this.allGlyphs = new Map();
}

for (;;) {
let sizeBefore = allGlyphs.size;

for (const [go, gd] of allGlyphs) {
const cvs = Gr.AnyCv.query(go);
for (const gr of cvs) {
const gnLinked = gr.get(go);
if (!gnLinked) continue;
const goLinked = gsOrig.queryByName(gnLinked);
if (!goLinked) continue;
const gdLinked = gsTtf.queryBySourceGlyph(goLinked);
if (!gdLinked) continue;
allGlyphs.set(goLinked, gdLinked);
collectDefault(gsOrig, gsTtf) {
for (const [lo, hi] of this.ranges) {
for (let lch = lo; lch <= hi; lch++) {
const go = gsOrig.queryByUnicode(lch);
if (!go) continue;
const gd = gsTtf.queryBySourceGlyph(go);
if (!gd) continue;
this.allGlyphs.set(go, gd);
this.defaultGlyphs.set(go, gd);
}
}

let sizeAfter = allGlyphs.size;
if (sizeAfter <= sizeBefore) break;
}

const gOrd = gsTtf.decideOrder();
let nonDefaultGlyphIndices = [];
for (const [go, gd] of allGlyphs) {
if (defaultGlyphs.has(go)) continue;
nonDefaultGlyphIndices.push(gOrd.reverse(gd));
extend(gsOrig, gsTtf) {
for (;;) {
let sizeBefore = this.allGlyphs.size;

for (const [go, gd] of this.allGlyphs) {
const cvs = Gr.AnyCv.query(go);
for (const gr of cvs) {
const gnLinked = gr.get(go);
if (!gnLinked) continue;
const goLinked = gsOrig.queryByName(gnLinked);
if (!goLinked) continue;
const gdLinked = gsTtf.queryBySourceGlyph(goLinked);
if (!gdLinked) continue;
this.allGlyphs.set(goLinked, gdLinked);
}
}

let sizeAfter = this.allGlyphs.size;
if (sizeAfter <= sizeBefore) break;
}
}

if (!nonDefaultGlyphIndices.length) return;
write(sink, gsTtf) {
const gOrd = gsTtf.decideOrder();
let nonDefaultGlyphIndices = [];
for (const [go, gd] of this.allGlyphs) {
if (this.defaultGlyphs.has(go)) continue;
nonDefaultGlyphIndices.push(gOrd.reverse(gd));
}

if (!nonDefaultGlyphIndices.length) return;

const glyphIndicesRangesStr = ArrayUtil.toRanges(nonDefaultGlyphIndices)
.map(([lo, hi]) => (lo === hi ? `${lo}` : `${lo}-${hi}`))
.join(", ");
const glyphIndicesRangesStr = ArrayUtil.toRanges(nonDefaultGlyphIndices)
.map(([lo, hi]) => (lo === hi ? `${lo}` : `${lo}-${hi}`))
.join(", ");

sink.push(`${alignment.scriptTag} ${alignment.featureTag} @ ${glyphIndicesRangesStr}`);
sink.push(`${this.scriptTag} ${this.featureTag} @ ${glyphIndicesRangesStr}`);
}
}
10 changes: 9 additions & 1 deletion font-src/glyphs/letter/latin/k.ptl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$$include '../../../meta/macros.ptl'

import [mix clamp fallback linreg SuffixCfg] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
import [Dotless CvDecompose MathSansSerif HintClass] from"../../../support/gr.mjs"
import [maskBit] from"../../../support/util/mask-bit.mjs"

glyph-module
Expand Down Expand Up @@ -583,6 +583,14 @@ glyph-block Letter-Latin-K : begin

select-variant 'grek/KaiSymbol' 0x3CF

derive-multi-part-glyphs 'kDot' null {'k' 'dotAbove'} : lambda [srcs gr] : glyph-proc
local { base mark } srcs
include : refer-glyph mark
include : Translate (Width + [HSwToV HalfStroke]) 0
include [refer-glyph base] AS_BASE
include : LeaningAnchor.Above.VBar.l Middle
HintClass.set currentGlyph 'latn' 'dflt'

glyph-block-import Letter-Blackboard : BBS BBD BBBarLeft
define [BBKLegShape top left right] : begin
local kDiag : DiagCorDs (top / 2) (right - left) BBD
Expand Down
13 changes: 13 additions & 0 deletions font-src/otl/gsub-ccmp.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin
inputEnds 3
apply {{.at 1 .lookup lookupTieMarkLigature}}

Ccmp-Group "Special dot-above transformation" : begin
# b-dot, d-dot, h-dot, k-dot
export-lookup : AddLookup sink : object
.type 'gsub_ligature'
.ignoreGlyphs [filterMarkByClassNegated markGlyphs 'above']
.substitutions : list
object [from : list "b" "dotAbove"] [to "bDot"]
object [from : list "d" "dotAbove"] [to "dDot"]
object [from : list "h" "dotAbove"] [to "hDot"]
object [from : list "k" "dotAbove"] [to "kDot"]

Ccmp-Group "Leaning Mark Trasnform" : begin
define LeaningAnchorMap : list
list 'above' 'leaningAbove'
Expand Down Expand Up @@ -137,6 +148,8 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin
.inputEnds 2
.apply {{.at 1 .lookup lookupTurnMarkIntoLeaningAndSpacer}}



Ccmp-Group "Rhotic Hook Transform" : begin
define superscripts {}
define subscripts {}
Expand Down
11 changes: 11 additions & 0 deletions font-src/support/gr.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ export const Joining = {
}
};

export const HintClass = {
get(glyph) {
if (glyph && glyph.related) return glyph.related.hintClass;
else return null;
},
set(glyph, script, style) {
if (!glyph.related) glyph.related = {};
glyph.related.hintClass = [script, style];
}
};

///////////////////////////////////////////////////////////////////////////////////////////////////

const CvTagCache = new Map();
Expand Down
5 changes: 2 additions & 3 deletions images/button-release.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions images/button-release.light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iosevka",
"version": "26.3.1",
"version": "26.3.2",
"main": "./font-src/index.js",
"scripts": {
"build": "verda -f verdafile.mjs",
Expand Down
2 changes: 1 addition & 1 deletion params/variants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2950,7 +2950,7 @@ disableIf = [ { body = "NOT normal", terminal = "tailed" } ]
selectorAffix.n = "motionSerifed"
selectorAffix."n/sansSerif" = "serifless"
selectorAffix."n/descBase" = { if = [{ body = "normal" }], then = "topLeftSerifed", else = "serifless" }
selectorAffix."n/lTailBase" = "motionSerifed"
selectorAffix."n/lTailBase" = { if = [{ terminal = "straight" }], then = "motionSerifed", else = { if = [{ body = "normal" }], then = "topLeftSerifed", else = "serifless" } }
selectorAffix.eng = { if = [{ body = "normal" }], then = "topLeftSerifed", else = "serifless" }
selectorAffix."eng/phoneticRight" = { if = [{ body = "normal" }], then = "topLeftSerifed", else = "serifless" }
selectorAffix."grek/eta" = { if = [{ body = "normal" }], then = "topLeftSerifed", else = "serifless" }
Expand Down

0 comments on commit 1642489

Please sign in to comment.