* Split variant assignment for Z
and z
(#789).
* Add motion serif variants for `Z` and `z` (#789).
This commit is contained in:
parent
d804312f15
commit
71acaa5203
7 changed files with 123 additions and 59 deletions
|
@ -1,2 +1,3 @@
|
|||
* Add motion serif variants for `a`, `b`, `d`, `g`, `k`, and `q` (#789).
|
||||
* Add motion serif variants for `a`, `b`, `d`, `g`, `k`, `q`, `Z` and `z` (#789).
|
||||
* Add vertical-crossing variant for `Q` (#789).
|
||||
* Split variant assignment for `Z` and `z` (#789).
|
|
@ -114,7 +114,7 @@ glyph-block AutoBuild-Accents : begin
|
|||
|
||||
define construction : glyph-proc
|
||||
include s_parts.0 AS_BASE ALSO_METRICS
|
||||
local nonTrivial false
|
||||
local nonTrivial : AnyDerivingCv.hasNonDerivingVariants s_parts.0
|
||||
foreach part [items-of : s_parts.slice 1] : if part : begin
|
||||
include part
|
||||
if (part.markAnchors && part.markAnchors.bottomright) : begin
|
||||
|
|
|
@ -3,7 +3,7 @@ $$include '../../meta/macros.ptl'
|
|||
import '../../support/transform' as Transform
|
||||
|
||||
import [mix linreg clamp fallback] from '../../support/utils'
|
||||
import [Cv AnyDerivingCv Dotless] from '../../support/gr'
|
||||
import [Cv AnyCv AnyDerivingCv Dotless] from '../../support/gr'
|
||||
import [DesignParameters] from '../../meta/aesthetics'
|
||||
|
||||
extern Map
|
||||
|
@ -19,7 +19,9 @@ glyph-block Common-Derivatives : begin
|
|||
local dstName : [fallback name follow] + '.' + suffix
|
||||
local dst : glyphStore.queryByName dstName
|
||||
if dst : g.dependsOn dst
|
||||
if (h.tag && h.rank) : [Cv h.tag h.rank].set g dstName
|
||||
if (h.tag && h.rank) : begin
|
||||
[Cv h.tag h.rank].set g dstName
|
||||
if h.nonDeriving : [Cv h.tag h.rank].setPreventDeriving g
|
||||
|
||||
define [select-variant] : params [name unicode [shapeFrom name] [follow name]] : begin
|
||||
if [not : glyph-is-needed shapeFrom] : return nothing
|
||||
|
@ -66,8 +68,9 @@ glyph-block Common-Derivatives : begin
|
|||
include [refer-glyph sourceGid] AS_BASE ALSO_METRICS
|
||||
|
||||
if glyphDst : begin
|
||||
foreach [gr : items-of : AnyDerivingCv.query glyphSrc] : begin
|
||||
foreach [gr : items-of : AnyCv.query glyphSrc] : begin
|
||||
gr.set glyphDst [gr.get glyphSrc]
|
||||
if [gr.setPreventDeriving glyphSrc] : gr.setPreventDeriving glyphDst
|
||||
if [Dotless.get glyphSrc] : Dotless.set glyphDst [Dotless.get glyphSrc]
|
||||
|
||||
define [turned newid unicode id _x _y mark] : begin
|
||||
|
|
|
@ -2,7 +2,7 @@ $$include '../../meta/macros.ptl'
|
|||
|
||||
import [mix linreg clamp fallback] from '../../support/utils'
|
||||
import [DesignParameters] from '../../meta/aesthetics'
|
||||
import [Dotless DoNotDeriveVariants CvDecompose] from "../../support/gr"
|
||||
import [Dotless CvDecompose] from "../../support/gr"
|
||||
|
||||
glyph-module
|
||||
|
||||
|
@ -7087,6 +7087,7 @@ glyph-block Letter-Latin-Z : begin
|
|||
|
||||
create-derived 'Z.withHorizontalCrossBar' : refer-glyph 'barOver'
|
||||
create-derived 'Z.withCrossBar' : refer-glyph 'antiSlashOver'
|
||||
create-derived 'Z.motionSerifed' : UpwardRightSerif (RightSB - OX) 0 VJut
|
||||
|
||||
create-glyph 'z.standard' : glyph-proc
|
||||
include : MarkSet.e
|
||||
|
@ -7108,6 +7109,7 @@ glyph-block Letter-Latin-Z : begin
|
|||
|
||||
create-derived 'z.withHorizontalCrossBar' : refer-glyph 'barOver'
|
||||
create-derived 'z.withCrossBar' : refer-glyph 'antiSlashOver'
|
||||
create-derived 'z.motionSerifed' : UpwardRightSerif (RightSB - OX) 0 VJut
|
||||
|
||||
create-glyph 'Z.curly' : glyph-proc
|
||||
include : MarkSet.capital
|
||||
|
@ -7124,6 +7126,7 @@ glyph-block Letter-Latin-Z : begin
|
|||
|
||||
create-derived 'Z.curlyWithHorizontalCrossBar' : refer-glyph 'barOver'
|
||||
create-derived 'Z.curlyWithCrossBar' : refer-glyph 'antiSlashOver'
|
||||
create-derived 'Z.curlyMotionSerifed' : UpwardRightSerif (RightSB - OX) 0 VJut
|
||||
|
||||
create-glyph 'z.curly' : glyph-proc
|
||||
include : MarkSet.e
|
||||
|
@ -7140,6 +7143,7 @@ glyph-block Letter-Latin-Z : begin
|
|||
|
||||
create-derived 'z.curlyWithHorizontalCrossBar' : refer-glyph 'barOver'
|
||||
create-derived 'z.curlyWithCrossBar' : refer-glyph 'antiSlashOver'
|
||||
create-derived 'z.curlyMotionSerifed' : UpwardRightSerif (RightSB - OX) 0 VJut
|
||||
|
||||
select-variant 'Z' 'Z'
|
||||
select-variant 'z' 'z'
|
||||
|
@ -7148,9 +7152,6 @@ glyph-block Letter-Latin-Z : begin
|
|||
alias 'Zbar' 0x1B5 'Z.withHorizontalCrossBar'
|
||||
alias 'zbar' 0x1B6 'z.withHorizontalCrossBar'
|
||||
|
||||
if [query-glyph 'Z'] : DoNotDeriveVariants.set [query-glyph 'Z']
|
||||
if [query-glyph 'z'] : DoNotDeriveVariants.set [query-glyph 'z']
|
||||
|
||||
define [BBZShape top] : glyph-proc
|
||||
include : HBarTop SB RightSB top BBS
|
||||
include : HBarBottom SB RightSB 0 BBS
|
||||
|
@ -7179,8 +7180,8 @@ glyph-block Letter-Latin-Z : begin
|
|||
create-glyph 'mathbb/Z' 0x2124 : composite-proc [MarkSet.capital] [BBZShape CAP]
|
||||
create-glyph 'mathbb/z' 0x1D56B : composite-proc [MarkSet.e] [BBZShape XH]
|
||||
|
||||
create-glyph 'Zdtail' 0x224 : glyph-proc
|
||||
include [refer-glyph 'Z'] AS_BASE
|
||||
define [ZDownTailCtor src sel] : glyph-proc
|
||||
include [refer-glyph src] AS_BASE ALSO_METRICS
|
||||
eject-contour 'strokeBottom'
|
||||
eject-contour 'serifRB'
|
||||
include : dispiro
|
||||
|
@ -7190,16 +7191,8 @@ glyph-block Letter-Latin-Z : begin
|
|||
archv
|
||||
straight.down.end RightSB (-Hook) [widths.heading 0 Stroke Downward]
|
||||
|
||||
create-glyph 'zdtail' 0x225 : glyph-proc
|
||||
include [refer-glyph 'z'] AS_BASE
|
||||
eject-contour 'strokeBottom'
|
||||
eject-contour 'serifRB'
|
||||
include : dispiro
|
||||
widths.lhs
|
||||
flat SB 0 [heading Rightward]
|
||||
curl (RightSB - HookX) 0
|
||||
archv
|
||||
straight.down.end RightSB (-Hook) [widths.heading 0 Stroke Downward]
|
||||
with-related-glyphs 'Z' 'Zdtail' 0x224 ZDownTailCtor
|
||||
with-related-glyphs 'z' 'zdtail' 0x225 ZDownTailCtor
|
||||
|
||||
create-glyph 'Zswash' 0x2C7F : glyph-proc
|
||||
include : MarkSet.if
|
||||
|
@ -7243,18 +7236,16 @@ glyph-block Letter-Latin-Z : begin
|
|||
if SLAB : begin
|
||||
include : DownwardLeftSerif SB XH VJut
|
||||
|
||||
create-glyph 'Zdesc' 0x2C6B : glyph-proc
|
||||
include [refer-glyph 'Z'] AS_BASE
|
||||
define [ZDescCtor src sel] : glyph-proc
|
||||
include [refer-glyph src] AS_BASE ALSO_METRICS
|
||||
eject-contour 'serifRB'
|
||||
include : VBarRight [mix SB RightSB 1.05] (HalfStroke - LongJut) Stroke
|
||||
|
||||
create-glyph 'zdesc' 0x2C6C : glyph-proc
|
||||
include [refer-glyph 'z'] AS_BASE
|
||||
eject-contour 'serifRB'
|
||||
include : VBarRight [mix SB RightSB 1.05] (HalfStroke - LongJut) Stroke
|
||||
with-related-glyphs 'Z' 'Zdesc' 0x2C6B ZDescCtor
|
||||
with-related-glyphs 'z' 'zdesc' 0x2C6C ZDescCtor
|
||||
|
||||
create-glyph 'zcurlytail' 0x291 : glyph-proc
|
||||
include : MarkSet.e
|
||||
with-related-glyphs 'z' 'zcurlytail' 0x291 : lambda [src sel] : glyph-proc
|
||||
include [refer-glyph src] AS_BASE ALSO_METRICS
|
||||
|
||||
local fine : AdviceStroke2 5 4 XH
|
||||
local rinner : Math.max (XH * 0.04) (fine * 0.1)
|
||||
|
@ -7264,9 +7255,6 @@ glyph-block Letter-Latin-Z : begin
|
|||
local m1 : RightSB - fine / 2 - rinner * 1.5 + O
|
||||
include : HCurlyTail fine Stroke rinner SB m1 (RightSB + fine / 2) x1 x2 y2
|
||||
|
||||
include : refer-glyph "z"
|
||||
eject-contour 'strokeBottom'
|
||||
eject-contour 'serifRB'
|
||||
|
||||
|
||||
glyph-block Letter-Latin-Eszet : begin
|
||||
|
|
|
@ -67,17 +67,6 @@ const TieGlyph = {
|
|||
}
|
||||
};
|
||||
|
||||
const DoNotDeriveVariants = {
|
||||
get(glyph) {
|
||||
if (glyph && glyph.related) return !!glyph.related.DoNotDeriveVariants;
|
||||
else return false;
|
||||
},
|
||||
set(glyph) {
|
||||
if (!glyph.related) glyph.related = {};
|
||||
glyph.related.DoNotDeriveVariants = true;
|
||||
}
|
||||
};
|
||||
|
||||
const Radical = {
|
||||
get(glyph) {
|
||||
if (glyph && glyph.related) return !!glyph.related.radical;
|
||||
|
@ -106,6 +95,18 @@ function Cv(tag, rank) {
|
|||
if (!glyph.related.cv) glyph.related.cv = {};
|
||||
glyph.related.cv[key] = toGid;
|
||||
},
|
||||
getPreventDeriving(glyph) {
|
||||
return (
|
||||
glyph.related &&
|
||||
glyph.related.preventCvDeriving &&
|
||||
!!glyph.related.preventCvDeriving[key]
|
||||
);
|
||||
},
|
||||
setPreventDeriving(glyph) {
|
||||
if (!glyph.related) glyph.related = {};
|
||||
if (!glyph.related.preventCvDeriving) glyph.related.preventCvDeriving = {};
|
||||
glyph.related.preventCvDeriving[key] = true;
|
||||
},
|
||||
amendName(name) {
|
||||
return name + "." + key;
|
||||
}
|
||||
|
@ -142,8 +143,10 @@ const AnyDerivingCv = {
|
|||
optional: false,
|
||||
query(glyph) {
|
||||
let ret = [];
|
||||
if (glyph && !DoNotDeriveVariants.get(glyph) && glyph.related && glyph.related.cv) {
|
||||
if (glyph && glyph.related && glyph.related.cv) {
|
||||
for (const key in glyph.related.cv) {
|
||||
if (glyph.related.preventCvDeriving && glyph.related.preventCvDeriving[key])
|
||||
continue;
|
||||
const [tag, rankStr] = key.split("#");
|
||||
const rank = parseInt(rankStr, 10);
|
||||
const rel = Cv(tag, rank);
|
||||
|
@ -151,6 +154,15 @@ const AnyDerivingCv = {
|
|||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
hasNonDerivingVariants(glyph) {
|
||||
if (glyph && glyph.related && glyph.related.cv) {
|
||||
for (const key in glyph.related.cv) {
|
||||
if (glyph.related.preventCvDeriving && glyph.related.preventCvDeriving[key])
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -314,7 +326,6 @@ exports.getGrTree = getGrTree;
|
|||
exports.getGrMesh = getGrMesh;
|
||||
exports.TieMark = TieMark;
|
||||
exports.TieGlyph = TieGlyph;
|
||||
exports.DoNotDeriveVariants = DoNotDeriveVariants;
|
||||
exports.Radical = Radical;
|
||||
exports.AnyDerivingCv = AnyDerivingCv;
|
||||
exports.CcmpDecompose = CcmpDecompose;
|
||||
|
|
|
@ -121,6 +121,7 @@ class PrimeVariant {
|
|||
this.description = cfg.description;
|
||||
this.rank = cfg.rank;
|
||||
this.selector = cfg.selector;
|
||||
this.nonDeriving = cfg.nonDeriving;
|
||||
}
|
||||
resolveFor(para, gn) {
|
||||
let vs = {};
|
||||
|
|
|
@ -209,6 +209,56 @@ selector.Y = "curly"
|
|||
|
||||
|
||||
|
||||
[prime.capital-z]
|
||||
sampler = 'Z'
|
||||
tag = 'cv63'
|
||||
|
||||
[prime.capital-z.variants.standard]
|
||||
rank = 1
|
||||
description = 'Standard `Z`'
|
||||
selector.Z = 'standard'
|
||||
|
||||
[prime.capital-z.variants.with-crossbar]
|
||||
rank = 2
|
||||
nonDeriving = true
|
||||
description = 'Standard `Z` with a diagonal cross bar for better dsitinction with `2`'
|
||||
selector.Z = 'withCrossBar'
|
||||
|
||||
[prime.capital-z.variants.with-horizontal-crossbar]
|
||||
rank = 3
|
||||
nonDeriving = true
|
||||
description = 'Standard `Z` with a horizontal cross bar for better dsitinction with `2`'
|
||||
selector.Z = 'withHorizontalCrossBar'
|
||||
|
||||
[prime.capital-z.variants.curly]
|
||||
rank = 4
|
||||
description = 'Curly `Z`'
|
||||
selector.Z = 'curly'
|
||||
|
||||
[prime.capital-z.variants.curly-with-crossbar]
|
||||
rank = 5
|
||||
description = 'Curly `Z` with a diagonal cross bar for better dsitinction with `2`'
|
||||
selector.Z = 'curlyWithCrossBar'
|
||||
|
||||
[prime.capital-z.variants.curly-with-horizontal-crossbar]
|
||||
rank = 6
|
||||
nonDeriving = true
|
||||
description = 'Curly `Z` with a horizontal cross bar for better dsitinction with `2`'
|
||||
selector.Z = 'curlyWithHorizontalCrossBar'
|
||||
|
||||
[prime.capital-z.variants.motion-serifed]
|
||||
rank = 7
|
||||
nonDeriving = true
|
||||
description = 'Standard `Z` with motion serifs'
|
||||
selector.Z = 'motionSerifed'
|
||||
|
||||
[prime.capital-z.variants.curly-motion-serifed]
|
||||
rank = 8
|
||||
description = 'Curly `Z` with motion serifs'
|
||||
selector.Z = 'curlyMotionSerifed'
|
||||
|
||||
|
||||
|
||||
[prime.a]
|
||||
sampler = 'a'
|
||||
tag = 'cv12'
|
||||
|
@ -1275,44 +1325,52 @@ selector.y = "curlyTurn"
|
|||
|
||||
|
||||
[prime.z]
|
||||
sampler = 'zZ'
|
||||
sampler = 'z'
|
||||
tag = 'cv33'
|
||||
|
||||
[prime.z.variants.standard]
|
||||
rank = 1
|
||||
description = 'Standard `Z` and `z`'
|
||||
description = 'Standard `z`'
|
||||
selector.z = 'standard'
|
||||
selector.Z = 'standard'
|
||||
|
||||
[prime.z.variants.with-crossbar]
|
||||
rank = 2
|
||||
description = 'Standard `Z` and `z` with a diagonal cross bar for better dsitinction with `2`'
|
||||
nonDeriving = true
|
||||
description = 'Standard `z` with a diagonal cross bar for better dsitinction with `2`'
|
||||
selector.z = 'withCrossBar'
|
||||
selector.Z = 'withCrossBar'
|
||||
|
||||
[prime.z.variants.with-horizontal-crossbar]
|
||||
rank = 3
|
||||
description = 'Standard `Z` and `z` with a horizontal cross bar for better dsitinction with `2`'
|
||||
nonDeriving = true
|
||||
description = 'Standard `z` with a horizontal cross bar for better dsitinction with `2`'
|
||||
selector.z = 'withHorizontalCrossBar'
|
||||
selector.Z = 'withHorizontalCrossBar'
|
||||
|
||||
[prime.z.variants.curly]
|
||||
rank = 4
|
||||
description = 'Curly `Z` and `z`'
|
||||
description = 'Curly `z`'
|
||||
selector.z = 'curly'
|
||||
selector.Z = 'curly'
|
||||
|
||||
[prime.z.variants.curly-with-crossbar]
|
||||
rank = 5
|
||||
description = 'Curly `Z` and `z` with a diagonal cross bar for better dsitinction with `2`'
|
||||
description = 'Curly `z` with a diagonal cross bar for better dsitinction with `2`'
|
||||
selector.z = 'curlyWithCrossBar'
|
||||
selector.Z = 'curlyWithCrossBar'
|
||||
|
||||
[prime.z.variants.curly-with-horizontal-crossbar]
|
||||
rank = 6
|
||||
description = 'Curly `Z` and `z` with a horizontal cross bar for better dsitinction with `2`'
|
||||
nonDeriving = true
|
||||
description = 'Curly `z` with a horizontal cross bar for better dsitinction with `2`'
|
||||
selector.z = 'curlyWithHorizontalCrossBar'
|
||||
selector.Z = 'curlyWithHorizontalCrossBar'
|
||||
|
||||
[prime.z.variants.motion-serifed]
|
||||
rank = 7
|
||||
nonDeriving = true
|
||||
description = 'Standard `z` with motion serifs'
|
||||
selector.z = 'motionSerifed'
|
||||
|
||||
[prime.z.variants.curly-motion-serifed]
|
||||
rank = 8
|
||||
description = 'Curly `z` with motion serifs'
|
||||
selector.z = 'curlyMotionSerifed'
|
||||
|
||||
|
||||
|
||||
|
@ -1983,6 +2041,7 @@ capital-m = 'hanging'
|
|||
capital-q = 'taily'
|
||||
capital-r = 'straight'
|
||||
capital-y = 'straight'
|
||||
capital-z = 'standard'
|
||||
# Lowers
|
||||
b = 'toothed'
|
||||
g = 'singlestorey'
|
||||
|
@ -2483,6 +2542,7 @@ tag = 'ss20'
|
|||
description = 'Curly Style'
|
||||
|
||||
[composite.ss20.design]
|
||||
capital-z = 'curly'
|
||||
v = 'curly'
|
||||
turn-v = 'curly'
|
||||
w = 'curly'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue