View Single Post
Old 01-09-2007, 11:52 AM   #3
obelix
Connoisseur
obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.
 
Posts: 65
Karma: 1695
Join Date: Oct 2006
Quote:
Originally Posted by igorsk
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.
Great (as usual)!
It works! I tried lrf files with embeded fonts taken from yahoo group and did see different fonts in Librie for Windows, but Reader did not recognize them and used default fonts instead. Now we know that embeded fonts really work for Reader also. Incredible! I'll include this to my lrs_to_lrf parser. Do you know correct lrs records to pass it to the parsers (to follow lrs standrads)?
obelix is offline   Reply With Quote