Displaying a specific Unicode character

Discussion in 'Java' started by Jave, Sep 5, 2003.

  1. Jave

    Jave Guest

    Hi everyone,

    I'm trying to display the Nigerian currency symbol (naira) which
    unicode code is 20a6 using the awt method drawString(String s). My
    code look somehow like this:

    g.drawString("324234 \u20a6");

    This code seems to be correct as a lot of other characters like \u20a4
    (pounds), \u20ac (euros), \u20a7 (spanish pesetas) etc. are displayed
    perfectly.

    I know it sounds weird but does anyone have a solution or at least an
    explanation.

    Thank you.

    Jave
    Jave, Sep 5, 2003
    #1
    1. Advertising

  2. Jave wrote:

    > Hi everyone,
    >
    > I'm trying to display the Nigerian currency symbol (naira) which
    > unicode code is 20a6 using the awt method drawString(String s). My
    > code look somehow like this:
    >
    > g.drawString("324234 \u20a6");
    >
    > This code seems to be correct as a lot of other characters like \u20a4
    > (pounds), \u20ac (euros), \u20a7 (spanish pesetas) etc. are displayed
    > perfectly.
    >
    > I know it sounds weird but does anyone have a solution or at least an
    > explanation.
    >
    > Thank you.
    >
    > Jave


    Are you sure that the Font has the symbol?
    David Zimmerman, Sep 5, 2003
    #2
    1. Advertising

  3. Jave

    Roedy Green Guest

    On 5 Sep 2003 05:28:14 -0700, (Jave) wrote
    or quoted :

    >I know it sounds weird but does anyone have a solution or at least an
    >explanation.


    The problem is the font you use must also support that character. See
    http://mindprod.com/jgloss/font.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Sep 5, 2003
    #3
  4. Jave

    Roedy Green Guest

    On 5 Sep 2003 05:28:14 -0700, (Jave) wrote
    or quoted :

    >g.drawString("324234 \u20a6");
    >
    >This code seems to be correct as a lot of other characters like \u20a4
    >(pounds), \u20ac (euros), \u20a7 (spanish pesetas) etc. are displayed
    >perfectly.


    I run into the same problem displaying the Naira symbol in the CurrCon
    currency conversion applet see
    http://mindprod.com/zips/java/currcon.html Most people don't have a
    default font installed that can handle it. It just shows as a little
    box, though it handles many of the other currency symbols.

    The key would be to find a font that is
    1. redistributable
    2. truetype
    3. supports the Naira

    and then bundle it with your app and use that font just to display
    currency symbols.




    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Sep 5, 2003
    #4
  5. Jave

    Jave Guest

    Roedy Green, you are just the best, Tahoma supports this symbol and
    now it works perfectly. Thanks to all of you.

    Jave
    Jave, Sep 8, 2003
    #5
    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. Robert Mark Bram
    Replies:
    0
    Views:
    3,916
    Robert Mark Bram
    Sep 28, 2003
  2. =?Utf-8?B?SmF2?=

    Is ViwState Page-Specific or UserControl-Specific

    =?Utf-8?B?SmF2?=, Aug 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    529
    =?Utf-8?B?SmF2?=
    Aug 16, 2006
  3. Kenneth McDonald
    Replies:
    1
    Views:
    826
    Carl Banks
    Dec 27, 2006
  4. mazdotnet
    Replies:
    2
    Views:
    393
    Alexey Smirnov
    Oct 2, 2009
  5. Tyler
    Replies:
    1
    Views:
    934
    Robert Klemme
    Jul 29, 2011
Loading...

Share This Page