fix post writer
This commit is contained in:
@@ -20,15 +20,16 @@ define(
|
||||
var Posthead = table.create(
|
||||
'posthead',
|
||||
[
|
||||
['format', struct.Fixed],
|
||||
['italicAngle', struct.Fixed],
|
||||
['underlinePosition', struct.Int16],
|
||||
['underlineThickness', struct.Int16],
|
||||
['postoints', struct.Int16], // 不知道干嘛用,文档里面没有
|
||||
['isFixedPitch', struct.Uint32],
|
||||
['minMemType42', struct.Uint32],
|
||||
['maxMemType42', struct.Uint32],
|
||||
['minMemType1', struct.Uint32],
|
||||
['maxMemType1', struct.Uint32]
|
||||
['maxMemType1', struct.Uint32],
|
||||
['numberOfGlyphs', struct.Uint16]
|
||||
]
|
||||
);
|
||||
|
||||
@@ -45,7 +46,7 @@ define(
|
||||
if(format == 2) {
|
||||
|
||||
// 读取表头
|
||||
tbl = new Posthead(reader.offset).read(reader, ttf);
|
||||
tbl = new Posthead(this.offset).read(reader, ttf);
|
||||
tbl.format = format;
|
||||
|
||||
var numberOfGlyphs = ttf.maxp.numGlyphs;
|
||||
@@ -80,12 +81,12 @@ define(
|
||||
writer.writeFixed(post.italicAngle || 0); // italicAngle
|
||||
writer.writeInt16(post.underlinePosition || 0); // underlinePosition
|
||||
writer.writeInt16(post.underlineThickness || 0); // underlineThickness
|
||||
writer.writeUint16(post.postoints || 0); // postoints
|
||||
writer.writeUint32(post.isFixedPitch || 0); // isFixedPitch
|
||||
writer.writeUint32(post.minMemType42 || 0); // minMemType42
|
||||
writer.writeUint32(post.maxMemType42 || 0); // maxMemType42
|
||||
writer.writeUint32(post.minMemType1 || 0); // minMemType1
|
||||
writer.writeUint32(post.maxMemType1 || numberOfGlyphs); // maxMemType1
|
||||
writer.writeUint32(post.maxMemType1 || 0); // maxMemType1
|
||||
writer.writeUint16(numberOfGlyphs); // numberOfGlyphs
|
||||
|
||||
// write glyphNameIndex
|
||||
var nameIndexs = ttf.support.post.nameIndexs;
|
||||
|
||||
Reference in New Issue
Block a user