fix svg font export bug
This commit is contained in:
@@ -41,6 +41,7 @@ define(
|
||||
*/
|
||||
function getEmptyObject() {
|
||||
return {
|
||||
'from': 'svg',
|
||||
'OS/2': {},
|
||||
'name': {},
|
||||
'hhea': {},
|
||||
|
||||
@@ -228,12 +228,15 @@ define(
|
||||
ttf['OS/2'].usLastCharIndex = usLastCharIndex;
|
||||
|
||||
// rewrite hhea
|
||||
ttf.hhea.version = ttf.hhea.version || 0x1;
|
||||
ttf.hhea.advanceWidthMax = advanceWidthMax;
|
||||
ttf.hhea.minLeftSideBearing = minLeftSideBearing;
|
||||
ttf.hhea.minRightSideBearing = minRightSideBearing;
|
||||
ttf.hhea.xMaxExtent = xMaxExtent;
|
||||
|
||||
// rewrite head
|
||||
ttf.head.version = ttf.head.version || 0x1;
|
||||
ttf.head.lowestRecPPEM = ttf.head.lowestRecPPEM || 0x8;
|
||||
ttf.head.xMin = xMin;
|
||||
ttf.head.yMin = yMin;
|
||||
ttf.head.xMax = xMax;
|
||||
|
||||
@@ -135,6 +135,7 @@ define(
|
||||
}
|
||||
|
||||
ttf.post = ttf.post || {};
|
||||
ttf.post.format = ttf.post.format || 0x2;
|
||||
ttf.post.maxMemType1 = numberOfGlyphs;
|
||||
|
||||
ttf.support.post = {
|
||||
|
||||
@@ -42,6 +42,7 @@ define(
|
||||
function resolve(ttf) {
|
||||
|
||||
// 头部信息
|
||||
ttf.version = ttf.version || 0x1;
|
||||
ttf.numTables = tableList.length;
|
||||
ttf.entrySelector = Math.floor(Math.log(tableList.length)/Math.LN2);
|
||||
ttf.searchRange = Math.pow(2, ttf.entrySelector) * 16;
|
||||
|
||||
Reference in New Issue
Block a user