diff --git a/src/ttf/svg2ttfobject.js b/src/ttf/svg2ttfobject.js index 3ea4947..83b7bee 100644 --- a/src/ttf/svg2ttfobject.js +++ b/src/ttf/svg2ttfobject.js @@ -41,6 +41,7 @@ define( */ function getEmptyObject() { return { + 'from': 'svg', 'OS/2': {}, 'name': {}, 'hhea': {}, diff --git a/src/ttf/table/OS2.js b/src/ttf/table/OS2.js index 1740c45..eba22c4 100644 --- a/src/ttf/table/OS2.js +++ b/src/ttf/table/OS2.js @@ -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; diff --git a/src/ttf/table/post.js b/src/ttf/table/post.js index 042b68f..817e045 100644 --- a/src/ttf/table/post.js +++ b/src/ttf/table/post.js @@ -135,6 +135,7 @@ define( } ttf.post = ttf.post || {}; + ttf.post.format = ttf.post.format || 0x2; ttf.post.maxMemType1 = numberOfGlyphs; ttf.support.post = { diff --git a/src/ttf/ttfwriter.js b/src/ttf/ttfwriter.js index 986153c..9097356 100644 --- a/src/ttf/ttfwriter.js +++ b/src/ttf/ttfwriter.js @@ -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;