×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Dec 2010
    Posts
    228

    Question Arabic strings written in reverce order

    Hi again,

    sorry for going back to this thread again, but i faced a problem while drawing arabic characters to the home screen.
    The characters is drawn upside down( in the reverse ) what i mean if the case will happen in english and i have the HELLO word then it will be displayed OLLEH

    What should i do to resolve this error? note i have execute a messagebox before the drawing and the word is in the correct way
    void CWindowDrawer:raw(TBuf<100>& TheNewsToDisplay)
    {
    QString qString((QChar*)TheNewsToDisplay.Ptr(),TheNewsToDisplay.Length());
    QMessageBox::information(NULL,"",qString); //the string is displayed correctly here in the message box
    iWindowGc->DrawText(TheNewsToDisplay,TRect(25,StartY2,DrwRect.Width(),(StartY2 + iMyFont->HeightInPixels())),iMyFont->AscentInPixels(), CGraphicsContext::ELeft, 5);// the text is drawn upside down
    ...

    Thank you

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Arabic strings written in reverce order

    But are arabic words not supposed to be from right to left?

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Arabic strings written in reverce order

    Yes they should be, but there are some issues on drawing text when the layout is mirrored. I actually would have code for this, but unfortunately those codes are inside my personal projects, and thus are not with me here at office. Will be checking them later as I get home, though today might be a bit busy..

  4. #4
    Registered User
    Join Date
    May 2012
    Posts
    18

    Re: Arabic strings written in reverce order

    Hi, any update concerning this post?
    Sorry for being late but seems that i faced a problem with the Nokia developer site in the past week , so i created a new profile to be able to reply to threads.

    Thank you

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Arabic strings written in reverce order

    Sorry about not checking this earlier, anyway here's older thread: http://www.developer.nokia.com/Commu...abic-mix-issue

    So basiclaly you would check whether current language is mirrored, and if it is you would use the ConvertToVisualAndClipL to modify the buffer to be in correct order before drawing it
    <code>
    if(AknLayoutUtils::LayoutMirrored()){
    AknBidiTextUtils::ConvertToVisualAndClipL(buffff,*useFont, aRect.Width(), aRect.Width(), AknBidiTextUtils::ERightToLeft );
    }
    </code>

  6. #6
    Registered User
    Join Date
    May 2012
    Posts
    18

    Thumbs up Re: Arabic strings written in reverce order

    Quote Originally Posted by symbianyucca View Post
    Sorry about not checking this earlier, anyway here's older thread: http://www.developer.nokia.com/Commu...abic-mix-issue

    So basiclaly you would check whether current language is mirrored, and if it is you would use the ConvertToVisualAndClipL to modify the buffer to be in correct order before drawing it
    <code>
    if(AknLayoutUtils::LayoutMirrored()){
    AknBidiTextUtils::ConvertToVisualAndClipL(buffff,*useFont, aRect.Width(), aRect.Width(), AknBidiTextUtils::ERightToLeft );
    }
    </code>

    Thank you symbianyucca

    the code works like a charm, note that i replaced ERightToLeft with ELeftToRight to avoid some errors that i faced when the text is in English.

    Thank you again for your help
    Best Regards,
    Rondo

Similar Threads

  1. Replies: 2
    Last Post: 2009-06-09, 10:33
  2. How to run wml code written in jsp
    By bfmca.j2me in forum Mobile Web Server
    Replies: 1
    Last Post: 2009-05-23, 07:29
  3. Replies: 5
    Last Post: 2008-10-12, 09:10
  4. what is written into memory by RFileStream
    By Casper1314 in forum Symbian
    Replies: 3
    Last Post: 2006-10-03, 10:26
  5. App written for 3650 will not run on 7210?
    By richardsenior in forum Mobile Java General
    Replies: 6
    Last Post: 2003-12-09, 23:00

Posting Permissions

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