fonteditor-core
Version:
fonts (ttf, woff, woff2, eot, svg, otf) parse, write, transform, glyph adjust.
31 lines (25 loc) • 622 B
JavaScript
/**
* @file GPOS
* @author fr33z00(https://github.com/fr33z00)
*
* @reference: https://learn.microsoft.com/en-us/typography/opentype/spec/gpos
*/
import table from './table';
export default table.create(
'GPOS',
[],
{
read(reader, ttf) {
const length = ttf.tables.GPOS.length;
return reader.readBytes(this.offset, length);
},
write(writer, ttf) {
if (ttf.GPOS) {
writer.writeBytes(ttf.GPOS, ttf.GPOS.length);
}
},
size(ttf) {
return ttf.GPOS ? ttf.GPOS.length : 0;
}
}
);