创建一个字体预览 [英] Creating a font preview
问题描述
使用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屋!