Page 1 of 1
PHP -> ImageMagick -> Pango with custom font
I'm trying to use a custom font in PHP with Imagick via Pango and I'm unsure how to specify the location of the font file. Can anyone help with a few example lines of PHP code showing how to render "Test String" using myfont.otf without the need for myfont.otf to be registered as a system font?
Thanks in advance!
Re: PHP -> ImageMagick -> Pango with custom font
I do not believe you can specify custom fonts. See https://imagemagick.org/Usage/text/#pango
Pango can change fonts in the middle of rendering. It already does so easily for bold and italic text. However the font specification is from GTK, and as such uses a different system to ImageMagick in general.
You can find out more about fonts using GTK, by running the "gtk-demo" program, and double clicking "Pickers" and the "Text Widget".