View Single Post
Old 06-28-2015, 09:17 AM   #9
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 74,013
Karma: 315160596
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by Jellby View Post
I don't know how it is for Kindle, but in ePubs pixels are absolute units, just like millimeters or inches, and they are not equivalent to the device's pixels. In particular, they should not change with the device resolution. I think the definition is exactly 1 in = 96 px.

That, at least is what the spec says.
Could you point me to the part of the spec that says that. I've found in ePub 2.0.1:

Quote:
3.2.3: Length
All non-zero coordinate and size values must have specified units. All units defined by CSS1 and CSS2 are supported:
px Pixels
the CSS2 specification has this to say about pixels:

Quote:
4.3.2 Lengths

Lengths refer to horizontal or vertical measurements.

[snip]

There are two types of length units: relative and absolute. Relative length units specify a length relative to another length property. Style sheets that use relative units will more easily scale from one medium to another (e.g., from a computer display to a laser printer).

Relative units are:

em: the 'font-size' of the relevant font
ex: the 'x-height' of the relevant font
px: pixels, relative to the viewing device
Note that pixels are explicitly defined as a relative unit, based on the viewing device.

It may be that some popular ePub renderers choose to interpret pixels as 1/96 inch, but I couldn't find that in the spec. I'd be happy to be wrong.
pdurrant is offline   Reply With Quote