Page 1 of 1
Support for Thai UTF-8 fonts
Posted: 2012-01-06T03:30:46-07:00
by rlp1938
I am using Imagemagick as installed in Ubuntu 11.10. When try to annotate with Thai characters in UTF-8 format the font does not render. I just get question marks instead. The font I specify is known to support Thai script in other applications. Can I remedy this by building IM from source?
Thanks,
Bob Parker
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-08T18:46:44-07:00
by anthony
Perhaps IM is not seeing the font with the thai glyphs, or the Thai glyphs are not in UniCode positions
Use "-debug annotate" to see exact what font file is being used by IM.
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-09T05:17:16-07:00
by rlp1938
./dropshadow.sh สร้อย สร้อย.jpg
2012-01-09T19:08:46+07:00 0:00.010 0.010u 6.6.0 Annotate convert[7962]: annotate.c/RenderFreetype/1140/Annotate
Font /home/bob/.fonts/tahoma.ttf; font-encoding none; text-encoding none; pointsize 72
2012-01-09T19:08:46+07:00 0:00.010 0.020u 6.6.0 Annotate convert[7962]: annotate.c/GetTypeMetrics/733/Annotate
Metrics: text: สร้อย; width: 165.172; height: 87; ascent: 73; descent: -15; max advance: 100; bounds: 3.82812,0 31.8594,53.4375; origin: 170,0; pixels per em: 72,72; underline position: -4.6875; underline thickness: 2.03125
2012-01-09T19:08:46+07:00 0:00.010 0.020u 6.6.0 Annotate convert[7962]: annotate.c/RenderFreetype/1140/Annotate
Font /home/bob/.fonts/tahoma.ttf; font-encoding none; text-encoding none; pointsize 72
I have replaced -annotate in the script with -debug annotate.
Tahoma font produces good results with Thai script in many applications.
Bob Parker
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-09T16:02:54-07:00
by anthony
Works fine for me!
Code: Select all
convert -font tahoma.ttf -pointsize 36 label:สร้อย thai.gif
Not certain about the added funny squiggle above the second letter though.
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-10T22:06:43-07:00
by rlp1938
Ok thanks. So it looks like something is wrong with the Ubuntu build of it then.
I have tried the:
./configure
make && make install
on the source. It builds ok but all I end up with is a program that does nothing at all.
I suppose missing delegates.
Is there a list of possible libraries I can check out and download?
I've googled on this a bit and come up with tales of failure only.
BTW the funny squiggle over the text on your result is required to be there. It's a tone mark
I tried your command literally and I still just get question marks. Also I had to fully specify the location of the font because this Ubuntu version seems to have no idea of a font path.
Bob
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-10T23:08:06-07:00
by anthony
There was a recent change where ImageMagick did some switch from using freetype libraries to pango But that should not effect things too much.
Have a look at the list of dependancies given on
http://www.imagemagick.org/Usage/api/#build
I do not have an understanding of the package management generation under ubuntu and no one with the appropriate knowlegde has stepped forward to define how to create ubuntu packages, as such I have not yet listed anything specific.
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-11T02:16:13-07:00
by rlp1938
I followed your link to here
http://www.digitalsanctum.com/2009/03/1 ... buntu-804/
and installed the recommended packages.
I've now compiled and installed IM from source and at least it is able to render a gif but it still does not render the Thai script.
Nor does it have any idea of font path, I have to fully specify the path.
I think I'll file a bug report with Ubuntu.
Bob
Re: Support for Thai UTF-8 fonts
Posted: 2012-01-11T11:01:52-07:00
by fmw42
to get IM to know where your fonts are so that you can just specify the name, you need to run Anthony's script imagick_type_gen at
http://www.imagemagick.org/Usage/scripts/