Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-31-2007, 12:43 AM   #1
Falstaff
Member
Falstaff has a complete set of Star Wars action figures.Falstaff has a complete set of Star Wars action figures.Falstaff has a complete set of Star Wars action figures.
 
Posts: 21
Karma: 289
Join Date: Dec 2006
Device: Sony eReader
Span tags in LRS and LRF files -- do I understand them?

From looking at lrf dumps and lrs2lrf, here are some conclusions about the Span tag, which is used to embed text style changes in the text of an LRF file. Please agree or disagree if you know about this stuff.

The example:
<Span fontsize="60">hi</Span> there

When compiled by lrs2lrf, this adds the fontsize attribute to the text stream, but also adds the "undo" of the attribute automatically. So "hi" would be followed by a fontsize=100, assuming that was the old value. lrf2lrs reveals this extra attribute, by decompiling the above to:

<Span fontsize="60">hi</Span><Span fontsize="100">there</Span>

I am assuming that the old value comes from the settings in the textstyle (or book style, I guess.)

It looks like lrf2lrs has some code to try to not print the undo attributes, but the section is commented out.

Does this description seem correct?
Falstaff is offline   Reply With Quote
Old 01-31-2007, 05:55 AM   #2
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Yes, lrf2lrs outputs the "real" content of the text stream. I added some code to group the attribute changes together, but it doesn't work very well in some cases. Also, in LRS you can change attributes from within the <P> tag: <P fontsize="60">text</P>, however, this is still translated into the same sequence of tags, and lrf2lrs is not very sofisticated to figure it out.
igorsk is offline   Reply With Quote
Old 01-31-2007, 10:34 AM   #3
Falstaff
Member
Falstaff has a complete set of Star Wars action figures.Falstaff has a complete set of Star Wars action figures.Falstaff has a complete set of Star Wars action figures.
 
Posts: 21
Karma: 289
Join Date: Dec 2006
Device: Sony eReader
Thank you for the reply, and also for the lrf2lrs program itself. I can see that trying to decide if an attribute is an "undo" or a new setting could be a difficult problem. I'm glad you put out the real stream, otherwise I would not have known those extra attributes were required.
Falstaff is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Span tags, h1s and emspaces ConorHughes ePub 11 09-30-2010 05:00 PM
Pissed off with LRF formatting: LRF/LRS clean tool? grimborg LRF 8 02-15-2010 01:14 PM
Converting LRS to LRF mcortez Sony Reader 1 11-28-2007 11:26 AM
PRS-500 Create LRS and LRF files from Python with pylrs Falstaff Sony Reader Dev Corner 37 08-04-2007 07:49 PM
LRS to LRF on Mac OSX - any suggestions? Lime2K Sony Reader 3 07-29-2007 10:15 PM


All times are GMT -4. The time now is 11:14 PM.


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