Page 1 of 1

Problem with just three non-ASCII characters

Posted: 2007-10-27T02:46:19-07:00
by mkochano
Hi

I've tried to render some text using such command:

Code: Select all

convert \
        /tmp/black.png \
        -font $1 \
        -draw 'encoding "Latin 2" font-size 40 fill white gravity Center text 0,0 "aącćeęlłnńoósśzżxź
AĄCĆEĘLŁNŃOÓSŚZŻXŹ"' \
        /tmp/font_$1.png
It comes that most of characters are rendered correctly, but three - both lower and upper case - are not. These are:
- "a with ogonek";
- "s with accent";
- "z with accent.

It happens with all fonts that should contain iso-8859-2 characters. Here is an example:
Image

And here is the same text rendered with GIMP:
Image

Do you have any idea what's going on?

Regards
Michał

Re: Problem with just three non-ASCII characters

Posted: 2007-10-27T05:35:43-07:00
by Bonzo
I have just tried this on my server and it works OK. I made sure when I wrote the code my editor was in UTF-8 not ANSI as that is its standard setting. I presume your standard font has those characters ?

I seem to remember annotate is better for this sort of thing.
Image

Code: Select all

<?php
exec("convert -size 900x100 xc:black -draw 'encoding \"Latin 2\" font-size 40 fill white gravity Center text 0,0 \"aącćeęlłnńoósśzżxź
AĄCĆEĘLŁNŃOÓSŚZŻXŹ\"' font.png");
?>
Image

Code: Select all

<?php
exec("convert -size 900x100 xc:black  -pointsize 40 -fill white -gravity Center -annotate +0+0 \"aącćeęlłnńoósśzżxź
AĄCĆEĘLŁNŃOÓSŚZŻXŹ\" font1.png");
?>

Re: Problem with just three non-ASCII characters

Posted: 2007-11-01T03:15:02-07:00
by mkochano
Bonzo wrote:I have just tried this on my server and it works OK. I made sure when I wrote the code my editor was in UTF-8 not ANSI as that is its standard setting.
From what you wrote about encoding I guess you tried this on Windows. I encountered this problem on Linux. The file was written in ISO-8859-2 (Latin 2) encoding as it is specified in "convert" arguments.
I presume your standard font has those characters ?
I didn't use the standard font. I tried all 479 fonts "convert" can see. These fonts can be divieded in two groups:
  1. fonts that do not render correctly any character from my test - they don't contain polish glyphs;
  2. fonts that render correctly all but these three characters from my test - they do contan polish glyphs and other programs - like GIMP - have no problems with them.
This particular font which I used as an example in my original posting (Adelaide-Normal) has all needed glyphs, this is why I shown the same text rendered by GIMP.

Can anybody try this on Linux?

Michał

Re: Problem with just three non-ASCII characters

Posted: 2008-05-13T06:11:46-07:00
by Jaclaw
Bonzo wrote:

Code: Select all

<?php
exec("convert -size 900x100 xc:black -draw 'encoding \"Latin 2\" font-size 40 fill white gravity Center text 0,0 \"aącćeęlłnńoósśzżxź
AĄCĆEĘLŁNŃOÓSŚZŻXŹ\"' font.png");
?>

Code: Select all

<?php
exec("convert -size 900x100 xc:black  -pointsize 40 -fill white -gravity Center -annotate +0+0 \"aącćeęlłnńoósśzżxź
AĄCĆEĘLŁNŃOÓSŚZŻXŹ\" font1.png");
?>
My case is even worse.
Both commands provided by you produce:
Image

Anyone has an idea what might be wrong with my IM (version 6.4.1 on Linux)?