使用 PHP 通过图像生成 TTF?
是否存在使用 PHP 通过图像(例如一系列图像)生成 .ttf 的现有库?有一些关于从图像创建 gdf 的参考资料,但我还没有找到通过 PHP 创建 ttf 字体的示例。
注意:还有一些在线资源可让您上传图像(在图像模板的每个框中写一个字母)以立即转换为 TTF。 http://www.yourfonts.com 就是其中之一
Are there existing libraries for generating .ttf via image(s) using PHP (say, a series of images)? There are several references about creating gdf from images, but I've not yet found examples of ttf-font creation via PHP.
N.B. There are also several online resources that let you upload an image (write a letter in each box on an image template) to be instantly converted to a TTF. http://www.yourfonts.com is one of them
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,没有这样的工具。
创建 TrueType 字体是一件极其困难的事情。字体由许多非常复杂的信息组成(请参阅维基百科文章中的“技术说明”以获得一点印象)。仅仅将一系列图像粘贴在一起是不行的。
根据您想要做什么,我想您可以通过构建一种人造“位图字体”(一个包含一个字符的图像文件)并将正确的图像粘合在一起以形成句子来解决此问题。不过,结果可能不太完美,因为没有字距调整。
To my knowledge, there is no such tool.
Creating a TrueType font is a hugely difficult enterprise. A font consists of a lot of very complex information (see the "technical notes" in the Wikipedia article to get a tiny impression). It won't do to just paste a series of images together.
Depending on what you want to do, I suppose you could work around this by building a faux "bitmap font", one image file containing one character, and glue the correct images together to form a sentence. The results will probably be less than perfect, though, because there will be no Kerning.