Make names more explicit
This commit is contained in:
parent
4d20f8e655
commit
5382b324c3
5 changed files with 30 additions and 23 deletions
|
@ -57,14 +57,16 @@ glyph-block Common-Derivatives : begin
|
||||||
create-glyph [gr.amendName dstGid] : glyph-proc
|
create-glyph [gr.amendName dstGid] : glyph-proc
|
||||||
include : Fn [gr.get glyphSrc] gr.tag
|
include : Fn [gr.get glyphSrc] gr.tag
|
||||||
|
|
||||||
define [alias newid unicode id]
|
define [alias newid unicode id] : begin
|
||||||
with-related-glyphs id [fallback newid ('.alias' + [newtemp])] unicode
|
if [not newid] : throw : new Error "Target ID not specified"
|
||||||
|
with-related-glyphs id newid unicode
|
||||||
lambda [src sel] : glyph-proc
|
lambda [src sel] : glyph-proc
|
||||||
include [refer-glyph src] AS_BASE ALSO_METRICS
|
include [refer-glyph src] AS_BASE ALSO_METRICS
|
||||||
currentGlyph.cloneRankFromGlyph [query-glyph src]
|
currentGlyph.cloneRankFromGlyph [query-glyph src]
|
||||||
|
|
||||||
define [turned newid unicode id _x _y mark]
|
define [turned newid unicode id _x _y mark] : begin
|
||||||
with-related-glyphs id [fallback newid ('turn' + id)] unicode
|
if [not newid] : throw : new Error "Target ID not specified"
|
||||||
|
with-related-glyphs id newid unicode
|
||||||
lambda [src sel] : glyph-proc
|
lambda [src sel] : glyph-proc
|
||||||
include [refer-glyph src] [if mark false AS_BASE] ALSO_METRICS
|
include [refer-glyph src] [if mark false AS_BASE] ALSO_METRICS
|
||||||
if mark : include mark
|
if mark : include mark
|
||||||
|
@ -75,17 +77,20 @@ glyph-block Common-Derivatives : begin
|
||||||
|
|
||||||
# Dual derivatives
|
# Dual derivatives
|
||||||
define [HCombine newid unicode id1 id2 spacing] : begin
|
define [HCombine newid unicode id1 id2 spacing] : begin
|
||||||
create-glyph [fallback newid : 'hcombine{' + id1 + '}{' + id2 + '}'] unicode : glyph-proc
|
if [not newid] : throw : new Error "Target ID not specified"
|
||||||
|
create-glyph newid unicode : glyph-proc
|
||||||
include [refer-glyph id1] AS_BASE ALSO_METRICS
|
include [refer-glyph id1] AS_BASE ALSO_METRICS
|
||||||
include : Translate (-spacing) 0
|
include : Translate (-spacing) 0
|
||||||
include [refer-glyph id2]
|
include [refer-glyph id2]
|
||||||
include : Translate (spacing / 2) 0
|
include : Translate (spacing / 2) 0
|
||||||
|
|
||||||
define [HDual newid unicode id spacing] : begin
|
define [HDual newid unicode id spacing] : begin
|
||||||
return : HCombine [fallback newid : 'double' + id] unicode id id spacing
|
if [not newid] : throw : new Error "Target ID not specified"
|
||||||
|
return : HCombine newid unicode id id spacing
|
||||||
|
|
||||||
define [vcombine newid unicode id1 id2 spacing] : begin
|
define [vcombine newid unicode id1 id2 spacing] : begin
|
||||||
create-glyph [fallback newid : 'vcombine_' + id1 + '_' + id2] unicode : glyph-proc
|
if [not newid] : throw : new Error "Target ID not specified"
|
||||||
|
create-glyph newid unicode : glyph-proc
|
||||||
set-width [query-glyph id1].advanceWidth
|
set-width [query-glyph id1].advanceWidth
|
||||||
currentGlyph.dependsOn [query-glyph id1]
|
currentGlyph.dependsOn [query-glyph id1]
|
||||||
currentGlyph.dependsOn [query-glyph id2]
|
currentGlyph.dependsOn [query-glyph id2]
|
||||||
|
@ -98,7 +103,9 @@ glyph-block Common-Derivatives : begin
|
||||||
include : Upright
|
include : Upright
|
||||||
include : Translate 0 (spacing / 2)
|
include : Translate 0 (spacing / 2)
|
||||||
include : Italify
|
include : Italify
|
||||||
define [VDual newid unicode id spacing] : vcombine [fallback newid : 'double' + id] unicode id id spacing
|
define [VDual newid unicode id spacing] : begin
|
||||||
|
if [not newid] : throw : new Error "Target ID not specified"
|
||||||
|
return : vcombine newid unicode id id spacing
|
||||||
|
|
||||||
glyph-block-export select-variant italic-variant refer-glyph query-glyph with-related-glyphs
|
glyph-block-export select-variant italic-variant refer-glyph query-glyph with-related-glyphs
|
||||||
glyph-block-export alias turned HDual HCombine VDual vcombine glyph-is-needed
|
glyph-block-export alias turned HDual HCombine VDual vcombine glyph-is-needed
|
||||||
|
|
|
@ -3325,7 +3325,7 @@ glyph-block Letter-Latin-Lower-G : begin
|
||||||
g4 SB (Descender + SHook)
|
g4 SB (Descender + SHook)
|
||||||
|
|
||||||
select-variant 'g' 'g'
|
select-variant 'g' 'g'
|
||||||
turned nothing 0x1D77 'g' Middle [mix Descender XH 0.5]
|
turned 'turng' 0x1D77 'g' Middle [mix Descender XH 0.5]
|
||||||
|
|
||||||
create-glyph 'scriptghooktop' 0x260 : glyph-proc
|
create-glyph 'scriptghooktop' 0x260 : glyph-proc
|
||||||
include [refer-glyph 'scriptg'] AS_BASE
|
include [refer-glyph 'scriptg'] AS_BASE
|
||||||
|
@ -5572,7 +5572,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
|
||||||
include : aeepart df
|
include : aeepart df
|
||||||
|
|
||||||
alias 'cyrl/ae' 0x4D5 'ae'
|
alias 'cyrl/ae' 0x4D5 'ae'
|
||||||
turned nothing 0x1D02 'ae' [DivFrame para.diversityM].middle (XH / 2)
|
turned 'turnae' 0x1D02 'ae' [DivFrame para.diversityM].middle (XH / 2)
|
||||||
|
|
||||||
create-glyph 'oe' 0x153 : glyph-proc
|
create-glyph 'oe' 0x153 : glyph-proc
|
||||||
local df : DivFrame para.diversityM 3
|
local df : DivFrame para.diversityM 3
|
||||||
|
@ -5581,7 +5581,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
|
||||||
include : oeopart df
|
include : oeopart df
|
||||||
include : aeepart df
|
include : aeepart df
|
||||||
|
|
||||||
turned nothing 0x1D14 'oe' [DivFrame para.diversityM].middle (XH / 2)
|
turned 'turnoe' 0x1D14 'oe' [DivFrame para.diversityM].middle (XH / 2)
|
||||||
|
|
||||||
create-glyph 'ue' 0x1D6B : glyph-proc
|
create-glyph 'ue' 0x1D6B : glyph-proc
|
||||||
local df : DivFrame para.diversityM 3
|
local df : DivFrame para.diversityM 3
|
||||||
|
|
|
@ -177,7 +177,7 @@ glyph-block Digits-Two : begin
|
||||||
include MarkSet.e
|
include MarkSet.e
|
||||||
include : TwoShape XH
|
include : TwoShape XH
|
||||||
|
|
||||||
turned nothing 0x218A 'two.lnum' Middle (CAP / 2)
|
turned 'turnDigitTwo' 0x218A 'two.lnum' Middle (CAP / 2)
|
||||||
|
|
||||||
glyph-block Digits-Three : begin
|
glyph-block Digits-Three : begin
|
||||||
glyph-block-import CommonShapes
|
glyph-block-import CommonShapes
|
||||||
|
@ -223,7 +223,7 @@ glyph-block Digits-Three : begin
|
||||||
select-variant 'three.lnum' '3' (follow -- 'three')
|
select-variant 'three.lnum' '3' (follow -- 'three')
|
||||||
select-variant 'three.onum' (follow -- 'three')
|
select-variant 'three.onum' (follow -- 'three')
|
||||||
|
|
||||||
turned nothing 0x218B 'three.lnum' Middle (CAP / 2)
|
turned 'turnDigitThree' 0x218B 'three.lnum' Middle (CAP / 2)
|
||||||
|
|
||||||
glyph-block Digits-Four : begin
|
glyph-block Digits-Four : begin
|
||||||
glyph-block-import CommonShapes
|
glyph-block-import CommonShapes
|
||||||
|
|
|
@ -1264,13 +1264,13 @@ glyph-block Symbol-Math-Relation : begin
|
||||||
include : SubsetShape (SymbolMid + dH * 4 / 3) (SymbolMid - dH * 4 / 3)
|
include : SubsetShape (SymbolMid + dH * 4 / 3) (SymbolMid - dH * 4 / 3)
|
||||||
include : HBar (SB + HalfStroke) RightSB SymbolMid
|
include : HBar (SB + HalfStroke) RightSB SymbolMid
|
||||||
|
|
||||||
turned nothing 0x220B 'element' Middle SymbolMid
|
turned 'turnElement' 0x220B 'element' Middle SymbolMid
|
||||||
|
|
||||||
create-glyph 'smallElement' 0x220A : glyph-proc
|
create-glyph 'smallElement' 0x220A : glyph-proc
|
||||||
include [refer-glyph 'subst'] AS_BASE
|
include [refer-glyph 'subst'] AS_BASE
|
||||||
include : HBar (SB + HalfStroke) RightSB SymbolMid OperatorStroke
|
include : HBar (SB + HalfStroke) RightSB SymbolMid OperatorStroke
|
||||||
|
|
||||||
turned nothing 0x220D 'smallElement' Middle SymbolMid
|
turned 'turnSmallElement' 0x220D 'smallElement' Middle SymbolMid
|
||||||
|
|
||||||
create-glyph 'prefix' 0x228F : PrefixShape (SymbolMid + dH) (SymbolMid - dH)
|
create-glyph 'prefix' 0x228F : PrefixShape (SymbolMid + dH) (SymbolMid - dH)
|
||||||
create-glyph 'suffix' 0x2290 : SuffixShape (SymbolMid + dH) (SymbolMid - dH)
|
create-glyph 'suffix' 0x2290 : SuffixShape (SymbolMid + dH) (SymbolMid - dH)
|
||||||
|
@ -1323,7 +1323,7 @@ glyph-block Symbol-Math-Negation : begin
|
||||||
notGlyph.left null 0x22E2 'prefixBar'
|
notGlyph.left null 0x22E2 'prefixBar'
|
||||||
notGlyph.right null 0x22E3 'suffixBar'
|
notGlyph.right null 0x22E3 'suffixBar'
|
||||||
notGlyph.left null 0x2209 'element'
|
notGlyph.left null 0x2209 'element'
|
||||||
notGlyph.right null 0x220C 'turnelement'
|
notGlyph.right null 0x220C 'turnElement'
|
||||||
notGlyph.left null 0x2270 'lessEq'
|
notGlyph.left null 0x2270 'lessEq'
|
||||||
notGlyph.right null 0x2271 'greaterEq'
|
notGlyph.right null 0x2271 'greaterEq'
|
||||||
notGlyph.left null 0x2274 'lessSym'
|
notGlyph.left null 0x2274 'lessSym'
|
||||||
|
@ -1610,10 +1610,10 @@ glyph-block Symbol-Math-Other : begin
|
||||||
alias 'mathstar' 0x22C6 'blackstar.NWID'
|
alias 'mathstar' 0x22C6 'blackstar.NWID'
|
||||||
turned 'amalg' 0x2A3F 'grek/Pi' Middle (CAP / 2)
|
turned 'amalg' 0x2A3F 'grek/Pi' Middle (CAP / 2)
|
||||||
turned 'turnAmpersand' 0x214B 'ampersand' Middle (CAP / 2)
|
turned 'turnAmpersand' 0x214B 'ampersand' Middle (CAP / 2)
|
||||||
turned nothing 0x22DC 'greaterEq' Middle SymbolMid
|
turned 'turnGreaterEq' 0x22DC 'greaterEq' Middle SymbolMid
|
||||||
turned nothing 0x22DD 'lessEq' Middle SymbolMid
|
turned 'turnLessEq' 0x22DD 'lessEq' Middle SymbolMid
|
||||||
turned nothing 0x22DE 'succeedsEqSlant' Middle SymbolMid
|
turned 'turnSucceedsEqSlant' 0x22DE 'succeedsEqSlant' Middle SymbolMid
|
||||||
turned nothing 0x22DF 'precedesEqSlant' Middle SymbolMid
|
turned 'turnPrecedesEqSlant' 0x22DF 'precedesEqSlant' Middle SymbolMid
|
||||||
|
|
||||||
create-glyph 'sqrt' 0x221A : glyph-proc
|
create-glyph 'sqrt' 0x221A : glyph-proc
|
||||||
include : dispiro
|
include : dispiro
|
||||||
|
|
|
@ -5,8 +5,8 @@ const Point = require("./point");
|
||||||
const Anchor = require("./anchor");
|
const Anchor = require("./anchor");
|
||||||
|
|
||||||
module.exports = class Glyph {
|
module.exports = class Glyph {
|
||||||
constructor(name) {
|
constructor(_identifier) {
|
||||||
this._m_dependentName = name;
|
this._m_identifier = _identifier;
|
||||||
this.contours = [];
|
this.contours = [];
|
||||||
this.advanceWidth = 500;
|
this.advanceWidth = 500;
|
||||||
this.autoRefPriority = 0;
|
this.autoRefPriority = 0;
|
||||||
|
@ -36,7 +36,7 @@ module.exports = class Glyph {
|
||||||
}
|
}
|
||||||
// Dependency
|
// Dependency
|
||||||
dependsOn(glyph) {
|
dependsOn(glyph) {
|
||||||
if (glyph._m_dependentName) this.dependencies.push(glyph._m_dependentName);
|
if (glyph._m_identifier) this.dependencies.push(glyph._m_identifier);
|
||||||
if (glyph.dependencies) for (const dep of glyph.dependencies) this.dependencies.push(dep);
|
if (glyph.dependencies) for (const dep of glyph.dependencies) this.dependencies.push(dep);
|
||||||
}
|
}
|
||||||
// Contour Tagging
|
// Contour Tagging
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue