View Single Post
Old 01-09-2007, 11:17 AM   #1
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Embedded fonts in LRF WORKING

Well, after several evenings in IDA/OllyDbg I finally got it working. Due to several bugs in the Reader's LRF parser, embedded fonts only work for some specific combinations of parameters.
See the attached file for an example of such LRF. It has embedded Courier New font and a text string in Russian.
I have not yet found a way to generate such files with available converters. This one was generated by makelrf and then edited manually in a hex editor. So here are the technical details for the converter authors:
1. Font stream should added as a Font object (type 0x19). The stream must be either compressed or scrambled (or both), otherwise the parser will fail to load it.
2. Reference to the font object must be added to the root BookAtr object with the tag F5D8. It should be possible to add several fonts in this way, though I haven't tested it.
3. TextAtr object which sets the style for rendering the text, must specify the full TrueType font name (with tag F516), not the name from the Font object.
Attached Files
File Type: zip rus2.zip (175.7 KB, 738 views)
igorsk is offline   Reply With Quote