Added GDEF table; move to r0.1.7.

This commit is contained in:
be5invis 2015-08-23 08:50:45 +08:00
parent 63b134959f
commit e9274696ec
3 changed files with 10 additions and 5 deletions

View File

@ -64,6 +64,10 @@ if(argv.dumpfeature) {
// mkmk
var mkmk = ttfFont.features.mkmk;
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');
};

View File

@ -535,7 +535,7 @@ create-glyph 'servicemark' : glyph-construction {
set font.features.mark (.)
set font.features.mkmk (.marks () .bases ())
set font.features.markGlyphs (.)
set font.features.gdef (.simple () .ligature () .mark ())
define [buildAnchorDescription glyph inserter propx propy] : begin {
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
@ -559,21 +559,22 @@ createMarkLookup 'topright'
createMarkLookup 'bottomright'
createMarkLookup 'overlay'
createMarkLookup 'slash'
# mkmk
# mkmk and GDEF
foreach glyph [items-of glyphList] : if [glyph.anchors && [begin [local anchorKeys : Object.keys glyph.anchors] anchorKeys.length]] : begin {
local isMarkGlyph false
foreach key [items-of anchorKeys] : if [glyph.anchors.(key).type == 'mark'] : set isMarkGlyph true
if isMarkGlyph {
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.bases.push : 'pos mark [' + glyph.name + '] ' + [buildAnchorDescription glyph 'mark' 'mbx' 'mby']
foreach key [items-of anchorKeys] : begin {
if [not font.features.markGlyphs.(key)] : set font.features.markGlyphs.(key) ()
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]
}
}

View File

@ -45,7 +45,7 @@ define regular (
.family 'Iosevka'
.style 'Regular'
.weight 400
.version 'r0.1.6'
.version 'r0.1.7'
.variantSelector (.)
.copyright 'Copyright (c) 2015 Belleve Invis.'
)