diff --git a/src/fonteditor/data/empty.json b/font/empty.json similarity index 100% rename from src/fonteditor/data/empty.json rename to font/empty.json diff --git a/font/empty.woff b/font/empty.woff new file mode 100644 index 0000000..10746fb Binary files /dev/null and b/font/empty.woff differ diff --git a/src/fonteditor/data/online-font.js b/src/fonteditor/data/online-font.js index 83e800e..ec2c760 100644 --- a/src/fonteditor/data/online-font.js +++ b/src/fonteditor/data/online-font.js @@ -14,6 +14,11 @@ define( name: 'iconfont.ttf', url: './font/iconfont.ttf', from: '阿里妈妈图标库' + }, + { + name: 'empty.woff', + url: './font/empty.woff', + from: 'fonteditor' } ]; } diff --git a/src/fonteditor/widget/actions.js b/src/fonteditor/widget/actions.js index 1a409ea..5687823 100644 --- a/src/fonteditor/widget/actions.js +++ b/src/fonteditor/widget/actions.js @@ -21,7 +21,7 @@ define( if (program.ttfManager.isChanged() && !window.confirm('是否放弃保存当前项目?')) { return; } - $.getJSON('./src/fonteditor/data/empty.json', function(imported) { + $.getJSON('./font/empty.json', function(imported) { program.ttfManager.set(imported); program.data.projectName = null; }); @@ -93,7 +93,7 @@ define( url: url, onSuccess: function(buffer) { program.loader.load(buffer, { - type: 'ttf', + type: url.slice(url.lastIndexOf('.') + 1) || 'ttf', success: function(imported) { program.loading.hide(); if (program.ttfManager.get()) {