The e-book viewer ignores font-size property when using some absolute lenght units

Bug #1932152 reported by Michele Galimberti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

It seems the calibre viewer ignores the CSS property font-size if the value is expressed in absolute units. I tried "px", "pt" and "cm" and the text remained the same size of a 1em control text. Inches ("in") seem to work correctly. Relative units (I tried "em" and "ex") work as intended. The book was a normal EPUB2 e-book.

An important detail is that the book preview in the e-book Editor works correctly with all units, the problem is limited to the Viewer. Maybe the bug is due to the "new" Viewer from calibre 4.0?

description: updated
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1932152

Works fine for me using calibre version 5.21. Try with that, and
remember to reload the book if you have made any changes to it by right
clicking in the viewer and choosing "Reload book"

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Michele Galimberti (galimberti-michele) wrote :

I'm already on 5.21 and I closed and reopened the epub file after each of my tests, I'll try with other books and get back to you

Revision history for this message
Michele Galimberti (galimberti-michele) wrote :

Ok, I tried with another random book and the "px" unit, and it still doesn't work. I attached a copyright-free book as a sample, in which I created a new class (.sizetest) used only in the 2nd paragraph of the 1st chapter, so that you can compare/test it.

I also checked if I had any strange options enabled in the Viewer, but they seem to be normal.

Revision history for this message
Kovid Goyal (kovid) wrote :

Closing and opening wont do it, you have to use "Reload book"

Revision history for this message
Kovid Goyal (kovid) wrote :

works fine for me.

Revision history for this message
Michele Galimberti (galimberti-michele) wrote :

How strange... I downloaded calibre portable right now to check if it was a problem with my settings but even with it it doesn't work for me. I'll have to think about some other tests, I could make a clean VM and test it on linux.

I'm on Windows 10 x64 latest updates by the way

Revision history for this message
Kovid Goyal (kovid) wrote :

Did you do reload book? That is open the viewer controls and click the
"Reload book" button.

Revision history for this message
Michele Galimberti (galimberti-michele) wrote :

Yeah, I did various times after you told me, but no changes. Tried with Linux, nothing. Tried removing custom calibre translations (you never know), nothing. Works as intended in Sigil, I fear I'm out of ideas

Revision history for this message
Michele Galimberti (galimberti-michele) wrote :

Ok, I used the inspector and for some reason the class used for body wins over the class used for the paragraph (see attachments). The question is why it does so only on my computer...

Two more notes:
- I tried on another PC with calibre portable and it has the wrong size
- If I print to PDF from the viewer the size in the PDF is correct

Revision history for this message
Michele Galimberti (galimberti-michele) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote :

Aaah that explains it. Its using a comma instead of a period as the decimal separator, probably because in your locale that's the decimal separator. I thought I used locale independent string formatting, but possibly I missed something.

Revision history for this message
Michele Galimberti (galimberti-michele) wrote :

Oh, I tried to change the language in calibre to english, but not in Windows, so it might be that. The separator is indeed a comma in italian, if you need any more info let me know!

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1932152

Note that after the next release you will need to use reload book to see
the fix for books you have already opened

Changed in calibre:
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.