Skip to content

Commit e96db79

Browse files
committed
r0.15.4
1 parent 26390c9 commit e96db79

331 files changed

Lines changed: 39 additions & 33 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"familyOrder": ["gothic", "ui", "mono", "mono-slab", "term", "term-slab", "fixed", "fixed-slab"],
44
"families": {
55
"gothic": {
6-
"isMono": false,
76
"isTNUM": true,
7+
"isGothic": true,
88
"latinGroup": "Inter",
99
"naming": {
1010
"en_US": "Sarasa Gothic",
@@ -16,9 +16,8 @@
1616
}
1717
},
1818
"ui": {
19-
"isPWID": true,
2019
"isTNUM": true,
21-
"isMono": false,
20+
"isPWID": true,
2221
"latinGroup": "Inter",
2322
"naming": {
2423
"en_US": "Sarasa UI",
@@ -31,7 +30,6 @@
3130
},
3231
"mono": {
3332
"isMono": true,
34-
"isType": true,
3533
"latinGroup": "iosevka",
3634
"naming": {
3735
"en_US": "Sarasa Mono",
@@ -44,8 +42,8 @@
4442
},
4543
"term": {
4644
"isMono": true,
47-
"latinGroup": "iosevka-term",
4845
"isTerm": true,
46+
"latinGroup": "iosevka-term",
4947
"naming": {
5048
"en_US": "Sarasa Term",
5149
"zh_CN": "Sarasa Term",
@@ -57,8 +55,8 @@
5755
},
5856
"fixed": {
5957
"isMono": true,
60-
"latinGroup": "iosevka-fixed",
6158
"isTerm": true,
59+
"latinGroup": "iosevka-fixed",
6260
"naming": {
6361
"en_US": "Sarasa Fixed",
6462
"zh_CN": "Sarasa Fixed",

make/common/unicode-kind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exports.isKorean = c =>
2424
(c >= 0xa960 && c <= 0xa97f) ||
2525
(c >= 0xd7b0 && c <= 0xd7ff);
2626

27-
exports.isWS = function (c, _isType = false, isTerm = false) {
27+
exports.isWS = function (c) {
2828
return c >= 0x20a0 && c < 0x3000 && !(c >= 0x2e3a && c <= 0x2e3b);
2929
};
3030

make/punct/as.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = async function makeFont(ctx, config, argv) {
2323
!isWestern(c - 0) &&
2424
!isKorean(c - 0) &&
2525
!isLongDash(c - 0, argv.term) &&
26-
!isWS(c - 0, argv.type, argv.term)
26+
!isWS(c - 0)
2727
);
2828

2929
if (argv.pwid) {
@@ -33,7 +33,11 @@ module.exports = async function makeFont(ctx, config, argv) {
3333
await ctx.run(manip.glyph, "b", unlinkRefsOfSymbols, argv.term);
3434
transferMonoGeometry(ctx.items.a, ctx.items.b);
3535
await ctx.run(manip.glyph, "a", populatePwidOfMono);
36-
await ctx.run(manip.glyph, "a", sanitizeSymbols, argv.type);
36+
}
37+
if (!argv.pwid) {
38+
await ctx.run(manip.glyph, "a", sanitizeSymbols, argv.goth, !argv.pwid && !argv.term);
39+
}
40+
if (argv.mono) {
3741
removeDashCcmp(ctx.items.a, argv.mono);
3842
}
3943
removeUnusedFeatures(ctx.items.a, "AS", argv.mono);

make/punct/common.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,33 @@ sanitizers.half = function (glyph) {
3232
glyph.advanceWidth = targetW;
3333
return glyph;
3434
};
35-
sanitizers.halfLeft = function (glyph, gid) {
35+
sanitizers.halfLeft = function (glyph, gid, isGothic) {
3636
const g1 = sanitizers.half.call(this, this.find.glyph$(this.find.gname.subst("pwid", gid)));
3737
Object.assign(glyph, g1);
3838
deleteGPOS(this.font, gid);
39+
if (isGothic) glyph.advanceWidth = this.em;
3940
return glyph;
4041
};
41-
sanitizers.halfRight = function (glyph, gid) {
42+
sanitizers.halfRight = function (glyph, gid, isGothic) {
4243
const g1 = sanitizers.half.call(this, this.find.glyph$(this.find.gname.subst("pwid", gid)));
4344
Object.assign(glyph, g1);
4445
deleteGPOS(this.font, gid);
46+
if (isGothic) {
47+
glyph.advanceWidth = this.em;
48+
for (let c of glyph.contours) for (let z of c) z.x += this.em / 2;
49+
}
4550
return glyph;
4651
};
4752

4853
function HalfCompN(n, forceFullWidth, forceHalfWidth) {
49-
return function (glyph, gid, isType = false) {
54+
return function (glyph, gid, isGothic, isType) {
5055
const g1 = this.find.glyph$(this.find.gname.subst("fwid", gid));
5156
Object.assign(glyph, g1);
5257
const targetW = Math.min(
5358
this.em * n,
5459
Math.ceil(glyph.advanceWidth / this.em) *
55-
(this.em * (forceHalfWidth ? 1 / 2 : isType || forceFullWidth ? 1 : 1 / 2))
60+
(this.em *
61+
(forceHalfWidth ? 1 / 2 : isGothic || isType || forceFullWidth ? 1 : 1 / 2))
5662
);
5763
if (glyph.contours) {
5864
for (let c of glyph.contours) for (let z of c) z.x *= targetW / glyph.advanceWidth;
@@ -83,7 +89,7 @@ const sanitizerTypes = {
8389
"\u2e3b": "halfComp3"
8490
};
8591

86-
exports.sanitizeSymbols = async function sanitizeSymbols(isType) {
92+
exports.sanitizeSymbols = async function sanitizeSymbols(isGothic, isType) {
8793
let san = new Map();
8894
for (let c in this.font.cmap) {
8995
if (!this.font.cmap[c]) continue;
@@ -94,7 +100,7 @@ exports.sanitizeSymbols = async function sanitizeSymbols(isType) {
94100
let sanitizer = sanitizers[san.has(g) ? san.get(g) : "auto"];
95101
const glyph = this.font.glyf[g];
96102
if (!glyph) continue;
97-
sanitizer.call(this, glyph, g, isType);
103+
sanitizer.call(this, glyph, g, isGothic, isType);
98104
}
99105
};
100106

make/punct/ws.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ module.exports = async function makeFont(ctx, config, argv) {
2626
!isWestern(c - 0) &&
2727
!isKorean(c - 0) &&
2828
!isLongDash(c - 0, argv.term) &&
29-
isWS(c - 0, argv.type, argv.term)
29+
isWS(c - 0)
3030
);
3131

3232
if (argv.pwid) {
3333
await ctx.run(manip.glyph, "a", toPWID);
3434
}
3535
if (argv.mono) {
36-
await ctx.run(manip.glyph, "a", sanitizeSymbols, argv.type);
36+
await ctx.run(manip.glyph, "a", sanitizeSymbols, argv.goth, !argv.pwid && !argv.term);
3737
}
3838
removeUnusedFeatures(ctx.items.a, "WS", argv.mono);
3939
gc(ctx.items.a);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sarasa-gothic",
3-
"version": "0.15.3",
3+
"version": "0.15.4",
44
"main": "./run",
55
"dependencies": {
66
"@chlorophytum/cli": "^0.20.0",

0 commit comments

Comments
 (0)