32 lines
703 B
Plaintext
32 lines
703 B
Plaintext
/**
|
|
* @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;
|
|
}
|
|
}
|
|
);
|
|
|