PerlMagick, Annotate, and Webdings

Discussion in 'Perl Misc' started by Aaron Dalton, Mar 5, 2005.

  1. Aaron Dalton

    Aaron Dalton Guest

    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
     
    Aaron Dalton, Mar 5, 2005
    #1
    1. Advertising

  2. 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/unicode/unidata21.html

    good luck (this isn't really a Perl problem, though).
     
    Alan J. Flavell, Mar 5, 2005
    #2
    1. Advertising

  3. 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.)
     
    Alan J. Flavell, Mar 6, 2005
    #3
  4. Aaron Dalton

    Aaron Dalton Guest

    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
     
    Aaron Dalton, Mar 6, 2005
    #4
  5. 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".
     
    Alan J. Flavell, Mar 6, 2005
    #5
  6. Aaron Dalton

    Ron Savage Guest

    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.
     
    Ron Savage, Mar 27, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ALuPin

    Back-Annotate Assignments

    ALuPin, Oct 20, 2004, in forum: VHDL
    Replies:
    1
    Views:
    1,800
    Ben Twijnstra
    Oct 20, 2004
  2. Jerry

    Font WebDings

    Jerry, Aug 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    448
    Arjen
    Aug 2, 2003
  3. John Baima

    Annotate a floor plan

    John Baima, Jan 19, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    2,918
    John Baima
    Jan 24, 2007
  4. Robin Becker

    annotate a traceback

    Robin Becker, Oct 29, 2009, in forum: Python
    Replies:
    1
    Views:
    249
    Diez B. Roggisch
    Oct 29, 2009
  5. otown

    wrap text with annotate

    otown, Dec 28, 2006, in forum: Ruby
    Replies:
    1
    Views:
    115
    Eric Hodel
    Dec 28, 2006
Loading...

Share This Page