Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > PerlMagick, Annotate, and Webdings

Reply
Thread Tools

PerlMagick, Annotate, and Webdings

 
 
Aaron Dalton
Guest
Posts: n/a
 
      03-05-2005
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
 
Reply With Quote
 
 
 
 
Alan J. Flavell
Guest
Posts: n/a
 
      03-05-2005
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{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/...unidata21.html

good luck (this isn't really a Perl problem, though).
 
Reply With Quote
 
 
 
 
Alan J. Flavell
Guest
Posts: n/a
 
      03-06-2005
On Sat, 5 Mar 2005, Alan J. Flavell wrote:

> 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.)
 
Reply With Quote
 
Aaron Dalton
Guest
Posts: n/a
 
      03-06-2005
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{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.
>


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
 
Reply With Quote
 
Alan J. Flavell
Guest
Posts: n/a
 
      03-06-2005
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{f0e9} ? - from your lack of response, I presume the answer
must have been "no".
 
Reply With Quote
 
Ron Savage
Guest
Posts: n/a
 
      03-27-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM
Font WebDings Jerry ASP .Net 1 08-02-2003 10:24 AM



Advertisments