Skip to main content

arabic (reverse direction) drawing support

2 replies [Last post]
veritastr
Offline
Joined: 2008-11-24
Points: 0

i'm trying to display arabic text that is downloaded from a Unicode txt file. I'm using drawString to draw strings to the graphics layer.

the problem is the arabic letters show correctly (we can say that the font supports arabic) but they show in reverse order. also some arabic rules like one character has more than one drawing seems omitted.

any ideas about bidirectional (or arabic) text drawing?

program used in test: arcsoft totalmedia theatre 3.0
font: arial

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billf
Offline
Joined: 2004-02-13
Points: 0

(OK, maybe the java.net forum software has a bug that makes messages containing Arabic characters not show up. I guess server software has trouble with proper l10n/i18n, too!)

Aiwa, habibi. Fi BD-J, Arabi mushkila kabeer.

Drawing Arabic using "drawString()" is asking for two things that aren't guaranteed in the BD spec: Bi-directional text support, and support for properly joining Arabic letters. The fact that Blu-ray doesn't mandate font support for this shouldn't be too surprising -- even on PCs, proper support of Arabic is uneven at best. For example, on my Mac, Microsoft Word can't spell my name (baa-yaa-laam) properly, but textedit and pages can. Expecting a poor little BD player to have this level of internationalization support is asking a lot.

The next place to look is font strips. I've had some conversations about what it would take to do Arabic using font strips, and I think it might be doable. If I were to seriously study this, I think the first thing I'd do is abandon Unicode -- I'd do the hard work of figuring out what joins with what server-side, and send to the player a string that just identifies the glyphs I want rendered, rather than trying to do the letter-to-glyph translation on the client.

Really getting this right would be a fair chunk of work, though, especially if you wanted to go whole hog, and properly handle stuff like dagger Alif. I'm not sure if dagger alif has a different unicode expression than normal alif, but in either case, doing a decent job of the typesetting of words like "God" is probably something you want to get right. If memory serves, God is alif-laam-laam-dagger alif-taa marbuta.

It'd be a fun problem to work on! But, it'd be a fair amount of work, and depending on your application, it might be better to just go with server-rendered images.

Cheers,

Bill "al-Moomtastic" Foote

veritastr
Offline
Joined: 2008-11-24
Points: 0

thx Bill,

i don't think i'll give that much effort trying to identify the true glyphs and doing the hard work, at least not this time. maybe some day, if no player updates come with bidirectional text support, i may think about that.

by the time i tried two more players: sony ps3 (up to date) and windvd 8.0 (developer version). both gave same results with arcsoft.

i'll update the post if i learn anything else.

cheers, cagdas.