Fix the metrics of wide characters, making Extended families compatible with FontConfig’s “dual” width (#1247).

This commit is contained in:
be5invis 2021-11-05 18:52:11 -07:00
parent 8270d53730
commit 81827f16ba
15 changed files with 14 additions and 8 deletions

View file

@ -1,3 +0,0 @@
* Change the shape of Eng (`U+014A`) into "N with Hook", to follow Unicode code chart (#1239).
* Increase shoulder arc thickness of lowercase `r` for better thickness contrast (#1243).
* Fixed width and removal logic for Long Leftwards Arrow (`U+27F5`) and Long Rightwards Arrow (`U+27F6`) (#1245).

4
changes/11.0.0.md Normal file
View file

@ -0,0 +1,4 @@
* \[**Breaking**\] Fix the metrics of wide characters, making Extended families compatible with FontConfigs “dual” width (#1247).
* \[**Breaking**\] Fixed width and removal logic for Long Leftwards Arrow (`U+27F5`) and Long Rightwards Arrow (`U+27F6`) (#1245).
* Change the shape of Eng (`U+014A`) into "N with Hook", to follow Unicode code chart (#1239).
* Increase shoulder arc thickness of lowercase `r` for better thickness contrast (#1243).

View file

@ -31,11 +31,16 @@ function assignSubRank(glyphStore) {
// (AW > 0) have the same width. We use this method to validate whether our "Fixed" subfamilies
// are properly built.
function validateMonospace(para, glyphStore) {
if (!para.forceMonospace) return;
let awSet = new Set();
for (const [u, g] of glyphStore.encodedEntries()) {
const aw = Math.round(g.advanceWidth || 0);
if (aw > 0) awSet.add(aw);
}
if (awSet.size > 1) throw new Error("Unreachable! Fixed variant has wide characters");
if (para.forceMonospace && awSet.size > 1) {
throw new Error("Unreachable! Fixed variant has wide characters");
}
if (!para.isQuasiProportional && awSet.size > 2) {
console.log(awSet);
throw new Error("Unreachable! Fixed variant has wide characters");
}
}

View file

@ -123,7 +123,7 @@ export : define [calculateMetrics para] : begin
define OneBalance : fallback para.onebalance 0
# derived metrics
define WideWidth0 : if para.isQuasiProportional (Width * 2) UPM
define WideWidth0 : if para.isQuasiProportional UPM (Width * 2)
define WideWidth1 : if (para.spacing >= 1) WideWidth0 Width
define WideWidth2 : if (para.spacing >= 2) WideWidth0 Width
define WideWidth3 : if (para.spacing >= 3) WideWidth0 Width

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "iosevka",
"version": "10.4.0",
"version": "11.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "iosevka",
"version": "10.4.0",
"version": "11.0.0",
"main": "./font-src/index.js",
"scripts": {
"build": "node utility/ensure-verda-exists && verda -f verdafile.js",