google-code-export / mediaplayer2-for-sh4

Automatically exported from code.google.com/p/mediaplayer2-for-sh4
1 stars 0 forks source link

Bad Tashkil on Arabic subtitles, Diacritics treated as full letters #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Thanks a lot for the great assistance and work you're doing to support Arabic 
language into mp2. I'll continue pushing any bugs I find till Arabic support is 
just perfect :)

Arabic diacritics[0] are meant to hint at correct pronunciation, however they 
should not be treated as full-fledged letters. The current Arabic shaping 
engine used in mp2 displays them as full letters. This is very annoying and 
plain wrong. It would be way much better to totally strip them out, if they 
cannot be displayed correctly (which is the ideal case). I am attaching a 
screenshot that shows the error and how a word is cut in half by Shadda[1] 
diactric, which it should not. Again stripping them out would be much better 
than this.

[0]: http://en.wikipedia.org/wiki/Arabic_diacritics
[1]: http://en.wikipedia.org/wiki/Shadda

Original issue reported on code.google.com by email.ah...@googlemail.com on 20 Sep 2013 at 8:31

Attachments:

GoogleCodeExporter commented 9 years ago
You're welcome. 

The issue you have should be matter of used font type. MP2 is using Ubuntu as 
standard font, since it contains entire unicode character set, so all languages 
should be displayed correctly. 

However since you have problem with it, you can try arabic fonts only.Font has 
to be True Type font(ttf) format.

You can try these:
http://freearabicfonts.com/Free_Arabic_Fonts
http://ftp.gnu.org/gnu/freefont/freefont-ttf-20120503.zip

HOW TO ADD FONTS TO MEDIAPLAYER2:

1. Copy your fonts(need to be in ttf format) to Mediaplayer2/subtitles/fonts 
directory
2. You need to rename your fonts to format:
    fontname-R.ttf: regular font - mandatory
    fontname-B.ttf: bold font - optional, if missing regular font will be used
    fontname-I.ttf: italic font - optional, if missing regular font will be used

    If you dont rename it to this format, font will be used as regular for all styles..

3. Restart Enigma2
4. Choose your fonts from subtitles menu in MediaPlayer2

If you find some font which is fine for you, let me know and I will add it as 
arabic font to MP2. 

Thanks

Original comment by mx3Lm...@gmail.com on 21 Sep 2013 at 7:39

GoogleCodeExporter commented 9 years ago
Thanks a lot for your reply. I have tried a font from FreeArabicFonts, and the 
problem remains as is. While I'm not technically a developer, my understanding 
is that this really is not a font issue. The letter "shadda" is already in the 
font, however it's the font (shaping engine) that should do (vertical kerning?) 
to put the shadda right above the letter before it and not treat it as a 
separate letter (which it isn't). Excuse me if shaping/kerning are not the 
correct words, I'm not an expert in this area. I found a fairly good 
explanation in this site

http://www.eridanus.cz/id32402/jazyk/jazyky/semitohamitske(1_jazyky/arabs(2tina/
Microsoft_-_Middle%20Eastern%20Language%20Issues/Middle%20Eastern%20Language%20I
ssues.htm

Also it is my understanding that http://www.fribidi.org/ handles all such low 
level details. I wonder if we're linking into perhaps an older version that 
doesn't know how to handle Arabic diacritics like modern Linux GUIs do. Let me 
know the next step. Thanks a lot

Original comment by email.ah...@googlemail.com on 24 Sep 2013 at 6:07

GoogleCodeExporter commented 9 years ago
It looks like gstreamer uses fribidi to prepare arabic subtitles. Try to test 
arabic subtitles in standard media-player:
1.convert them to utf-8
2.rename them, that they will have same name as video file without extension
3.open video file and watch if subtitles render correctly

Please attach here subtitles which you're using in 
Arabic-subtitles-Bad-Tashkeel.png and exact position of subtitles in this 
picture.

Thanks

Original comment by mx3Lm...@gmail.com on 5 Oct 2013 at 6:52

GoogleCodeExporter commented 9 years ago
Removed accents:

1.copy subtitles.py to 
/usr/lib/enigma2/python/Plugins/Extensions/MediaPlayer2/subtitles/
2.remove subtitles.pyo
3.restart e2

Let me know if it helps, thanks.

Original comment by mx3Lm...@gmail.com on 5 Oct 2013 at 7:17

Attachments: