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

Suggestion: do Math.round to xoffset & yoffset #42

Closed
finscn opened this issue May 25, 2022 · 4 comments
Closed

Suggestion: do Math.round to xoffset & yoffset #42

finscn opened this issue May 25, 2022 · 4 comments

Comments

@finscn
Copy link
Contributor

finscn commented May 25, 2022

In my output file , xoffset="8.04921875" yoffset="15.9609375"

I hope they could be integer

@finscn
Copy link
Contributor Author

finscn commented May 26, 2022

post an image :
image

@finscn
Copy link
Contributor Author

finscn commented May 26, 2022

如果这两个属性不能直接取整, 是否可以只保留2位小数呢?

finscn added a commit to finscn/snowb-bmf that referenced this issue May 26, 2022
@SilenceLeo
Copy link
Owner

可否提供一下你的项目文件?

@finscn
Copy link
Contributor Author

finscn commented May 29, 2022

可否提供一下你的项目文件?

你好 确实不太方便 .因为我们用到的是一个公司重金购买的商业字体. 而从sbf的体积来看 它好像是包含了这个字体. 不太方便上传.

我看了下你的代码 其实不排除这个字体里的 xoffset 就是小数, 然后在浮点数误差的影响下 , 变成了非常长的一串小数.

我觉得我的那个PR 应该能解决这个问题.

SilenceLeo added a commit that referenced this issue May 30, 2022
fix the xoffset & yoffset (see #42)
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

2 participants