Added GDEF table; move to r0.1.7.
This commit is contained in:
parent
63b134959f
commit
e9274696ec
|
@ -65,5 +65,9 @@ if(argv.dumpfeature) {
|
||||||
var mkmk = ttfFont.features.mkmk;
|
var mkmk = ttfFont.features.mkmk;
|
||||||
featurefile += 'lookup mkmkAuto {' + mkmk.marks.join(';\n') + ';\n' + mkmk.bases.join(';\n') + ';} mkmkAuto;'
|
featurefile += 'lookup mkmkAuto {' + mkmk.marks.join(';\n') + ';\n' + mkmk.bases.join(';\n') + ';} mkmkAuto;'
|
||||||
|
|
||||||
|
// gdef
|
||||||
|
var gdef = ttfFont.features.gdef;
|
||||||
|
featurefile += '@GDEF_Simple = [' + gdef.simple.join(' ') + ']; @GDEF_Ligature =[' + gdef.ligature.join(' ') + ']; @GDEF_Mark = [' + gdef.mark.join(' ') + ']; table GDEF { GlyphClassDef @GDEF_Simple, @GDEF_Ligature, @GDEF_Mark, ;} GDEF;'
|
||||||
|
|
||||||
fs.writeFileSync(argv.dumpfeature, featurefile, 'utf8');
|
fs.writeFileSync(argv.dumpfeature, featurefile, 'utf8');
|
||||||
};
|
};
|
|
@ -535,7 +535,7 @@ create-glyph 'servicemark' : glyph-construction {
|
||||||
set font.features.mark (.)
|
set font.features.mark (.)
|
||||||
set font.features.mkmk (.marks () .bases ())
|
set font.features.mkmk (.marks () .bases ())
|
||||||
set font.features.markGlyphs (.)
|
set font.features.markGlyphs (.)
|
||||||
|
set font.features.gdef (.simple () .ligature () .mark ())
|
||||||
define [buildAnchorDescription glyph inserter propx propy] : begin {
|
define [buildAnchorDescription glyph inserter propx propy] : begin {
|
||||||
local buf ''
|
local buf ''
|
||||||
foreach key [items-of : Object.keys glyph.anchors] : buf = buf + ' <anchor ' + [Math.round [upmscale * glyph.anchors.(key).(propx)]] + ' ' + [Math.round [upmscale * glyph.anchors.(key).(propy)]] + '> ' + inserter + ' @' + key
|
foreach key [items-of : Object.keys glyph.anchors] : buf = buf + ' <anchor ' + [Math.round [upmscale * glyph.anchors.(key).(propx)]] + ' ' + [Math.round [upmscale * glyph.anchors.(key).(propy)]] + '> ' + inserter + ' @' + key
|
||||||
|
@ -559,21 +559,22 @@ createMarkLookup 'topright'
|
||||||
createMarkLookup 'bottomright'
|
createMarkLookup 'bottomright'
|
||||||
createMarkLookup 'overlay'
|
createMarkLookup 'overlay'
|
||||||
createMarkLookup 'slash'
|
createMarkLookup 'slash'
|
||||||
# mkmk
|
# mkmk and GDEF
|
||||||
foreach glyph [items-of glyphList] : if [glyph.anchors && [begin [local anchorKeys : Object.keys glyph.anchors] anchorKeys.length]] : begin {
|
foreach glyph [items-of glyphList] : if [glyph.anchors && [begin [local anchorKeys : Object.keys glyph.anchors] anchorKeys.length]] : begin {
|
||||||
local isMarkGlyph false
|
local isMarkGlyph false
|
||||||
foreach key [items-of anchorKeys] : if [glyph.anchors.(key).type == 'mark'] : set isMarkGlyph true
|
foreach key [items-of anchorKeys] : if [glyph.anchors.(key).type == 'mark'] : set isMarkGlyph true
|
||||||
|
|
||||||
if isMarkGlyph {
|
if isMarkGlyph {
|
||||||
then {
|
then {
|
||||||
# font.features.mark.marks.push : 'markClass [' + glyph.name + '] ' + [buildAnchorDescription glyph '' 'x' 'y']
|
|
||||||
font.features.mkmk.marks.push : 'markClass [' + glyph.name + '] ' + [buildAnchorDescription glyph '' 'x' 'y']
|
font.features.mkmk.marks.push : 'markClass [' + glyph.name + '] ' + [buildAnchorDescription glyph '' 'x' 'y']
|
||||||
font.features.mkmk.bases.push : 'pos mark [' + glyph.name + '] ' + [buildAnchorDescription glyph 'mark' 'mbx' 'mby']
|
font.features.mkmk.bases.push : 'pos mark [' + glyph.name + '] ' + [buildAnchorDescription glyph 'mark' 'mbx' 'mby']
|
||||||
foreach key [items-of anchorKeys] : begin {
|
foreach key [items-of anchorKeys] : begin {
|
||||||
if [not font.features.markGlyphs.(key)] : set font.features.markGlyphs.(key) ()
|
if [not font.features.markGlyphs.(key)] : set font.features.markGlyphs.(key) ()
|
||||||
font.features.markGlyphs.(key).push glyph.name
|
font.features.markGlyphs.(key).push glyph.name
|
||||||
}
|
}
|
||||||
|
font.features.gdef.mark.push glyph.name
|
||||||
}
|
}
|
||||||
# else : font.features.mark.bases.push : 'pos base [' + glyph.name + '] ' + [buildAnchorDescription glyph 'mark' 'x' 'y']
|
else : if [[regex '_'].test glyph.name] [font.features.gdef.ligature.push glyph.name] [font.features.gdef.simple.push glyph.name]
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -45,7 +45,7 @@ define regular (
|
||||||
.family 'Iosevka'
|
.family 'Iosevka'
|
||||||
.style 'Regular'
|
.style 'Regular'
|
||||||
.weight 400
|
.weight 400
|
||||||
.version 'r0.1.6'
|
.version 'r0.1.7'
|
||||||
.variantSelector (.)
|
.variantSelector (.)
|
||||||
.copyright 'Copyright (c) 2015 Belleve Invis.'
|
.copyright 'Copyright (c) 2015 Belleve Invis.'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user