![]() |
#1 |
Ungluer-in-Chief
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 25
Karma: 361288
Join Date: Dec 2013
Location: Montclair, New Jersey
Device: all (Marvin)
|
any reason to avoid px measurements in epub?
I'm working on some legacy html -> epub conversion software for Project Gutenberg.
It removes css rules that use px measurements. I have no idea why. Are there obscure or legacy epub readers that don't support px in css? Eric |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 316
Karma: 3196766
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
It's because px are a fixed unit and don't account for e.g. reader-side font resizing or the wide variety of resolutions on different devices. Pretty much the same reason px have fallen out of favor in web design.
Last edited by phillipgessert; 01-08-2020 at 05:53 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Use em instead of px. For example, text-indent: 1.2em; |
|
![]() |
![]() |
![]() |
#4 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
The only time I use px measurements are when I'm trying to limit the maximum size of an object. For example, an older book might have small images. I want the image to fill the screen as much as possible without getting over-stretched and blurry. In that case I would set the image width to be 85% of the screen, with a maximum width of the original image width.
Code:
ExampleImage.jpg = 500 x 800 pixels (w x h) div {margin:2em auto; width:85%} img {width:100%, max-width:500px} <div><img alt="" src="../Images/ExampleImage.jpg" /></div> |
![]() |
![]() |
![]() |
#5 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Hopefully that conversion software also removes or converts other fixed units like inches, cm, etc. for the reason phillipgessert gave.
When you say "working on" are you using the software to do conversions or are you updating/translating it? I've always been curious about what the workflow is that PG uses for making their ebooks. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
https://www.pgdp.net/c/ You can read about the process there. Also, their forums are a trove of book digitizing information too: https://www.pgdp.net/phpBB3/ |
|
![]() |
![]() |
![]() |
#7 |
Ungluer-in-Chief
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 25
Karma: 361288
Join Date: Dec 2013
Location: Montclair, New Jersey
Device: all (Marvin)
|
My understanding is that as of css3, 1 px == 0.75 pt. So the same would apply to using pt? what about table border widths? should they be fixed or should they scale along with font resizing?
|
![]() |
![]() |
![]() |
#8 | |
Ungluer-in-Chief
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 25
Karma: 361288
Join Date: Dec 2013
Location: Montclair, New Jersey
Device: all (Marvin)
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Generally borders should stay as px. It would be out of the ordinary to you find some situation that requires border thickness to change.
|
![]() |
![]() |
![]() |
#10 |
Ungluer-in-Chief
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 25
Karma: 361288
Join Date: Dec 2013
Location: Montclair, New Jersey
Device: all (Marvin)
|
|
![]() |
![]() |
![]() |
#11 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But, there is going to be a difference in border thickness when using a Reader witha n 800x600 screen vs a current 300DPI screen when using px. SO is px good to use in that case where you do not know what sort of Reader it may be read with?
|
![]() |
![]() |
![]() |
#12 | ||
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Per W3Schools: Quote:
Last edited by Turtle91; 01-09-2020 at 03:55 PM. |
||
![]() |
![]() |
![]() |
#13 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Let's turn the question around; how would you do it using ems or percentages or whatever? I'm not averse to using ems or whatever for horizontal rules and black borders on tables and whatnot but I've never tried it and it seems like it would be tricky.
|
![]() |
![]() |
![]() |
#15 | |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Avoid epub split in several html files? | mastroalex | Calibre | 18 | 12-03-2011 03:50 PM |
Empty lines in epub without apparent reason | sinusLog | Conversion | 6 | 09-30-2011 01:19 AM |
Screen measurements? | cBird | enTourage Archive | 3 | 04-18-2011 09:57 PM |
measurements Please | artemisblossom | Sony Reader | 3 | 05-18-2009 11:55 PM |
I need measurements | Kirari | Sony Reader | 7 | 05-11-2009 09:14 PM |