Page 1 of 1

character set

Posted: 2007-01-21T10:18:24-07:00
by xsearch
turkish character problem

convert -background lightblue -fill black -font comicbd.ttf -size 320x140 -pointsize 18 \ caption:"IiİıĞğÜüİiŞşÖöÇç" \ sample.jpg

Output sample :

Image

i want configure main charset turkish. but how?

Posted: 2007-01-21T10:28:20-07:00
by Bonzo
There is a section that may help you out part way down this page: http://www.cit.gu.edu.au/~anthony/graph ... ick6/text/

Edit :

I tried this and the output is below

Code: Select all

exec("/usr/local/bin/convert -background lightblue -fill black -font comicbd.ttf -size 320x140 -pointsize 20 caption:\"IiIiGgÜüIiSsÖöÇç\" sample.jpg ");
I wonder if it is partialy due to the font you use - if the character is not there it is replaced with something else ? Again I didn't get some of the letters in the code so I assume my PC is not setup for them ? Therfore they were not in the output image ?

Image

Posted: 2007-01-21T11:16:00-07:00
by Bonzo
Right after a further test I find that if I change the "Encode in ANSI" to "Encode in UTF-8" in my editor ( Notepad+++ ). I get all the characters in the code:

Code: Select all

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF8" />
</head>
<body>
<?php
exec("/usr/local/bin/convert -background lightblue -fill black -font comicbd.ttf -size 320x140 -pointsize 20 caption:IiİıĞğÜüİiŞşÖöÇç sample.jpg ");
?>
<img src="sample.jpg">
</body>
</html>
I have also done things "properly" now and have added the <html> tags etc. and used the meta tag for UTF8; I may not need to have done this but I thought it would be a good idea.

Image

Note I had to remove the " around the text or else I had the "squares" instead of the characters.

Posted: 2007-01-21T18:51:29-07:00
by anthony
You get squares if the font does not handle the specific UTF-8 characters.

This is a UTF-8 character string and few commandline handlers especially windows commandline, handles UTF-8 directly. I recommnd the UTF-8 string be piped into Im using a file or pipeline. This is the way I handle the chinese text in IM Examples
http://www.cit.gu.edu.au/~anthony/graph ... t/#unicode