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

切字体后乱码 #4

Closed
liu578101804 opened this issue Jun 26, 2023 · 7 comments
Closed

切字体后乱码 #4

liu578101804 opened this issue Jun 26, 2023 · 7 comments

Comments

@liu578101804
Copy link

image
我按照你的文档说明,我把 22M 的 思源宋体-Heavy.otf 切片后,出现乱码
image

@voderl
Copy link
Owner

voderl commented Jun 26, 2023

可以在这里上传下会出现问题的思源宋体的字体文件,我看下。同时我试下直接从 ttf 转会不会有同样的问题。

@liu578101804
Copy link
Author

liu578101804 commented Jun 26, 2023 via email

@voderl
Copy link
Owner

voderl commented Jun 26, 2023

使用这里下载的字体试下呢,https://github.com/Pal3love/Source-Han-TrueType/releases
下载 SourceHanSerifCN.zip 这个就行,我试了下这里的是正常的:
image

乱码这个问题应该是底层依赖的 fontmin 也有问题

可以试下上面的方案能否解决问题,如果不能解决我再看下如何处理

@liu578101804
Copy link
Author

liu578101804 commented Jun 26, 2023 via email

@voderl
Copy link
Owner

voderl commented Jun 26, 2023

目前是每一个字体打包一个目录。可以设置 options.preview 为 false,一次在脚本中打包多个字体。

打包到一起指的是多个字体使用同一个 css 文件引入吗?目前还不支持,只能手动将多个 css 文件合成一个 css,字体文件都放到一个目录。

@liu578101804
Copy link
Author

liu578101804 commented Jun 26, 2023 via email

@voderl
Copy link
Owner

voderl commented Jun 26, 2023

对的,目前写多个 createFontSlice 需要给每个字体不同的目录,不然 font.css 会覆盖掉。
如果想要一个 font.css 引入多个字体的话,目前只能手动整合到一起,再把字体文件放到一个目录里。后续可能会考虑支持多个字体打包到一个 css 里。

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