Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-03-2012, 07:38 AM   #1
wlaf
Enthusiast
wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.
 
wlaf's Avatar
 
Posts: 44
Karma: 40820
Join Date: Jun 2012
Device: Kindle 3 WIFI
Arabic/Persian text on Kindle 3

So, after installing the latest update of Kindle 3, I learned that the Arabic/Persian font that was available on Kindle experimental browser is now available in the Kindle book reader itself.
It is important for those who want to read Arabic/Persian books on Kindle. Let me explain more:

For getting Arabic/Persian books work, it is needed that:

1. Kindle should understand UTF-8 encoding (This was ok, even before this update)
2. Kindle should be able to show Arabic/Persian characters (This is fixed with the latest update)
3. Kindle should do shaping (TODO, workaround is shaping manually)
4. Kindle should do right-to-left layout (Remaining problem)

So, this is what I've got with shaping characters manully, that is also possible to do with the help of layouout engines in windows/linux. Pango is available on Kindle, but Can we use it effectively to fix this problem?

I was searching for the ways to change font, and I came across Calibre plugin that can change font and justification of the text in Kindle.
https://www.mobileread.com/forums/sho...d.php?t=118635
How does the plugin does this? Is it possible to use the way it works to mirror the flow of characters on the screen?
Attached Thumbnails
Click image for larger version

Name:	kindle-persian.gif
Views:	2959
Size:	21.5 KB
ID:	95370  

Last edited by wlaf; 11-04-2012 at 05:42 AM.
wlaf is offline   Reply With Quote
Old 11-03-2012, 10:27 AM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@wlaf: It's come up a few times (look for posts by Doitsu & me, in particular).

TL;DR: Not much you can do, besides building KF8 files & no diacritics. It's not perfect, but it might be good enough for some scripts. (And, no, diving into pango to 'fix' it is probably not doable without breaking everything).
NiLuJe is offline   Reply With Quote
Advert
Old 11-03-2012, 12:05 PM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by wlaf View Post
3. Kindle should do shaping (TODO, workaround is shaping manually)
4. Kindle should do right-to-left layout (Remaining problem)
If you had problems with shaping or RTL layout, you most likely used Amazon Cloud or Calibre to transfer the files to your Kindle.
You'll need to manually transfer the files via the USB cable.

Unfortunately RTL Font embedding only works with fixed layout files.
Attached Thumbnails
Click image for larger version

Name:	default_font.jpg
Views:	1984
Size:	31.7 KB
ID:	95383  
Attached Files
File Type: epub Persian.epub (61.2 KB, 765 views)
File Type: mobi Persian.mobi (92.4 KB, 816 views)
Doitsu is offline   Reply With Quote
Old 11-03-2012, 12:08 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@Doitsu: You got stuff with complex shaping working in fixed-layout books?
NiLuJe is offline   Reply With Quote
Old 11-03-2012, 12:40 PM   #5
wlaf
Enthusiast
wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.
 
wlaf's Avatar
 
Posts: 44
Karma: 40820
Join Date: Jun 2012
Device: Kindle 3 WIFI
Doitsu, I could also be able to do it right! :-)
I was testing a "plain text file". Just setting direction to RTL in css worked fine. Shaping can be done manually. This program that can do the shaping:
I'll attach it in for easier access. As you can see even diacratics work, with some minor problems that I think comes from the design of the font.

Quote:
Unfortunately RTL Font embedding only works with fixed layout files.
Could you please explain more?

Attached Thumbnails
Click image for larger version

Name:	farsi-kindle-2.gif
Views:	11380
Size:	10.4 KB
ID:	95387  
Attached Files
File Type: rar Arabic-Shaping.v.0.2.rar (16.2 KB, 1328 views)
File Type: mobi farsi2.mobi (20.7 KB, 608 views)
File Type: zip farsi2.zip (425 Bytes, 645 views)

Last edited by wlaf; 11-03-2012 at 12:57 PM.
wlaf is offline   Reply With Quote
Advert
Old 11-03-2012, 01:16 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by NiLuJe View Post
@Doitsu: You got stuff with complex shaping working in fixed-layout books?
Yes, it worked, but it's too much of a hassle to be useful and embedded fonts are only effective for Latin text. (See screen capture.)

Quote:
Originally Posted by wlaf View Post
Shaping can be done manually.
Why would you want to shape letters manually when the Kindle rendering engine will do it for you?
IIRC, Persian usually doesn't use diacritics so why go through the hassle of preshaping the letters?

BTW, did you test my files on your K3, and did they display correctly? If they didn't, you probably transfered them via the Cloud or your FW3.4 update failed. (My test file didn't contain preshaped letters. I.e. preshaping is not required.)

Quote:
Originally Posted by wlaf View Post
Quote:
Originally Posted by Doitsu
Unfortunately RTL Font embedding only works with fixed layout files.
Could you please explain more?
Fixed layout books are KF8 .mobi files with special markup in them; they're primarily used for comic books and children's books. For more information see the Kindle Publishing Guidelines.
Attached Thumbnails
Click image for larger version

Name:	FixedLayout.JPG
Views:	1098
Size:	46.1 KB
ID:	95389  
Doitsu is offline   Reply With Quote
Old 11-03-2012, 01:35 PM   #7
wlaf
Enthusiast
wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.wlaf writes the songs that make the whole world sing.
 
wlaf's Avatar
 
Posts: 44
Karma: 40820
Join Date: Jun 2012
Device: Kindle 3 WIFI
Quote:
Originally Posted by Doitsu View Post
Yes, it worked, but it's too much of a hassle to be useful and embedded fonts are only effective for Latin text. (See screen capture.)
Yes, you're right. I was working with the Kindle font tweaking plugin. It only changed the font of the latin text, and after several tests, it make the device hang for awhile, so I think I should forget changing the font right now.
Quote:
Why would you want to shape letters manually when the Kindle rendering engine will do it for you?
IIRC, Persian usually doesn't use diacritics so why go through the hassle of preshaping the letters?
I had a v5 converted mobi file before that does not work on the device, so I though It is better to test plain text file and then go to mobi files. I had to shape the characters to see the plain text in Persian. I will regenerate the mobi file, and as you've said it should be ok.
Quote:
BTW, did you test my files on your K3, and did they display correctly? If they didn't, you probably transfered them via the Cloud or your FW3.4 update failed. (My test file didn't contain preshaped letters. I.e. preshaping is not required.)
Now I've tested your file and it was ok. As you've said, the publisher font didn't work, and the "alt" font (user font) also didn't work for me.
Quote:
Fixed layout books are KF8 .mobi files with special markup in them; they're primarily used for comic books and children's books. For more information see the Kindle Publishing Guidelines.
Thanks.
wlaf is offline   Reply With Quote
Old 11-06-2012, 11:50 PM   #8
kim1406
Connoisseur
kim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchforkkim1406 can load mercury with a pitchfork
 
Posts: 59
Karma: 48000
Join Date: Oct 2012
Device: kindle paperwhite
Dear Doitsu

Is there a way yet to change the font so that we can have more Arabic fonts on PW not only the default one as seen in your above Qur'an example?

thanks
kim1406 is offline   Reply With Quote
Old 11-07-2012, 03:35 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by kim1406 View Post
Is there a way yet to change the font so that we can have more Arabic fonts on PW not only the default one as seen in your above Qur'an example?
I hate the default font as much as you, but without a jailbreak and a font hack it's not possible to install additional fonts. And even with a font hack it might be tricky, because the Arabic glyphs come from the code2000.ttf fallback font. I.e. you could probably only replace the default font with one other Arabic font of your choice.
Doitsu is offline   Reply With Quote
Old 11-07-2012, 06:49 AM   #10
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Can't speak for the Touch/PW, but on the PW, the Fonts hack doesn't even tweak the CJK/I18N fonts for KF8 (only serif/sans & mono are changed).

It's on my TODO list, though.

EDIT: Wee, my brain is turning into mush. Scratch that. It *does* handle CJK & I18N in KF8... [Well, I18N at least, there might be some more tweaks needed for some CJK scripts].

Last edited by NiLuJe; 11-07-2012 at 07:46 AM.
NiLuJe is offline   Reply With Quote
Old 03-07-2013, 03:06 AM   #11
sevenkul
Member
sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.
 
Posts: 19
Karma: 29044
Join Date: Jan 2013
Device: Kindle Paperwhite
Kindle PW with latest firmware shows arabic text in KF8 files. There is neither need to add unicode conrol character nor dir=RL attributes and nor defining the book as a fixed layout book. I just drag & drop a simple HTML file to Kindle Previewer and copy the generated KF8 mobi file to my PW. However, if I have <idx:key> kind of tags in the HTML, Kindle Previewer generates simple mobi file and this mobi doesn't always show the arabic words in the correct order and font embedding is not supported.

What I wonder is the possibility of changing arabic font in KF8. I embedded a nice arabic font with some css like this one:

Quote:
<style type="text/css">
@font-face {
font-family: "Nazli";
src: url(Nazli.ttf);
}
.arabic {
font-family: "Nazli";
}
</style>
Arabic text shows up with this new font, characters and words are in correct order but I have a problem: Characters are not joined each other. Each of them are sperate, even the diacritics.

Does anyone succeeded embedding arabic font without a problem?
sevenkul is offline   Reply With Quote
Old 03-07-2013, 03:49 AM   #12
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by sevenkul View Post
Kindle PW with latest firmware shows arabic text in KF8 files.
So do all current Kindle models (K3 and higher).

Quote:
Originally Posted by sevenkul View Post
However, if I have <idx:key> kind of tags in the HTML, Kindle Previewer generates simple mobi file and this mobi doesn't always show the arabic words in the correct order and font embedding is not supported.
Since <idx:key> is only used in dictionaries, KindleGen will automatically generate a Mobi7 file, which doesn't support embedded fonts.

Quote:
Originally Posted by sevenkul View Post
Arabic text shows up with this new font, characters and words are in correct order but I have a problem: Characters are not joined each other. Each of them are sperate, even the diacritics.
Can you post a .zip file with the source code and the compiled .mobi file?
Doitsu is offline   Reply With Quote
Old 03-07-2013, 09:21 AM   #13
Gazella
Wizard
Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.Gazella ought to be getting tired of karma fortunes by now.
 
Gazella's Avatar
 
Posts: 1,705
Karma: 4619474
Join Date: Nov 2012
Device: Kindle Scribe, Kindle Paperwhite
What's the use of this? Are there Arabic ebooks available online? I'd be interested to know. Arabic is my main language but I always read English ebooks as I rarely find Arabic ebooks on the web.
Gazella is offline   Reply With Quote
Old 03-07-2013, 09:49 AM   #14
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Gazella20 View Post
What's the use of this? Are there Arabic ebooks available online? I'd be interested to know. Arabic is my main language but I always read English ebooks as I rarely find Arabic ebooks on the web.
Most likely Arab publishers didn't bother producing Arabic ebooks, because until a few years ago the majority of ebook readers couldn't render RTL text correctly. Also there's no equivalent of Project Gutenberg for Arabic books and the few sites that host Arabic ebooks seem to mostly offer Islam-centric ebooks, but if you look hard enough, you can find epub versions of books such as Kalila wa Dimna and Alf Layla wa Layla.

BTW, you could also create your own books from the .html files hosted at the Arabic Wikisouce website.

Hopefully, the increased availability of ereaders with Arabic support will eventually convince Arab publishers to offer their books as ebooks, too.

Last edited by Doitsu; 03-07-2013 at 11:32 AM.
Doitsu is offline   Reply With Quote
Old 03-08-2013, 02:22 AM   #15
sevenkul
Member
sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.sevenkul is faster than slow light.
 
Posts: 19
Karma: 29044
Join Date: Jan 2013
Device: Kindle Paperwhite
Quote:
Originally Posted by Doitsu View Post
Can you post a .zip file with the source code and the compiled .mobi file?
Source code and the screenshots are at the attachment.
Attached Thumbnails
Click image for larger version

Name:	Firefox.png
Views:	1307
Size:	15.9 KB
ID:	102592   Click image for larger version

Name:	Previewer.png
Views:	1140
Size:	50.4 KB
ID:	102593   Click image for larger version

Name:	Paperwhite Screenshot.png
Views:	1386
Size:	20.1 KB
ID:	102594  
Attached Files
File Type: zip kindle arabic font test.zip (483.7 KB, 1286 views)

Last edited by sevenkul; 03-12-2013 at 10:37 AM. Reason: added attachment
sevenkul is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a PRC book file in Persian (Farsi) golagha iRex 7 01-29-2013 09:19 PM
Kobo language support Persian/Arabic/Russian? Haieflosse Kobo Reader 1 05-02-2012 02:11 AM
Calibre is not viewing Arabic text ahmed_rdi Calibre 3 10-19-2011 04:42 AM
Sony PRS 700 - problems with arabic text firdavs_abc Sony Reader 1 09-26-2009 07:37 AM
openinkpot and middle eastern languages Arabic, Persian (Farsi) ali_sade OpenInkpot 16 05-06-2009 05:10 AM


All times are GMT -4. The time now is 10:50 PM.


MobileRead.com is a privately owned, operated and funded community.