Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

转换汉仪字体时报错 #39

Open
liuweifeng opened this issue Jul 28, 2015 · 10 comments
Open

转换汉仪字体时报错 #39

liuweifeng opened this issue Jul 28, 2015 · 10 comments

Comments

@liuweifeng
Copy link

使用「字蛛」转换「汉仪菱心体简」字体时报错,报错信息如下:

Error: Offset is outside the bounds of the DataView
RangeError: Offset is outside the bounds of the DataView
    at DataView.getUint8 (native)
    at Reader.read (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/reader.js:66:43)
    at Reader.readUint8 (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/common/lang.js:33:27)
    at Table.readSimpleGlyf (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/table/glyfcontour.js:75:32)
    at Table.table.create.read (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/table/glyfcontour.js:201:40)
    at Table.table.create.read (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/table/glyf.js:39:48)
    at /usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/ttfreader.js:68:75
    at Array.forEach (native)
    at TTFReader.read (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/ttfreader.js:65:40)
    at TTFReader.read (/usr/local/lib/node_modules/font-spider/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/ttfreader.js:161:29)

Node.js 版本为 v0.12.6,在 OS X 10 和 CentOS 6 上均重现。

@aui
Copy link
Owner

aui commented Jul 28, 2015

@junmer

@liuweifeng
Copy link
Author

使用的字体文件是设计师给的,是公司买的授权的。在网上搜索下载的此字体版本也有同样的问题。

@junmer
Copy link

junmer commented Jul 29, 2015

@aui 可以升级到 fontmin 0.8.1试试

@aui
Copy link
Owner

aui commented Jul 29, 2015

已经更新 font-spider@0.3.4

@liuweifeng
Copy link
Author

@aui @junmer 多谢,升级到 font-spider@0.3.4 后问题已解决。

@liuweifeng
Copy link
Author

升级到目前的最新版后,转换这个字体报错:

error read glyf coordinates:1556520

但是字体文件的确生成了。
使用生成的字体,除 iOS 9 Public Beta 外均没有问题。
在 iOS 9 Public Beta 的 Safari 里,中文字体没事,数字部分,很奇怪,宽度大约是字符的两倍。见截图。
image
上图中,数字的 DOM 结构里没有任何空格,除 font-family 外也没用设置任何样式。

@liuweifeng liuweifeng reopened this Aug 27, 2015
@junmer
Copy link

junmer commented Aug 28, 2015

@liuweifeng
coordinates 是字型拐点的数量,fontmin 字型解析有一个上限

error read glyf coordinates:1556520

应该是某个 超级难写的字 字型没有解析,这里报一个错误,但不会影响整个字体的输出
所以,暂时可以不考虑,下个版本我们 改成 warn

宽度两倍
之前发现过类似问题,并改过
求 发一下字体文件 我们来查一下
唔,涉及版权的话可以发我邮箱

@liuweifeng
Copy link
Author

@junmer 多谢!字体文件已发到你的 foxmail 邮箱。

@junmer
Copy link

junmer commented Aug 31, 2015

@liuweifeng
基本原因找到了,是由 kerning 引起的,我开个 ecomfe/fontmin#21 列入开发计划,临时解决方案

<span>123456&nbsp;</span>步

@liuweifeng
Copy link
Author

@junmer 多谢,测试可以。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants