Click here to get back home

PerlMagick, Annotate, and Webdings

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
PerlMagick, Annotate, and Webdings Aaron Dalton 03-05-2005
Get Chitika Premium
Posted by Aaron Dalton on March 5, 2005, 3:08 pm
Please log in for more thread options


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",
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


Posted by Alan J. Flavell on March 5, 2005, 10:21 pm
Please log in for more thread options


On Sat, 5 Mar 2005, Aaron Dalton wrote:

> 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",

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 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).


Posted by Alan J. Flavell on March 6, 2005, 1:08 am
Please log in for more thread options


On Sat, 5 Mar 2005, Alan J. Flavell wrote:

> You're failing to specify the Unicode character for upward arrow.
> Possibly it's x 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 - 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.)


Posted by Aaron Dalton on March 6, 2005, 8:38 am
Please log in for more thread options


Alan J. Flavell wrote:
> On Sat, 5 Mar 2005, Alan J. Flavell wrote:
>
>
>>You're failing to specify the Unicode character for upward arrow.
>>Possibly it's x 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 - 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


Posted by Alan J. Flavell on March 6, 2005, 4:11 pm
Please log in for more thread options


On Sun, 6 Mar 2005, Aaron Dalton wrote:

> 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 ? - from your lack of response, I presume the answer
must have been "no".


Similar ThreadsPosted
PerlMagick - Annotate - no fonts December 12, 2006, 3:55 pm
PerlMagick - Annotate - not working September 11, 2007, 11:18 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap