UNPKG

fonteditor-core

Version:

fonts (ttf, woff, woff2, eot, svg, otf) parse, write, transform, glyph adjust.

32 lines (25 loc) 703 B
/** * @file gasp 表 * 对于需要hinting的字号需要这个表,否则会导致错误 * @author mengke01(kekee000@gmail.com) * reference: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gasp.html */ import table from './table'; export default table.create( 'gasp', [], { read(reader, ttf) { const length = ttf.tables.gasp.length; return reader.readBytes(this.offset, length); }, write(writer, ttf) { if (ttf.gasp) { writer.writeBytes(ttf.gasp, ttf.gasp.length); } }, size(ttf) { return ttf.gasp ? ttf.gasp.length : 0; } } );