View Full Version : font sizes ?


rbeset
07-19-2010, 03:02 AM
Hi,
I've been searching through this forum and did not find an answer to my question on fonts.
I have en BeBook Mini and BeBook One. Both have the same problems with epub's.

i have the option to set font size. (from 1 tot 8 , S to XXXL) This works well on some books, on other books i get a problem when switching from M to L step 3 to 4) Then the font is increased with 2 or 3 steps.
It looks like some epub's just don't have a font what is able to display on all steps correctly and the reader just skips this font size.

It looks like it is mainly on books having:

\styles\stylesheet01.css
\styles\stylesheet02.css

Books having just a stylesheet.css on the main folder mostly scale all steps correctly.


Does any of you ever saw this before ?

thanks in advanced

charleski
07-19-2010, 07:50 AM
ePubs use opentype fonts that will scale to any arbitrary size.
The majority of ePubs don't have an embedded font and so use the default font provided by the reader.
As long as the ePub is well-formed, the actual name of the css file has absolutely no impact on the rendering of the book.

In summary - this looks like a bug in the BeBook firmware, but it's impossible to say for certain without a lot more information. It's certainly not a bug with the ePub files.

rbeset
07-19-2010, 08:34 AM
In summary - this looks like a bug in the BeBook firmware, but it's impossible to say for certain without a lot more information. It's certainly not a bug with the ePub files.

Hm, if it is not a bug in the epubs, but some do scale correctly, how can i found out what is causing the scaling problem ? I mean, the firmware is the same, only the epub is different. So it has to be something in the epub what is causing the firmware to behave like this.... i think.

Jellby
07-19-2010, 09:34 AM
Do you have some sample ePUBs you can show? One that scales correctly, one that doesn't?

rbeset
07-19-2010, 05:12 PM
Do you have some sample ePUBs you can show? One that scales correctly, one that doesn't?

Yes i do. I fixed up 2 sample files.
One with good scaling.
One with bad scaling.

The bad scaling one is copyrighted, so i took only the first 2 pages of the epub.

What happens is when pressing the magnify key it stays the same size, and after 2 presses (m to l) it switches to large, there is no upscaling by each keypress. And so on to even larger fonts. There is no nice linear upscaling.

While the good one scales nicely with each keypress a little bit bigger.


Hope this samples help !

Jellby
07-20-2010, 07:35 AM
The "bad" file's CSS is a complete mess. It has hundreds of @font-face (mostly unused) and styles with unsupported properties, not to mention unnecesary <span>s, etc. There are also font names written with &quot; instead of a quote mark, which I suspect is wrong. However, the main thing that could affect font sizes, is the fact that font sizes are hard-coded in the CSS.

I've cropped the styles and created the attached file, it has two "chapters". The first one is just as it was, so I guess it will scale incorrectly. For the second, I've modified the styles, removing all font references and explicit font sizes, my bet is it will scale correctly. Of course, coming from Word the HTML-like code is utter crap (not your fault, though, but you'd be better copying the unformatted text in Sigil and formatting it there).

charleski
07-20-2010, 09:40 AM
It looks like they took unfiltered html output from MS Word and just pasted it into Sigil and saved. A textbook case of how not to create an epub. Fixing this would require a lot of work.

Jellby's absolutely right, hard-coding the font size using points (font-size: 9.5pt; etc) will prevent it from scaling, but it's strange that the BeBook does scale the text, only it misses a few steps.

rbeset
07-20-2010, 11:43 AM
Jellby, thanx a million.
You are right about the fontsizes. Your 2de chapter scales wonderfull.
The first chapter had the old scaling problem.
I am going to try and fix the original book with your created css as a guidance.

JSWolf
07-20-2010, 12:21 PM
Is there any program available to take Word HTML and remove all the garbage?

shall1028
07-20-2010, 12:36 PM
Does Word not have a save filitered HTML option under "save as"? This would, at least, be a start.

Dellaster
07-20-2010, 06:27 PM
Is there any program available to take Word HTML and remove all the garbage?

HTML Tidy is one way. I use the implementation of Tidy in BBEdit on filtered ("visible only" in Mac Word 2008) Word HTML export. Markup->Tidy->Clean Document, ignore warnings and proceed immediately to Markup->Tidy->Convert to XHTML. This goes a long way towards cleaning up Word HTML.

Ted

JSWolf
07-20-2010, 06:36 PM
Does Word not have a save filtered HTML option under "save as"? This would, at least, be a start.

Yes, it is a start. Just one that still should be better.

JSWolf
07-20-2010, 06:36 PM
HTML Tidy is one way. I use the implementation of Tidy in BBEdit on filtered ("visible only" in Mac Word 2008) Word HTML export. Markup->Tidy->Clean Document, ignore warnings and proceed immediately to Markup->Tidy->Convert to XHTML. This goes a long way towards cleaning up Word HTML.

Ted

I'll have to give Tidy a try and see how it works cleaning up the mess that is Word.

charleski
07-20-2010, 06:42 PM
Dreamweaver has a command to specifically clean-up Word html.

Jellby
07-21-2010, 06:59 AM
But I don't think there's anything capable of cleaning up useless <span>s, or the proliferation of almost identical classes (one with 9pt indent, one with 10pt indent, etc.)

charleski
07-21-2010, 07:01 AM
One thing that's interesting about all this is that it shows the BeBook must be doing part of its scaling by redefining the size of a point. On ADE the 'bad scaling' example using font-sizes specified in points doesn't scale at all, whereas it looks like when switching from M to larger sizes the BeBook changes the number of pixels making up a point. So not a bug as such, just slightly strange behaviour.

Jellby
07-21-2010, 08:06 AM
it looks like when switching from M to larger sizes the BeBook changes the number of pixels making up a point. So not a bug as such, just slightly strange behaviour.

If that's the case, it is a bug. A point is a point is a point, no matter the number of pixels, it is supposed to be an absolute unit, equal to 1/72 of an inch. Changing the definition of absolute units can only be valid as a shortcut for zooming/magnifying, but not for changing font size.

What happens with margins or image sizes defined in terms of points (or inches or millimetres)?

Dellaster
07-21-2010, 11:45 AM
But I don't think there's anything capable of cleaning up useless <span>s, or the proliferation of almost identical classes (one with 9pt indent, one with 10pt indent, etc.)

Not if you want to preserve that information, no. The method I described homogenizes the markup and such variations are lost. Most paragraphs are nothing but <p>text</p>. The retained variations include centering, bolds, italics, and headers. A centered paragraph with two font sizes changes like so:

From this -
<p class=MsoNormal align=center style='text-align:center;text-autospace:none'><span
style='font-size:9.0pt;mso-bidi-font-size:18.0pt;mso-bidi-font-family:Georgia'>All
rights reserved including the right of </span><span style='mso-bidi-font-size:
18.0pt;mso-bidi-font-family:Georgia'>reproduction in whole</span><span
style='font-size:9.0pt;mso-bidi-font-size:18.0pt;mso-bidi-font-family:Georgia'>
or in part in any form.</span></p>

To this -
<p class="c1">All rights reserved including the right of reproduction in whole or in part in any form.</p>

With the CSS being merely -
p.c1 {text-align: center}


Which works fine for me with works of fiction but perhaps not for someone who wants to keep that formatting information.

Ted

shall1028
07-22-2010, 04:23 AM
A point is a point is a point, no matter the number of pixels, it is supposed to be an absolute unit, equal to 1/72 of an inch.

If it is a Postscript point maybe but sometimes a point is not always a point: http://en.wikipedia.org/wiki/Point_(typography)

Of course a millimeter has not always been a millimeter either.

GeoffC
07-22-2010, 06:11 AM
sometimes a millimeter is a millimetre ......

Jellby
07-22-2010, 07:08 AM
If it is a Postscript point maybe but sometimes a point is not always a point: http://en.wikipedia.org/wiki/Point_(typography)

But in the context of ePUB, a point is a CSS point, and the CSS specification (http://www.w3.org/TR/CSS2/syndata.html#length-units) defines a point as:

pt: points — the points used by CSS 2.1 are equal to 1/72nd of an inch.

shall1028
07-22-2010, 04:49 PM
sometimes a millimeter is a millimetre ......

it is also milímetro, milimetër, milimetar, milimetras and my favo(u)rite milliméadar