Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 01-22-2024, 03:01 AM   #1
iouzzr
Junior Member
iouzzr began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2024
Location: Beijing, China
Device: none
Exclamation The same font size appears differently in the viewer and editor's preview.

1. I set font size to 20px in the viewer:
Click image for larger version

Name:	屏幕截图 2024-01-22 155558.png
Views:	92
Size:	134.0 KB
ID:	205965

2. I set font size to 20px in the editor's preview (default font size):
Click image for larger version

Name:	屏幕截图 2024-01-22 155437.png
Views:	65
Size:	49.7 KB
ID:	205966

3. They are clearly different from each other:
Click image for larger version

Name:	屏幕截图 2024-01-22 155540.png
Views:	66
Size:	276.7 KB
ID:	205967

Last edited by pdurrant; 01-22-2024 at 08:16 AM.
iouzzr is offline   Reply With Quote
Old 01-22-2024, 03:36 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,151
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
preview settings only apply if the book defines no styles of its own.
kovidgoyal is online now   Reply With Quote
Advert
Old 01-22-2024, 08:37 PM   #3
iouzzr
Junior Member
iouzzr began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2024
Location: Beijing, China
Device: none
Quote:
Originally Posted by kovidgoyal View Post
preview settings only apply if the book defines no styles of its own.
But by changing the preview font size settings, the actual font size surely becomes larger or smaller. I don't know CSS, but at least with same font size settings, they should have same font size.
iouzzr is offline   Reply With Quote
Old 01-22-2024, 09:21 PM   #4
iouzzr
Junior Member
iouzzr began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2024
Location: Beijing, China
Device: none
I make a comparison using Calibre viewer, editor's preview and Sigil's preview. The font size is set to 20. The actual font size for Calibre editor's preview and Sigil is the same. Calibre viewer's actual font size is smaller compared to these two.
iouzzr is offline   Reply With Quote
Old 01-22-2024, 09:31 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 37,939
Karma: 150333332
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by iouzzr View Post
But by changing the preview font size settings, the actual font size surely becomes larger or smaller. I don't know CSS, but at least with same font size settings, they should have same font size.
Have you looked at the CSS of the ebook to see how the font-size is arrived at? Also note preview in the editor only uses that font size when the ebook CSS/inline styles do not define a font size.
DNSB is offline   Reply With Quote
Advert
Old 01-22-2024, 09:37 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,151
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The viewer imposes the users font size preferences, scaling all fonts according to those preferences. The preview does not. You will not in general get the same font size between the two.
kovidgoyal is online now   Reply With Quote
Old 01-22-2024, 10:58 PM   #7
iouzzr
Junior Member
iouzzr began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2024
Location: Beijing, China
Device: none
Quote:
Originally Posted by DNSB View Post
Have you looked at the CSS of the ebook to see how the font-size is arrived at? Also note preview in the editor only uses that font size when the ebook CSS/inline styles do not define a font size.
I extract the .epub and open the chapter using my browser. I inspect the yellow highlighting part:

So I think this part of CSS is controlling the font-size:
code {
font-family: Courier, Courier New, monospace;
font-size: small;
}

So if I set "default font size" to 20 in the Calibre editor preview's settings, the font size of the "code" part will be smaller than 20?

---------

"Also note preview in the editor only uses that font size when the ebook CSS/inline styles do not define a font size."

I don't quite understand. Does the above "code" CSS qualified as "ebook CSS/inline styles define a font size"?

P.S. I uploaded the CSS and HTML to ch06.zip.
Attached Thumbnails
Click image for larger version

Name:	屏幕截图 2024-01-23 114413.png
Views:	45
Size:	333.3 KB
ID:	205981  
Attached Files
File Type: zip ch06.zip (50.3 KB, 100 views)

Last edited by theducks; 01-23-2024 at 01:47 PM. Reason: inline large image removed
iouzzr is offline   Reply With Quote
Old 01-22-2024, 11:03 PM   #8
iouzzr
Junior Member
iouzzr began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2024
Location: Beijing, China
Device: none
Quote:
Originally Posted by kovidgoyal View Post
The viewer imposes the users font size preferences, scaling all fonts according to those preferences. The preview does not. You will not in general get the same font size between the two.
When you say "the users font size preferences", are you referring to the settings below?
Moderator Notice
Please read the MR Guidelines about inline image sizes .Use attachments for larger sizes


I am confused, why this font size setting uses absolute unit "px", while you are saying that "scaling all fonts" which implies that this is a relative unit?
Attached Thumbnails
Click image for larger version

Name:	屏幕截图 2024-01-22 155558.png
Views:	54
Size:	134.0 KB
ID:	205983  

Last edited by theducks; 01-23-2024 at 01:49 PM. Reason: remove oversize inline images
iouzzr is offline   Reply With Quote
Old 01-22-2024, 11:05 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,151
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because there can be more than one font size ina document. That setting sets the base font size, all other font sizes are scaled relatively to it.
kovidgoyal is online now   Reply With Quote
Old 01-23-2024, 08:28 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 75,106
Karma: 131686272
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Put the mouse pointer over the preview. Use control-mouse wheel to change the size.
JSWolf is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Font size rendering in Calibre Viewer vs. Editor maraskan_user Viewer 2 12-23-2020 03:02 PM
font size problem calibre viewer, editor, content-server with non-resizing SVG text rjwse@aol.com Editor 11 03-26-2020 12:06 AM
Preview pane font size Sigil benkuttner Sigil 3 12-11-2017 01:19 PM
Font size in Book View / Preview Pane Notjohn Sigil 4 10-12-2015 10:17 AM
Calibre E-Book Viewer and ADE render ePub TD font-size differently Agama Devices 5 06-17-2011 02:44 AM


All times are GMT -4. The time now is 05:05 AM.


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