通过使用PHP的图像生成TTF? [英] Generate TTF via image(s) using PHP?

查看:152
本文介绍了通过使用PHP的图像生成TTF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有现成的库,通过使用PHP(例如,一系列图像)图像生成.ttf?有几个有关从图像创建gdf的参考,但是我还没有找到通过PHP创建ttf-font的例子。



N.B。还有几个在线资源可以让您上传图片(在图片模板的每个框中写一个字母),以便立即转换为TTF。 http://www.yourfonts.com 就是其中之一

解决方案

据我所知,没有这样的工具。

创建一个TrueType字体是一个巨大的企业困难。字体包含许多非常复杂的信息(请参阅维基百科文章中的技术说明得到一个小小的印象)。它不会只是粘贴一系列的图像在一起。

根据你想要做什么,我想你可以通过建立一个人造的位图字体,一个图像文件包含一个字符,并将正确的图像粘合在一起形成一个句子。但是,结果可能并不完美,因为不会有 Kerning

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

解决方案

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.

这篇关于通过使用PHP的图像生成TTF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆