Mobileread
any reason to avoid px measurements in epub?
#1  gluejar 01-08-2020, 05:02 PM
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
Reply 

#2  phillipgessert 01-08-2020, 06:49 PM
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.
Reply 

#3  JSWolf 01-08-2020, 07:22 PM
Quote gluejar
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
You don't need this legacy software. You can use Sigil or Calibre to turn this HTML into ePub.

Use em instead of px. For example, text-indent: 1.2em;
Reply 

#4  Turtle91 01-08-2020, 07:23 PM
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>
Other than that, I would want to use measurements that keep everything relative to the user selected font/margin sizes - like 'em'.
Reply 

#5  hobnail 01-08-2020, 08:08 PM
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.
Reply 

#6  Tex2002ans 01-09-2020, 05:21 AM
Quote hobnail
I've always been curious about what the workflow is that PG uses for making their ebooks.
Digital Proofreaders creates a lot of the Project Gutenburg books:

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/
Reply 

#7  gluejar 01-09-2020, 12:33 PM
Quote phillipgessert
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.
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?
Reply 

#8  gluejar 01-09-2020, 12:39 PM
Quote Tex2002ans
Digital Proofreaders creates a lot of the Project Gutenburg books:

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/
It's the DP folks who want to keep the px in table border widths. The PG software "ebookmaker" takes DP books and makes epub.
Reply 

#9  Turtle91 01-09-2020, 12:41 PM
Quote gluejar
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?
Generally borders should stay as px. It would be out of the ordinary to you find some situation that requires border thickness to change.
Reply 

#10  gluejar 01-09-2020, 02:37 PM
Quote Turtle91
Generally borders should stay as px. It would be out of the ordinary to you find some situation that requires border thickness to change.
Thanks what I was thinking. Thanks!
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register