×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    4

    Drawing Hebrew text

    When I draw Hebrew text with Graphics.drawString(), phone automatically reverces order of characters. Siemens phones do the same way. But Motorola and SonyErricsson do not.

    First of all, what is the algorithm behind this? Does it scans string for Hebrew characters and then reverces string?

    Can I detect some way this behaviour? Currently, displaying Hebrew text on Siemens/Nokia and Motorola/SE shows different results.

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Drawing Hebrew text

    AFAIK this behaviour is implementation dependent. There are a set of languages like Hebrew, Arabic etc where letters are written from right to left. And this shall be handled by the phones implementation. Here is a similar discussion with regarding to Arabic charectors.
    http://agathonisi.erlm.siemens.de:80...ID=48922#48922

    >>Can I detect some way this behaviour?

    IMHO what you can do is to get the current language code with
    Code:
    System.getProperty("microedition.locale")
    and if the language code returned is of a language to be written from right to left(eg:Hebrew, Arabic) then do the necessary action.

    Regards
    Gopal

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    Re: Drawing Hebrew text

    Unfortunately there is method to query the phone as to whether it know how to handle right-to-left languages or not.

    You basically have two choice:
    1) Test on every phone you plan on supporting and see how they print, and then make specific builds for phones that do and phones that don't.
    2) Don't use drawString(). If you make your own custom font (using images) you have complete control over how you draw the characters. If you want to have one build supporting all phones then this is probably your only option.

    shmoove

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    4

    Re: Drawing Hebrew text

    Thanks for unswers.

    I have decided to use Graphics.drawChar() to achieve consistent behaviour on all phones.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    39

    Re: Drawing Hebrew text

    Hi,

    Does anyone know if there is a way to query the system whether the current language selected on the phone is right to left or left to right. Is there any such property for a font?

    Using the function CGraphicsContext:rawTextExtended() and using the property iParRightToLeft of TDrawTextExtendedParam, the phone renders the arabic text correctly, but I need to find out if this text needs to be left aligned or right aligned?

    Thanks,
    Brijesh

  6. #6
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Drawing Hebrew text

    Hi Brijesh,

    This is the Mobile Java section. It seems that your question is best suited to this Symbian C++ section - http://discussion.forum.nokia.com/fo...isplay.php?f=6

    BR,

    Juarez Jr

Similar Threads

  1. Drawing text in white color (Nokia 3650)
    By alexgodin in forum Mobile Java Media (Graphics & Sounds)
    Replies: 17
    Last Post: 2005-02-24, 15:17
  2. Replies: 0
    Last Post: 2004-11-24, 18:49
  3. Reading hebrew text file
    By nirmeidan in forum Mobile Java General
    Replies: 4
    Last Post: 2004-06-20, 15:32
  4. Drawing in text editors?
    By mstr_ in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-03-04, 15:05
  5. hebrew in text mode sms
    By MM2 in forum General Development Questions
    Replies: 0
    Last Post: 2003-08-14, 22:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×