创建一个字体预览 [英] Creating a font preview

查看:154
本文介绍了创建一个字体预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在和一个类型设计师一起工作。他不希望他的字体在字体转售商,并希望人们在他的网站上购买自己的字体。他想要一个显示实时字体的网络应用程序,并且还允许人们输入一个输入框来产生具有该字体的自己的单词。就像myfonts和其他字体网站一样。我怎样才能做到这一点?如果可能的话,使用JavaScript / jQuery或PHP。

支付,JavaScript和CSS字体将不会工作,因为字体发送到客户端。



使用PHP很容易和可能,例如,使用 imagettftext 函数来渲染文本字体放在服务器上,然后发送渲染的图像作为对HTTP请求的回复。 imagettftext 使用GD和FreeType库,并且应该在大多数PHP安装中没有任何额外的设置。


I am working on a site with a type designer. He doesn't want his fonts on font resellers and would like people to buy his own font on his site. He would like a web app that shows the live font and would also allow people to type in a input box to generate there own words with the font. Just like myfonts and other font websites have. How can I do this? JavaScript/jQuery if possible, or PHP.

解决方案

If the designer doesn't want people to be able to download the font without payment, JavaScript and CSS fonts wouldn't work as the font is sent to the client.

With PHP it's easy and possible, for example, to use the imagettftext function to render text in a font on the server, then send the rendered image as a reply to a HTTP request. imagettftext uses the GD and FreeType libraries, and should work without any extra setup on most PHP installations.

这篇关于创建一个字体预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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