fix svg font export bug

This commit is contained in:
kekee000
2014-12-25 23:45:06 +08:00
parent 7b1f3751aa
commit beb760ff1c
4 changed files with 6 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ define(
*/
function getEmptyObject() {
return {
'from': 'svg',
'OS/2': {},
'name': {},
'hhea': {},

View File

@@ -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;

View File

@@ -135,6 +135,7 @@ define(
}
ttf.post = ttf.post || {};
ttf.post.format = ttf.post.format || 0x2;
ttf.post.maxMemType1 = numberOfGlyphs;
ttf.support.post = {

View File

@@ -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;