提取字体字形 [英] Extract Font Glyphs
问题描述
是否有PHP函数或库可以从字体文件中提取一些字形?
编辑:
通过提取一些字形,我想根据提取的字形创建一个新的字体文件(所以它有较小的字节),或者只是得到字形,并从中创建base64编码的字体数据,所以我可以通过@ font-face嵌入它。我只是想摆脱glyphs没有用,所以CSS(base64)或字体文件将加载更快。
正试图做一个子集的字体不是吗?这个问题已经被嵌入式字体社区深入调查过了。
即使这样,这里也没有明确的答案。最后一次我检查了人们编写的Perl / C程序从字体文件中提取基于TTF / OTF规范的二进制数据。
如果使用的是拉丁字体,哥哥真的很小。如果您使用像我这样的CJK字体,FontForge可以帮助您手动复制和粘贴腮腺炎。除此之外,您需要自己编写脚本/程序。
I have this problem across my mind, any help will be appreciated. Is there are PHP function, or library that can extract some glyphs form a font file?
Edit: By means to extract some glyphs, I wanted to create a new font file based on the glyphs extracted (so it has smaller bytes), or just get the glyphs and create base64 encoded font data from it so I can embed it via @font-face. I just wanted to get rid glyphs that has no use so CSS (base64) or font file will be loaded faster.
You are trying to make a subset font aren't you? This problem have been investigated heavily by the embedded font community.
Even that, there is not definite answer here. Last time I checked people write Perl/C programs to extract binary data from font files, based on TTF/OTF spec.
If you are using Latin font, don't brother coz it's small enough. If you are using CJK font like me, FontForge could help you copy and paste the gryphs by hand. Other than that you need to write a script/program by yourself.
这篇关于提取字体字形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!