Convert and Pango Issues
Convert and Pango Issues
I'm attempting to run a convert command from the command line. The font I'm using has ligatures so I need to use pango. However pango doesn't seem to want to work or recognize the font where label or caption does. My command is:
convert -font test-Regular.ttf -pointsize 124 PANGO:"ac" pango.png - doesn't work
convert -font test-Regular.ttf -pointsize 124 label:"ac" label.png - works
When I run convert -version I get:
Version: ImageMagick 6.9.10-24 Q16 x86_64 2019-01-12 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype jng jp2 jpeg lcms ltdl lzma openexr pangocairo png rsvg tiff webp wmf x xml zlib
Any ideas?
Thanks!
convert -font test-Regular.ttf -pointsize 124 PANGO:"ac" pango.png - doesn't work
convert -font test-Regular.ttf -pointsize 124 label:"ac" label.png - works
When I run convert -version I get:
Version: ImageMagick 6.9.10-24 Q16 x86_64 2019-01-12 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype jng jp2 jpeg lcms ltdl lzma openexr pangocairo png rsvg tiff webp wmf x xml zlib
Any ideas?
Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert and Pango Issues
Where can we get test-Regular.ttf to test? If that is a custom font, the please post a link to a copy of it.
Try specifying the font inside the PANGO markup language. See https://imagemagick.org/Usage/text/#pango
Try specifying the font inside the PANGO markup language. See https://imagemagick.org/Usage/text/#pango
Re: Convert and Pango Issues
Check your pms
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert and Pango Issues
Sorry, I am not having any success either with your font and Pango.
I tried:
where test.txt was a UTF-8 compatible text file contains and showing your actual characters.
Using IM 6.9.10.24 Q16 Mac OSX.
However, this works:
I tried:
Code: Select all
convert -font jeremy-Regular.ttf -pointsize 124 PANGO:"ac" pango.png
and
convert PANGO:'<span font="jeremy-Regular.ttf" size="126976">ac</span>' pango.png
and
convert -font jeremy-Regular.ttf -pointsize 124 PANGO:"@test.txt" pango.png
Using IM 6.9.10.24 Q16 Mac OSX.
However, this works:
Code: Select all
convert -font /Library/fonts/jeremy-Regular.ttf -pointsize 124 CAPTION:"@test.txt" pango.png
Re: Convert and Pango Issues
Yeah maybe I made the font wrong. I'm going to take a closer look at it. I'll report back once I find out anything out. Thanks for your help!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert and Pango Issues
As far as I know, pango needs the font to be installed at the system level, rather than simply using a font file.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert and Pango Issues
Your font is fine. See my additional comment above and here. Put the text showing your characters in a UTF-compatible text editor file and then specify the file in the CAPTION with the @ symbol as below. The following works for me.
See https://imagemagick.org/Usage/text/#unicode
Code: Select all
convert -font /Library/fonts/jeremy-Regular.ttf -pointsize 124 CAPTION:"@test.txt" pango.png
Re: Convert and Pango Issues
Alright, I'm narrowing it down, I think Pango isn't installed right as it doesn't seem to work with any fonts at all for me.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert and Pango Issues
Did you follow my command using CAPTION? Did that work? You should not need PANGO as CAPTION does work if you specify a UTF-8 compatible text file with your text in your actual font.
Note snigbo's last comment about installing fonts into the System.
Note snigbo's last comment about installing fonts into the System.
Re: Convert and Pango Issues
Caption didn't really work for me and PANGO doesn't seem to work with Imagick. I need to spend sometime digging into convert and exec.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert and Pango Issues
To use CAPTION properly, you need to put your text into UTF-8 compatible text file that shows your characters properly. Then use @textfile.txt to load that text into CAPTION. See the link I provided.
Re: Convert and Pango Issues
Thanks!
Anyway this works:
convert PANGO:"<span font_family="jeremy" size="126976">ac</span>" pango.png.
It doesn't however seem to work from a PHP exec. I'm sure I'm just missing something small.
Anyway this works:
convert PANGO:"<span font_family="jeremy" size="126976">ac</span>" pango.png.
It doesn't however seem to work from a PHP exec. I'm sure I'm just missing something small.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert and Pango Issues
PHP uses different environment variables than your OS. So you might try putting the full path to convert in your exec() command