Add diamond-shaped zero (#1727).

This commit is contained in:
be5invis 2023-07-08 02:04:44 -07:00
parent 3d61c565b4
commit 46876e115b
7 changed files with 65 additions and 38 deletions

View file

@ -9,6 +9,7 @@
- `micro-sign`.`tailed``micro-sign`.`tailed-serifless`
- `micro-sign`.`toothless-corner``micro-sign`.`toothless-corner-serifless`
- `micro-sign`.`toothless-rounded``micro-sign`.`toothless-rounded-serifless`
* Add diamond-shaped zero (#1727).
* Add tailless bar, earless corner, and earless corner tailed variants for Greek Alpha (`U+03B1`).
* Add bottom serifed variant for Greek Gamma (`U+0393`).
* Add serifed variants for Greek Mu (`U+03BC`).

View file

@ -3,7 +3,7 @@ import zlib from "zlib";
import { encode, decode } from "@msgpack/msgpack";
const Edition = 27;
const Edition = 28;
const MAX_AGE = 16;
class GfEntry {
constructor(age, value) {

View file

@ -624,6 +624,8 @@ glyph-block AutoBuild-Enclosure : begin
define [digitGlyphNames j] : begin
return : [(j+'').split ''].map: c => [glyphStore.queryNameOfUnicode (['0'.charCodeAt 0] + (c - 0))]
define [digitHasSerif d] : not (d == 6 || d == 8 || d == 9)
do "Single-digit circled"
local compositions : list
list 0xA9 {'C'} WideWidth2
@ -631,11 +633,10 @@ glyph-block AutoBuild-Enclosure : begin
list 0x2117 {'P'} WideWidth2
list 0x1F1AD {'M'} WideWidth2
list 0x24EA {'zero.lnum'} WideWidth1
list 0x1F10B {'zero.lnum'} WideWidth1 # We don't have serifs for digit 0, so make an alias here
list 0x1F10D {'zero.lnum/forceSlashed'} WideWidth2
foreach [j : range 1 till 9] : compositions.push : list
0x2460 + j - 1
digitGlyphNames j
begin WideWidth1
foreach [j : range 1 till 9] : compositions.push : list (0x2460 + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 1 till 9] : if [not : digitHasSerif j] : compositions.push : list (0x2780 + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 0 26] : compositions.push {(0x24B6 + j) {[glyphStore.queryNameOfUnicode (['A'.charCodeAt 0] + j)]} WideWidth1}
foreach [j : range 0 26] : compositions.push {(0x24D0 + j) {[glyphStore.queryNameOfUnicode (['a'.charCodeAt 0] + j)]} WideWidth1 0.5 (XH/2)}
createCircledGlyphs 1 compositions
@ -652,8 +653,7 @@ glyph-block AutoBuild-Enclosure : begin
do "Single-digit sans-serif circled"
local compositions : list
list 0x1F10B {'zero.lnum'} WideWidth1
foreach [j : range 1 till 9] : compositions.push : list (0x2780 + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 1 till 9] : if [digitHasSerif j] : compositions.push : list (0x2780 + j - 1) [digitGlyphNames j] WideWidth1
createSansSerifCircledGlyphs 1 compositions
do "Double-digit circled"
@ -675,14 +675,15 @@ glyph-block AutoBuild-Enclosure : begin
do "Single-digit inset circled"
local compositions : list
list 0x24FF {'zero.lnum'} WideWidth1
list 0x1F10C {'zero.lnum'} WideWidth1 # We don't have serifs for digit 0, so make an alias here
foreach [j : range 1 till 9] : compositions.push : list (0x2776 + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 1 till 9] : if [not : digitHasSerif j] : compositions.push : list (0x278A + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 0 26] : compositions.push {(0x1F150 + j) {[glyphStore.queryNameOfUnicode (['A'.charCodeAt 0] + j)]} WideWidth1}
createInsetCircledGlyphs 1 compositions
do "Single-digit inset sans-serif circled"
local compositions : list
list 0x1F10C {'zero.lnum'} WideWidth1
foreach [j : range 1 till 9] : compositions.push : list (0x278A + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 1 till 9] : if [digitHasSerif j] : compositions.push : list (0x278A + j - 1) [digitGlyphNames j] WideWidth1
createInsetSansSerifCircledGlyphs 1 compositions
do "Double-digit inset circled"

View file

@ -28,27 +28,43 @@ glyph-block Digits-Zero : begin
close
define [DiamondShapeT sink t b l r] : begin
local mx : mix l r 0.5
local my : mix b t 0.5
local p1 0.2
local p2 0.1
local sw : AdviceStroke 8
local fine : AdviceStroke 3
local body : AdviceStroke 2
local sw1 fine
local sw2 : mix body fine 0.375
local mxb : [mix l r 0.5] + CorrectionOMidX * fine
local mxt : [mix l r 0.5] - CorrectionOMidX * fine
local myl : YSmoothMidL t b
local myr : YSmoothMidR t b
local p1 : 0.45 + 0.8 * (fine / (r - l))
local p2 : 0.15 + 0.5 * (fine / (t - b))
local p3 : 0.35 + 0.8 * (body / (t - b))
local p4 : 0.15 + 0.0 * (body / (r - l))
local pcx 0.5
local pcy 0.1
return : sink
widths.rhs sw
g4 (mx + CorrectionOMidX * sw) (b + O)
flat [mix mx r p1] [mix b my p2]
curl [mix mx r (1 - p2)] [mix b my (1 - p1)]
g4 (r - O) my
flat [mix r mx p2] [mix my t p1]
curl [mix r mx (1 - p1)] [mix my t (1 - p2)]
g4 (mx + CorrectionOMidX * sw) (t - O)
flat [mix mx l p1] [mix t my p2]
curl [mix mx l (1 - p2)] [mix t my (1 - p1)]
g4 (l + O) my
flat [mix l mx p2] [mix my b p1]
curl [mix l mx (1 - p1)] [mix my b (1 - p2)]
g2.right.mid.r mxb (b + O) [widths.lhs fine]
alsoThru.g2 pcx pcy
flat [mix mxb r p1] [mix b myr p2] [widths.lhs sw1]
curl [mix mxb r (1 - p4)] [mix b myr (1 - p3)] [widths.lhs sw2]
g2.up.mid (r - O) myr [widths.lhs body]
flat [mix r mxt p4] [mix myr t p3] [widths.lhs sw2]
curl [mix r mxt (1 - p1)] [mix myr t (1 - p2)] [widths.lhs sw1]
alsoThru.g2 (1 - pcx) (1 - pcy)
g2.left.mid mxt (t - O) [widths.lhs fine]
alsoThru.g2 pcx pcy
flat [mix mxt l p1] [mix t myl p2] [widths.lhs sw1]
curl [mix mxt l (1 - p4)] [mix t myl (1 - p3)] [widths.lhs sw2]
g2.down.mid (l + O) myl [widths.lhs body]
flat [mix l mxb p4] [mix myl b p3] [widths.lhs sw2]
curl [mix l mxb (1 - p1)] [mix myl b (1 - p2)] [widths.lhs sw1]
alsoThru.g2 (1 - pcx) (1 - pcy)
g2.right.mid.l mxb (b + O) [widths.lhs fine]
close
define [ZeroShapeBase shapeT] : namespace
@ -179,7 +195,7 @@ glyph-block Digits-Zero : begin
object # outline shape
'' Capsule
'oval' Oval
# 'diamond' Diamond
'diamond' Diamond
object # overlay/cutout
'unslashed' { null null }
'slashed' { ZeroSlash null }

View file

@ -112,6 +112,8 @@ export function SetupBuilders(bindings) {
kl(x + d.x * a.l, y + d.y * a.l, af),
kr(x + d.x * a.r, y + d.y * a.r, af)
];
sink[d.name][a.name].l = (x, y, af) => kl(x + d.x * a.l, y + d.y * a.l, af);
sink[d.name][a.name].r = (x, y, af) => kr(x + d.x * a.r, y + d.y * a.r, af);
}
}
}

View file

@ -109,9 +109,11 @@ class BiKnot {
this.y = y;
this.d1 = d1;
this.d2 = d2;
this.origTangent = null;
this.proposedNormal = null;
this.unimportant = 0;
// Derived properties
this.origTangent = null;
this.originalKnot = null;
}
clone() {
@ -132,17 +134,14 @@ class BiKnot {
toShapeString() {
return Format.tuple(
this.type,
this.unimportant,
Format.n(this.x),
Format.n(this.y),
this.d1 == null ? "" : Format.n(this.d1),
this.d2 == null ? "" : Format.n(this.d2),
this.origTangent
? Format.tuple(Format.n(this.origTangent.x), Format.n(this.origTangent.y))
: "",
this.proposedNormal
? Format.tuple(Format.n(this.proposedNormal.x), Format.n(this.proposedNormal.y))
: "",
this.unimportant
: ""
);
}
}

View file

@ -5150,7 +5150,7 @@ next = "overlays"
[prime.zero.variants-buildup.stages.body.standard]
rank = 1
keyAffix = ""
descriptionAffix = "standard outline"
descriptionAffix = "standard body shape"
selectorAffix.zero = ""
selectorAffix."zero/forceSlashed" = ""
selectorAffix."zero/forceUnslashed" = ""
@ -5158,11 +5158,19 @@ selectorAffix."zero/forceUnslashed" = ""
[prime.zero.variants-buildup.stages.body.oval]
rank = 2
keyAffix = "oval"
descriptionAffix = "oval outline"
descriptionAffix = "oval body shape"
selectorAffix.zero = "oval"
selectorAffix."zero/forceSlashed" = "oval"
selectorAffix."zero/forceUnslashed" = "oval"
[prime.zero.variants-buildup.stages.body.diamond]
rank = 3
keyAffix = "diamond"
descriptionAffix = "diamond body shape"
selectorAffix.zero = "diamond"
selectorAffix."zero/forceSlashed" = "diamond"
selectorAffix."zero/forceUnslashed" = "diamond"
[prime.zero.variants-buildup.stages.overlays.unslashed]
rank = 1
descriptionAffix = "slash"
@ -7064,7 +7072,7 @@ cyrl-capital-u = "curly-serifless"
cyrl-ka = "curly-serifless"
cyrl-capital-ya = "curly-serifless"
cyrl-ya = "curly-serifless"
zero = "oval-reverse-slashed-split"
zero = "diamond-reverse-slashed-split"
four = "closed"
six = "closed-contour"
seven = "curly-serifless"