View Full Version : Common font and/or embedded fonts...


Dahak
06-27-2009, 11:13 PM
(I'm not certain if this should be here or in the Calibre forum, but it applies generically, so...)

I've been playing with Calibre for the last few days with my brand-squeaky new PRS-505.

I would like to override the default fonts in the unit.

While I suppose I could change the default fonts globally on the unit, 1) I'd rather not at this time because 2) all of the hacks I've seen so far relating to that seem to also reflash the unit and my firmware (v 1.1.01.25200) doesn't seem to be among the supported versions.

I have had good luck with applying fonts from a 'fonts' folder while converting to ePub. Which is nice, but since ePub doesn't support fully-justified text and can't suppress those silly page numbers, I'd rather avoid that.

Trying to externally reference a 'fonts'-folder font with the LRF format has met with no success, of yet.

The interesting thing was trying to embed a font using Calibre.

On a personal level, I find embedding a font in every book to be pretty offensive, but if I have to do so, then I suppose I will.

But my luck has been spotty.

Here is a sample of my CSS override string:
body {
font-family: "Comic Sans MS", sans-serif;
font-size: 11pt;
text-align: justify;
font-weight: normal;
font-style: normal;
}

p {
font-family: "Comic Sans MS", sans-serif;
font-size: 11pt;
text-align: justify;
font-weight: normal;
font-style: normal;
}

div {
font-family: "Comic Sans MS", sans-serif;
font-size: 11pt;
text-align: justify;
font-weight: normal;
font-style: normal;
}

blockquote {
font-family: "Comic Sans MS", sans-serif;
font-size: 11pt;
text-align: justify;
font-weight: normal;
font-style: normal;
}

a {
font-family: "Comic Sans MS", sans-serif;
font-size: 11pt;
text-align: justify;
font-weight: normal;
font-style: normal;
}

h1 {
font-family: "Comic Sans MS", sans-serif;
font-size: 13pt;
text-align: center;
font-weight: bold;
font-style: normal;
}

h2 {
font-family: "Comic Sans MS", sans-serif;
font-size: 12pt;
text-align: center;
font-weight: bold;
font-style: normal;
}

This looks a bit odd. Since I wasn't having much luck with applying multiple tags to one style definition, I broke them out individually.

Also, before you scream at the choice of font, I am using Comic Sans purely as a test font, because when it works, I'll know that the type face is there, since it's not your average-looking sans-serif font.

Now, with the above styling, the only tags I've seen actually using the font have been the H1 and H2 tags.

The default body tag doesn't seem to be overriding much, nor do the P, A or DIV tags (DIV tags being predominant in my source files).


Can LRF-formatted books reliably use an external or embedded font reference like ePub seems to support?

Can LRF-formatted books reliably use the CSS override feature of Calibre?

Am I wasting my time even trying this?

Any thoughts would be appreciated.

-JPB

HarryT
06-28-2009, 04:32 AM
Embedding fonts in an LRF book really, really drastically slows down the page rendering - at least if you use the font for the "body" text of the book. It's fine if you only use it for titles, etc, but I'd forget about it for the body text. Page rendering goes from the usual half second to perhaps 3 or 4 seconds, which personally I find unacceptable.

If you want to see an example, here (http://www.mobileread.com/forums/showthread.php?t=12166) is an LRF book I created a couple of years ago with an embedded Greek font. I find the speed way too slow, personally.

Dahak
06-28-2009, 09:19 AM
Embedding fonts in an LRF book really, really drastically slows down the page rendering - at least if you use the font for the "body" text of the book. It's fine if you only use it for titles, etc, but I'd forget about it for the body text. Page rendering goes from the usual half second to perhaps 3 or 4 seconds, which personally I find unacceptable.

If you want to see an example, here (http://www.mobileread.com/forums/showthread.php?t=12166) is an LRF book I created a couple of years ago with an embedded Greek font. I find the speed way too slow, personally.

That is pretty bad.

Not quite as bad I was envisioning, but still a significant delay.

Of course, I was hoping I could get the LRF system to recognize a common font, like the ePubs seem to be able to do.

-JPB

JSWolf
06-28-2009, 09:45 AM
To use CSS to embed fonts, use ePub and go to the ePub section and look at the sticky on how to embed fonts on the 505 & 700.

Dahak
06-28-2009, 11:43 AM
To use CSS to embed fonts, use ePub and go to the ePub section and look at the sticky on how to embed fonts on the 505 & 700.

I already know how to embed fonts in ePub... looks nice, BTW, except that I don't like ragged-right paragraphs.

I've been spending the last hour trying to un-brick my 505 because I discovered a depressing fact about Igorsk's universal flasher: the options don't line up with the menu buttons.

I wanted to back up my firmware... found out my firmware wasn't supported, then went to exit and mistakenly flashed it. :eek:

Just got it back up with the older 1.1.00.18040.

Does Sony provide an updater with the more recent firmware? If so, I haven't found it yet.

-JPB

Pablo
06-28-2009, 12:47 PM
Just got it back up with the older 1.1.00.18040.

Does Sony provide an updater with the more recent firmware? If so, I haven't found it yet.

-JPB

That is the latest firmware for the USA. You can keep it, you are loosing no new features.

You can embed fonts in LRF documents. The easiest way (even I was able to do that) is using Bookdesigner, the gratest ebook creation program in my opinion. As you have seen, embedding fonts slows down page turning.

Another option is creating your ebooks in pdf as explained in a guide by Sony and after that cropping the margins with soPdf. The pdf format allows for embedded fonts.

Dahak
06-28-2009, 01:32 PM
You can embed fonts in LRF documents. The easiest way (even I was able to do that) is using Bookdesigner, the gratest ebook creation program in my opinion. As you have seen, embedding fonts slows down page turning.

I've been experimenting with Calibre and the CSS override and have found some interesting bits.

I don't know if it's a Calibre or Sony issue (my guess: Sony) but early tests seem to not be overriding the font face when the font-weight attribute is normal.

With everything else remaining the same, changing the font-weight to bold also picks up the font-family selection.

I've tried it with bold, but I haven't tried any of the other allowed vales yet.

And, with the embedded font, the initial formatting/indexing seems to take forever.

-JPB