Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : Unicode Enabled RTF


Honza
11-20-2006, 01:46 AM
Hi,
I know not a lot of people here will make use of the application I’ve just made... My problem was with reading eBooks in Czech. Since this language uses code page win1250, Reader doesn’t display it properly. After updating fonts, I could read Unicode TXT files and LRF, but RTF was still cursed. Maybe I did not search right. BookDesigner with LRF output is powerfull, but the results are not very nice.

So I found the way to encode the problematic characters in RTF so that Reader can display them. Here is my simple converter...
www.roomarranger.com/reader/rtfunicode.zip (http://www.roomarranger.com/reader/rtfunicode.zip)
What it does:

Converts non-ANSI characters to Unicode
Changes left alignment to full alignment and indents the first paragraph line (bonus option)
Adds Author tag to RTF (bonus option)


You can use this application even only for those two bonuses, but please have in mind that the application is very, very simple and stupid. I haven’t tested it so much. If you encounter any problems with your RTF, just contact me and I will try to fix it. I’m also interested if it works with Cyrillic or not.

My process of preparing eBook is following: I start with PDB file, use ABC Amber Palm Converter (font Times New Roman, 16pt) to convert to RTF and finally use RTF Unicode Converter to change the text alignment to full (a.k.a. justify) and add author’s name.

I hope Sony will open up LRF specification soon...

porkupan
11-20-2006, 02:09 PM
Actually, WordPad knows how to save the text in Unicode. It's a bit strange, that you cannot directly command it to do just that.

Usually, you can just open the document in WordPad, then:
SelectAll->change font to, say, Times New Roman->set "Script" to Western->Save

The above procedure is usually sufficient for the WordPad to convert a Cyrillic document into Unicode, readable by Connect Software and the Reader. (Connect Software has a bug of not being able to show Bold and Italic non-Latin characters in RTF).

I tried using RTFUnicode on a file from the Aldebaran library (http://lib.aldebaran.ru/), and it didn't seem to do much (said it converted 11 characters). However the RTF autogenerated from FB2 is not generally readable by Connect at all, the program crashes when it tries to open it. MS Word and WordPad are OK with it, though. So, it may be uncommon compressed format (its size is about 1/2 of the same text saved by Word or WordPad, and about 1/4 of the same text in Unicode).

RTFUnicode seemed to work just fine on a standard, generated by Word or WordPad non-unicode Cyrillic RTF file.

papiex
01-21-2007, 05:17 PM
Great tool! Works perfectly for my files .I miss only one option : multiple file processing .Would it be trouble to add such feature? Thanks for your work,best regards!

Honza
01-25-2007, 09:10 AM
Papiex, thanks for finding my small aplication useful.
Multiple file processing? OK, it's there... :) I've implmeneted it into new version, you can download it using the original link (the version number is 1.10 now). I didn't know how to implement it easily, so there is a limitation for the output file names - it just appends "_uni.rtf" extension to all original filenames.

papiex
01-25-2007, 02:38 PM
Thanks, that's exactly what I was looking for. The reason I ask for multiple files processing : I have a lot of single novel files, and converting each of them with single run of app isn't the most curious thing which can be made :) Actually, you r app inspired me to write my own. Apart from your features ,I'm gonna add some default rtf formating (I found that the best format for my eyes is : font 16p and gaps between lines : 18p , 0p marigins). With such app, I'll be able to transform plain ANSII text files( which is 90% of my ebook collection) to proper rtf files in just single run. I'll share ,when it's finished.

p13
03-13-2007, 08:20 AM
Hi, is anyone still working in this direction?
Honza? Papiex?

kacir
03-13-2007, 02:27 PM
Hi,
I know not a lot of people here will make use of the application ...
You might be surprised ;-)

Kacir

Honza
03-14-2007, 02:45 AM
Hi, is anyone still working in this direction?
Honza? Papiex?

Hi p13,
I am not working on it anymore, but it's just because I don't need any new features ;) Tell me what would you like to be there, and I can try to implement it...

kacir
03-14-2007, 11:46 AM
... After updating fonts, I could read Unicode TXT files and LRF, but RTF ...
Can you please post the steps needed to update the fonts?
Can you post the file with the fonts? For me it would be great to have font file I ca be 100% sure it will work.

Kacir

Honza
03-16-2007, 01:51 PM
Can you please post the steps needed to update the fonts?
Can you post the file with the fonts? For me it would be great to have font file I ca be 100% sure it will work.


I have this short list of commands you have to do:

1. Switch the e-book to recovery mode
$ ebook.py um recovery

Reader got reloaded and was ready to receive "updates"

2. Upload opt.fs:
$ ebook.py pwrite "Fsk" opt.fs

Because of it was done in DOS command line, it occurred that command cksum is needed.

3. Switch Reader into normal mode:
$ ebook.py um normal

Be patient...

So, now you just need to collect all files needed. It is eBook.py, opt.fs, cksum.exe. For eBook.py, you need to have python installed and set enableWriting = 1 in it. For cksum.exe, you possibly need libraries from cramfs_tools. You can find all this on this forum or Internet. I will try to collect some links and write them in the next post.

Honza
03-16-2007, 02:08 PM
Can you please post the steps needed to update the fonts?
Can you post the file with the fonts? For me it would be great to have font file I ca be 100% sure it will work.

This is the thread you should read:
http://www.mobileread.com/forums/showthread.php?t=8179&page=1&pp=15

eBook.py (from igorsk):
http://wiki.mobileread.com/wiki/Sony_Reader_hack
Image:Ebook_py_041.zip (http://wiki.mobileread.com/wiki/Image:Ebook_py_041.zip)

cramfs-tools (from igorsk, maybe not needed):
http://www.mobileread.com/forums/showthread.php?t=8179

opt.fs (from porkupan) (http://files.ebook.googlepages.com/opt.fs)

cksum.exe (from porkupan) (http://files.ebook.googlepages.com/cksum.exe)

I'm no expert on this, I just copied all of this into Reader folder in Program files and followed the steps in the previous post. I hope it will help you.

igorsk
03-16-2007, 02:11 PM
Please note that this procedure currently does not work with the updated firmware.

each
06-10-2007, 03:56 PM
Is it possible to support Chinese encoding?

JSWolf
06-10-2007, 09:59 PM
Is it possible to support Chinese encoding?
Get a Librie?

HarryT
06-11-2007, 02:47 AM
Is it possible to support Chinese encoding?

I don't believe so. Although the Reader uses Unicode fonts, it can only use the first 256 characters in a font, and hence isn't usable for languages like Chinese which require "proper" Unicode support.

As Jon says, though, the older Librie has full Unicode support. Might be worth seeing if you can get hold of one of those.

igorsk
06-11-2007, 03:57 AM
The Reader doesn't "only use the first 256 characters in a font". The problem is rather that the bundled fonts have only enough symbols for Western texts. It is possible to install Chinese fonts on Reader and some people have done just that (http://www.mobileread.com/forums/showpost.php?p=72014&postcount=78).

HarryT
06-11-2007, 04:12 AM
I stand corrected! Thanks.

NatCh
06-11-2007, 08:24 AM
I also thought the limit was in the OS, I'm always glad to be wrong about things like that. :nice:

each
06-13-2007, 05:24 PM
I already got a final solution for East Asian fonts in Sony Reader.

Put those fonts in Reader's \Data folder (jffs2), where Reader save books, musics and pics. The /Data folder is about 90MB, so there isn't any 7MB \opt restrict, you can put any large fonts file here.

Then change igorsk's original make_opt.sh in the universal flasher, link the opt\sony\ebook\FONT folder with \DATA, and flash the Reader using igorsk's wonderful tool.

Fallen angel
10-29-2007, 03:09 PM
That's a really great piece of software. There's a problem coming up though ... I'm trying to convert some greek files and it does great, except for the accented letters. Of course that's not a rtf converter bug, but a general Sony Reader thing. That happens even with unicode lrf files and book titles, as well. Is there some way to correct that?

JSWolf
10-29-2007, 10:05 PM
You can use rtf2lrf (part of libprs500) and embed a font that will work for what you want.

Fallen angel
10-30-2007, 03:42 AM
libprs500 gives the same result ...

HarryT
10-30-2007, 03:58 AM
BD allows you to embed fonts in LRF files. It slows down page turns, but works very well. See, for example, the Ancient Greek version of Homer's "Odyssey" that I posted.

squiggle8
11-19-2007, 10:44 AM
Guys, anyone out there using a sony reader 500 with a mac and foreing languages (characters, fonts)? I need some coaching here... :-)

JSWolf
11-29-2007, 09:24 AM
With a MAC, you could install libprs500. It also allows you to embed fonts when you do the conversion.

Honza
02-23-2008, 05:13 AM
I received a RTF file with Russian text that couldn't be handled by my converter. It was not so difficult to update it, so there is a new version or this simple software. It's attached at the original post or can be found at my webpage http://www.roomarranger.com/reader/

Changes:

Supports more input RTF file formats
Progress is shown during the conversion


More suggestions for improvements will be welcomed.

JSWolf
02-23-2008, 07:27 AM
I see on your site you have a link to ABC Amber Palm Converter. Well be very careful using any of the ABC converters to convert to RTF. I did that when my wife first got her 500 and the RTF that one of the ABC converters generated was so bad that it locked up the 500 so it needed a proper reset. The only way to fix the RTF was to load it into Word and resave it. It was just dreadful RTF that just managed to be RTF.

Honza
02-23-2008, 07:50 AM
I see on your site you have a link to ABC Amber Palm Converter. Well be very careful using any of the ABC converters to convert to RTF. I did that when my wife first got her 500 and the RTF that one of the ABC converters generated was so bad that it locked up the 500 so it needed a proper reset. The only way to fix the RTF was to load it into Word and resave it. It was just dreadful RTF that just managed to be RTF.

I use ABC Amber Palm Converter regularly (about 50 books so far) and I did not have any problems reading it on my PRS-500. Maybe it depends on the original source file...

JSWolf
02-23-2008, 08:51 AM
The ABC Amber LIT converter is based on old source code for ConvertLIT that has bugs so that's out.