Page 1 of 1
Fontconfig warning: ignoring UTF-8: not a valid region tag
Posted: 2014-07-12T04:27:13-07:00
by flyingduck
I want add some text on an image file with ImageMagick,
This is what I entered:
Code: Select all
convert -font Verdana label:"Text 123" pic.jpg pic_new.jpg
But it returns an error as follows:
Code: Select all
Fontconfig warning: ignoring UTF-8: not a valid region tag
The generated picture doesn't have any test added on.
I googled it but most of the posts are not helping much.
I am currently using
MacOSX 10.9.4,
ghostscript and
ImageMagick were both installed via
port in terminal.
Thanks for any kind of tips!
Re: Fontconfig warning: ignoring UTF-8: not a valid region t
Posted: 2014-07-12T08:19:45-07:00
by fmw42
label: (and caption:) do not work on an existing image. You must create a transparent image to apply label: and then overlay the result on your image.
To apply text directly to an image use either -annotate or -draw. Also the input image should come right after convert
see
http://www.imagemagick.org/Usage/text/
Ghostscript is not needed. What you need is fontconfig and freetype
convert -version
Version: ImageMagick 6.8.9-5 Q16 x86_64 2014-06-30
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib cairo fftw
fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib
Also is your Verdana font in your list of fonts.
convert -list font
If not, then you have to provide the full path to the font file or edit your type.xml file or use
http://www.imagemagick.org/Usage/script ... k_type_gen
Re: Fontconfig warning: ignoring UTF-8: not a valid region t
Posted: 2014-07-13T07:51:03-07:00
by flyingduck
Thanks.
I noticed that it's just because I can't put text on the image. Thanks for pointing out this important thing.
But even if I successfully created a new image, the font was still not applied and the warning still exist:
Code: Select all
Aws-MacBook-Pro: awguo$ convert -background lightblue -fill blue -font Verdana\
> -size 165x80 -pointsize 24 label:awguo labeltest.gif
Fontconfig warning: ignoring UTF-8: not a valid region tag
Here is the result for convert -version
Code: Select all
Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-07-12 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib djvu fftw fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps tiff webp x xml zlib
And I am sure the Verdana font is existed and path is correct in the type.xml. I tried some other fonts, got the same result. So no font is applied to my image.
Thanks for any kind of tips!
Re: Fontconfig warning: ignoring UTF-8: not a valid region t
Posted: 2014-07-13T10:46:15-07:00
by fmw42
I would upgrade the relevant delegates if they are not current versions and then reinstall IM. I suspect it is something in your installation, since it works fine for me with no error. One possibility is that your font Verdana may be corrupted, though perhaps not likely if other fonts fail. I suspect it is a corrupted fontconfig.
Re: Fontconfig warning: ignoring UTF-8: not a valid region t
Posted: 2014-07-13T16:18:42-07:00
by flyingduck
Thanks,
I will try to reinstall. Before that, how do I perform a perfect uninstall?
I installed GhostScript and ImageMagick via Port before.
Re: Fontconfig warning: ignoring UTF-8: not a valid region t
Posted: 2014-07-13T16:51:15-07:00
by fmw42
If you installed everything before using MacPorts, then just upgrade MacPorts and then upgrade your ports. See if that fixes it before doing anything more.
then
see
https://guide.macports.org/#using