Search code examples
phpfontsgdimagettftext

Open OTF fonts with php - greek characters included


So, as the title says, my task is to convert a given phrase to an image on server side (php GD) with a selected .otf font. The phrase can include not only latin characters but also greek and cyrillic.

PHP's imagettftext (http://php.net/manual/en/function.imagettftext.php) won't work with non-latin characters on .otf fonts (works ok with .ttf as it seems).

Any clues?

EDIT: Font needs to be .otf


Solution

  • Posting rough answer that seems to work for future people bumping on this post:

    Solution seemed to be: 1) open OTF with LATEX server side 2) produce PDF 3) convert to image with ImageMagick library.