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
Use imagefttext
function instead. It has the same arguments and usage as imagettftext
, but uses the FreeType 2 library which supports OpenType and plenty of other font formats.
It doesn't support OpenType's layout tables however. See FreeType 2's FAQ for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With