allanguys / font-spider-plus

font-spider-plus(字蛛+)是一个智能 WebFont 压缩工具,它能自动分析出本地页面和线上页面使用的 WebFont 并进行按需压缩。
MIT License
710 stars 51 forks source link

error:cloud not convert the given font. #13

Closed februaryBot closed 4 years ago

februaryBot commented 5 years ago

一个简单的demo 只有一个html文件,js内嵌 。 Ubuntu14.04. node: v8.15.0. 运行fsp local index.html 或 sudo fsp local index.html 得以下报错:

正在优化...Parsing of the input font failed.

{ Error: Could not convert the given font. at Transform.ttf2woff2GulpTransform [as _transform] (/usr/lib/node_modules/font-spider-plus/node_modules/_gulp-ttf2woff2@2.0.2@gulp-ttf2woff2/src/index.js:76:25) at Transform._read (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_transform.js:184:10) at Transform._write (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_transform.js:172:83) at doWrite (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_writable.js:417:5) at Transform.Writable.write (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_writable.js:334:11) at Through2.ondata (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.0.6@readable-stream/lib/_stream_readable.js:531:20) at emitOne (events.js:116:13) at Through2.emit (events.js:211:7) at readableAddChunk (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.0.6@readable-stream/lib/_stream_readable.js:198:18) name: 'Error', message: 'Could not convert the given font.', stack: 'Error: Could not convert the given font.\n at Transform.ttf2woff2GulpTransform [as _transform] (/usr/lib/node_modules/font-spider-plus/node_modules/_gulp-ttf2woff2@2.0.2@gulp-ttf2woff2/src/index.js:76:25)\n at Transform._read (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_transform.js:184:10)\n at Transform._write (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_transform.js:172:83)\n at doWrite (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_writable.js:428:64)\n at writeOrBuffer (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_writable.js:417:5)\n at Transform.Writable.write (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.3.6@readable-stream/lib/_stream_writable.js:334:11)\n at Through2.ondata (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.0.6@readable-stream/lib/_stream_readable.js:531:20)\n at emitOne (events.js:116:13)\n at Through2.emit (events.js:211:7)\n at readableAddChunk (/usr/lib/node_modules/font-spider-plus/node_modules/_readable-stream@2.0.6@readable-stream/lib/_stream_readable.js:198:18)', showStack: true, showProperties: true, plugin: 'gulp-ttf2woff2' }

麻烦问下大概什么问题?

allanguys commented 5 years ago

一般情况下是字体文件不符合ttf文件格式造成的,用其它的ttf字体文件试一下?或者发字体文件看一下