Rockbox Technical Forums

Support and General Use => User Interface and Voice => Topic started by: amr on August 03, 2009, 02:26:37 PM

Title: viewing Arabic text
Post by: amr on August 03, 2009, 02:26:37 PM
Hi there,

The text viewer plugin works fine with me when displaying normal Arabic text, but for Arabic scripts containing diacritics - harakat - , the letters get displayed unjoined .., is there something missing in the BiDi implementation ??

Thanks,
Amr
- ver. r21444M-0906
- Sansa e250 v2
Title: Re: viewing Arabic text
Post by: JdGordon on August 04, 2009, 08:28:55 PM
you are using a rather old build and we prefer people to use the most recent when they report issues...  although in all honesty I cant think of anything recent which would have fixed the issue....
we apparently dont have many users who use "exotic" lang/fonts so yes there is probably issues with bidi... best way to get this fixed is find someone who can code.... thai support has issues as well which are slwoly being worked on, maybe he will fix the issues fr you (search the patches)
Title: Re: viewing Arabic text
Post by: amr on August 06, 2009, 12:43:31 PM
regarding the build, I've checked it out from svn only 1 month ago, so it is supposed to be ver. 3, but that is what I get from rockbox info in the system menu..., could it be because that's a v2 sansa ?

about the language support , I know that there is an open source library called fribidi (http://fribidi.org/) that handles all the issues of shaping, joining and displaying right to left scripts.., may it be used as a replacement for the current bidi implementation ??

Thank you
Title: Re: viewing Arabic text
Post by: GodEater on August 06, 2009, 01:08:36 PM
1 month is pretty ancient. We sometimes get 10-20 changes to the code a *day*. So there's likely an awful lot changed in that time.
Title: Re: viewing Arabic text
Post by: amr on August 11, 2009, 02:17:25 PM
I guess pango (http://www.pango.org/) may be useful too ...
Title: Re: viewing Arabic text
Post by: TruthTaco on August 13, 2009, 03:22:23 AM
I also have similar issues with the text viewer, using a build from a few days ago on my fuze and it wont displaying - correctly. I also tested it on a simulator for another player thats supported, e200 and it was the same problem. Also i think its having trouble displaying ' too.
Title: Re: viewing Arabic text
Post by: amr on August 13, 2009, 02:47:49 PM
Which language? and what is the specific displaying problem?

Does it relate to special characters too?

P.S.
I'm trying investigating the firmware code but I'd have to be way more patient ! I had no experience in such thing.

I also have similar issues with the text viewer, using a build from a few days ago on my fuze and it wont displaying - correctly. I also tested it on a simulator for another player thats supported, e200 and it was the same problem. Also i think its having trouble displaying ' too.
Title: Re: viewing Arabic text
Post by: TruthTaco on August 14, 2009, 01:16:02 AM
English, its just the dash - and the '

instead of displaying said characters it just shows a accented A and two weird looking boxes.
Title: Re: viewing Arabic text
Post by: amr on August 28, 2009, 08:16:46 AM
As far as I've known till now, the libraries I set my hopes on (fribidi, pango) or their core lib (HarfBuzz) are based on OpenType Layout, while rockbox uses a proprietary font format... which means there won't be a direct plug and play of the opentype lib into rockbox..., but maybe we can make use of the code implementing the algorithm to get some ideas for improving the one of rockbox...
Title: Re: viewing Arabic text
Post by: amr on September 05, 2009, 09:03:38 AM
A similar issue with Hindi script here:
http://www.rockbox.org/tracker/8491
Title: Moving to appearance froum
Post by: amr on September 12, 2009, 04:27:28 AM
This issue is general that is related to the firmware code (mainly lcd-xxx.c, arabjoin.c, bidi.c) , so it has nothing to do with the text viewer plugin.

To the admin: I suggest moving this topic to the WPS and Appearance forum
Title: Re: viewing Arabic text
Post by: markun on September 20, 2009, 03:25:57 AM
I would have moved this to "User Interface and Voice" where we usually put codepage and language issues, but ok.

I'm the guy who wrote arabjoin. Are there combined glyphs for these characters with diacritics in the fonts or do we have to combine the images ourselves? My guess is the latter. If someone would implement glyph combining then we could also finally fix Thai rendering.

And I don't know about using pango in rockbox. It sounds like overkill.
Title: Re: viewing Arabic text
Post by: amr on October 03, 2009, 04:03:33 AM
For Arabic, we have to combine glyphs of the diacritics - that are called non-spacing combining marks - with the characters glyphs ourselves. Those marks take zero-space where they are placed above or under the letters they follow in the sequence, and their position in the characters sequence shouldn't affect the letters shaping and joining... So, I guess that arabjoin.c and bidi.c would be kept intact, and all the changes would be made in lcd-xxx.c

When I contacted HarfBuzz's developer - the rendering engine of pango - he agreed that it'd be difficult to use the code directly in rockbox.

it makes sense for the post to be under "user interface" indeed, I was confused about classifying it as I didn't find a topic that's directly related to "firmware"
Title: Re: viewing Arabic text
Post by: tomers on November 22, 2009, 01:19:13 AM
Just to let you all know that Phinitnun Chanasabaeng (crackerizer) and me are working on a resolution for this issue:

FS#10720 - diacritic positioning patch
http://www.rockbox.org/tracker/task/10720

I've also added support for RTL languages (Hebrew and Arabic). The latest patch there already solves this issue (you can use it now), but the code is still a work-in-progress, and being revised before committing.

Tomer
Title: Re: viewing Arabic text
Post by: tomers on November 24, 2009, 04:21:46 PM
FS#10720 (diacritic positioning patch) was committed in revision 23742. This issue should now be solved.
Please provide feedback, as to whether things work for you now.

Thanks,
Tomer