You Are Here:

Community: Developer Discussion Boards

#1 Old Write Arabic letters with Canvas and Graphics class - 2009-04-25, 18:48

Join Date: Apr 2009
Posts: 27
Bertil_
Offline
Registered User
I am trying to write an Arabic string with the Graphics.drawString(String) method but it puts the letters in wrong order and dont put the letters together.

Are there other ways of writing strings with the low level Graphics API that I can test?

I have tested one high level method and it worked just fine (Form, stringItem) but I prefer the low level API.
Reply With Quote

#2 Old Re: Write Arabic letters with Canvas and Graphics class - 2009-04-25, 19:12

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
I think support for right-to-left scripts (like Arabic) in the low-level UI on many devices is probably quite poor.

You could use Graphics.drawChar(), but I suspect you will get all the characters in isolated form.

You can create your own font, and use that. See Custom fonts: step by step. This is a rough guide to creating and using your own font.

The advantage to using your own font is that you get control over the appearance, and you get the same appearance on all devices.

The sample code given is suitable for left-to-right scripts like Latin, Cyrillic or Greek.

For right-to-left, "x += ..." becomes "x -= ...", and you'd want to use Graphice.RIGHT instead of .LEFT. (Supporting L-R and R-L in the same code is more complicated!!)

You also need to draw each character in isolated, initial, medial and final forms, and choose the correct form (since all forms of the same letter have the same Unicode value).

Are you trying this on an emulator or device? If you're using an emulator, it's worth checking if the device is better, before you try to fix a problem that only happens on the emulator...

Cheers,
Graham.
Reply With Quote

#3 Old Re: Write Arabic letters with Canvas and Graphics class - 2009-04-25, 19:48

Join Date: Apr 2009
Posts: 27
Bertil_
Offline
Registered User
tanks for the answer!

Actually the emulator writes the words just fine but my device doesn't

With your right-left example do you mean anchor points?
Reply With Quote

#4 Old Re: Write Arabic letters with Canvas and Graphics class - 2009-04-26, 11:13

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
I mean the direction of writing. So, "left-to-right" is scripts like Latin or Cyrillic, which are normally anchored at the left. "Right-to-left" is Arabic or Hebrew, normally anchored at the right.

You might want to search the forum... there are certainly Arabic-speaking users here, and some of them must have seen the same problem.

Cheers,
Graham.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Applying Graphics to Canvas used for Image capture sepanaho Mobile Java Media (Graphics & Sounds) 7 2009-11-11 16:52
Nokia E61i is caching Graphics of Canvas !!! arpit2agrawal Mobile Java Media (Graphics & Sounds) 5 2009-01-28 09:37
Weird Canvas Error... i5009820 Python 4 2008-12-01 10:17
How to draw graphics on video Canvas yaziaiwugui Mobile Java Media (Graphics & Sounds) 1 2007-08-23 09:03
Using the Graphics object outside of paint()? weedy Mobile Java General 4 2003-06-06 11:03

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ