View Full Version : LRF with aligned HTML tags


Dahak
07-18-2009, 11:50 PM
I'm still experimenting with the right combination of styling to get my LRF conversions looking the way I want them to come out for my new 505.

I've been using Calibre and its CSS override to try to force the tags to render my way with some odd results.

Here's the CSS override I use:

@font-face {font-family: "Trebuchet";font-weight: normal;font-style: normal;src: url(res:///Data/fonts/trebuc.ttf);}
@font-face {font-family: "Trebuchet";font-weight: bold;font-style: normal;src: url(res:///Data/fonts/trebucbd.ttf);}
@font-face {font-family: "Trebuchet";font-weight: bold;font-style: italic;src: url(res:///Data/fonts/trebucbi.ttf);}
@font-face {font-family: "Trebuchet";font-weight: normal;font-style: italic;src: url(res:///Data/fonts/trebucit.ttf);}

body, p, div, h1, h2, h3, h4, a, center, blockquote {
font-family: "Trebuchet", sans-serif;
font-weight: normal;
font-style: normal;
font-size: 10px;
line-height: 0.9em;
margin-top: 1px;
margin-bottom: 1px;
margin-right: 2px;
margin-left: 2px;
}

b, strong {
font-family: "Trebuchet", sans-serif;
font-weight: bold;
font-style: normal;
font-size: 10px;
line-height: 0.9em;
margin-top: 1px;
margin-bottom: 1px;
margin-right: 2px;
margin-left: 2px;
}

i, em {
font-family: "Trebuchet", sans-serif;
font-weight: normal;
font-style: italic;
font-size: 10px;
line-height: 0.9em;
margin-top: 1px;
margin-bottom: 1px;
margin-right: 2px;
margin-left: 2px;
}


This is all a 'work-in-progress' so I hope you can forgive the font-face tags I included from my ePub experiments.

The most odd thing I've encountered is that whenever I have a header tag with the align attribute set, I get weird results.

For example, the tags:

<h2 align=center>
Chapter 1<br>
Going Up<br><br>
</h2>

would render something like (hoping I set this right):

Chapter 1
Going Up

Centered, with almost default-sized initials and tiny, tiny word-bodies.

Has anyone seen this before?

Am I imagining it?

Is there a work-around?

Is there a work-around that doesn't involve my re-writing the source files?

Thanks.

-Joe

Achilles
08-10-2009, 09:06 PM
As near as I can tell, the anything to LRF conversion in the 0.6.x versions of Calibre is VERY, VERY broken. I can't get it to recognize simple center tags most of the time and it makes a huge mess out of any html I throw at it. I've wound up downgrading Calibre back to 0.5.14 to do my LRF conversion. Hopefully the new LRF routines in the 0.6.x version will get some love, cuz right now they're really busted.

corroonb
08-12-2009, 11:27 AM
As near as I can tell, the anything to LRF conversion in the 0.6.x versions of Calibre is VERY, VERY broken. I can't get it to recognize simple center tags most of the time and it makes a huge mess out of any html I throw at it. I've wound up downgrading Calibre back to 0.5.14 to do my LRF conversion. Hopefully the new LRF routines in the 0.6.x version will get some love, cuz right now they're really busted.

Have you tried using Book Designer? There are links for it in the stickies in the workshop section. It produces LRF files that you can format directly in the program with a word processor-like interface.

Amalthia
08-12-2009, 02:22 PM
Is there a work-around?

Is there a work-around that doesn't involve my re-writing the source files?

Thanks.

-Joe


This is the CSS override code I'm using for my LRF conversions...

p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt; text-indent: 15pt;}
h1 { text-align: center; }
h2 {text-align: center; font-size: larger; page-break-before: always;}
h3 { text-align: center; }
h4 { text-align: center; }
h5 { text-align: center; }
h6 { text-align: center; }
img {text-align: center; }

I normally don't define the font and it comes out as Times New Roman as default.

Amalthia
08-12-2009, 02:22 PM
As near as I can tell, the anything to LRF conversion in the 0.6.x versions of Calibre is VERY, VERY broken. I can't get it to recognize simple center tags most of the time and it makes a huge mess out of any html I throw at it. I've wound up downgrading Calibre back to 0.5.14 to do my LRF conversion. Hopefully the new LRF routines in the 0.6.x version will get some love, cuz right now they're really busted.

I think with the LRF conversions you have to pretend it's a epub file you're creating and use epub settings. but then again I'm not making complicated ebooks either.