PerlMagick, Annotate, and Webdings

A

Aaron Dalton

I am trying to Annotate an image with a character from the Webdings
font. I am running on a FreeBSD 5.3 box and all appropriate libraries
are installed. I can Annotate just fine with say an Arial font, but
when I want a special character from Webdings, it doesn't work. Below
is a code snippet:

use Image::Magick;
my $img = Image::Magick->new(size=>'100x100');
$img->Read('xc:white');
$img->Annotate(text=>"\x{00e9}",
font=>'/home/html/games/data/webding.ttf', pointsize=>136,
stroke=>'black', encoding=>'UTF-8', gravity=>'Center');
$img->Write(filename=>'png:test.png');

Now, you *should* get an upward-pointing arrow. But instead I get an
accented lowercase 'e'. What am I doing wrong?

Thank you so much for your time and assistance.
Aaron
 
A

Alan J. Flavell

I am trying to Annotate an image with a character from the Webdings
font.

Although I'm not familiar in details with the specific software you're
trying to use here, if it's Unicode-supporting software then that's
almost certainly irrelevant. Of more interest is - what's its Unicode
value?
$img->Annotate(text=>"\x{00e9}",

That character is authoritatively e-acute in Unicode. If you find
Unicode-supporting software which displays anything else, it's in a
state of sin.
Now, you *should* get an upward-pointing arrow.

No, you *should* get e-acute. If your Webdings font doesn't contain
an e-acute then it's counterproductive to ask for it, but the software
should have some kind of fallback whereby it'll go and find another
font which -does- contain it.
But instead I get an accented lowercase 'e'.

So it's working!
What am I doing wrong?

You're failing to specify the Unicode character for upward arrow.
Possibly it's \x{2191} that you're looking for, but feel free to
browse around the Unicode database. Or if you want it in HTML, I have
a version at http://ppewww.ph.gla.ac.uk/~flavell/unicode/
in this case I think you want something from the page
http://ppewww.ph.gla.ac.uk/~flavell/unicode/unidata21.html

good luck (this isn't really a Perl problem, though).
 
A

Alan J. Flavell

You're failing to specify the Unicode character for upward arrow.
Possibly it's \x{2191} that you're looking for, but feel free to
browse around the Unicode database.

Well, having now browsed the font, I see that it has your arrow in the
"private use area" at \x{f0e9} - since that's in the PUA, you won't
find the actual glyphs tabulated in the Unicode database.

That isn't a very robust way to use Unicode, but it *might* serve your
current purposes (untested in the specific context, sorry).

(still isn't a Perl problem, though, but I can't work out where best
to redirect it, so I'll stick. Apologies to the regulars.)
 
A

Aaron Dalton

Alan said:
Well, having now browsed the font, I see that it has your arrow in the
"private use area" at \x{f0e9} - since that's in the PUA, you won't
find the actual glyphs tabulated in the Unicode database.

I apologize. I obviously completely misunderstood my problem. I did
not understand all the issues surrounding Unicode. Really all I want is
for the PerlMagick module to use the glyph labeled Character+# in the
Webdings font table in my Annotate command. I've tried chr(#) to no
avail. I noticed a fair number of PerlMagick Q/A's in the newsgroup so
I ventured to ask the question. I will find a more germane venue to
explore. I do sincerely appreciate your time and response, however!

Cheers!
Aaron
 
A

Alan J. Flavell

I apologize. I obviously completely misunderstood my problem.

Not at all. It's a very common structure clash (and - for all that I
knew - it *might* even have "worked" - I mean "worked" in the sense of
doing what the author intended, rather than in the sense which the
specifications require). But you say that it didn't, and that's where
I came in...
Really all I want is for the PerlMagick module to use the glyph
labeled Character+# in the Webdings font

Sure, I understand that; but that isn't how Unicode is meant to work,
and - since you said it wasn't doing what you intended, I drew the
conclusion that it was doing what Unicode intended instead.

I'm sorry I couldn't offer more concrete help in terms of this
particular software, though. Did anything useful happen when you
tried \x{f0e9} ? - from your lack of response, I presume the answer
must have been "no".
 
R

Ron Savage

On Sun, 6 Mar 2005 07:08:38 +1000, Aaron Dalton wrote:

Hi Aaron
 I am trying to Annotate an image with a character from the Webdings

If you write a little program to dump out the Webdings font file you'll findcharacters are often 2 or 3 off from where you expect them to be, whenaccessing them from Image::Magick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top