Yes vw is a unit of 1/100th of the screen width. Chrome's browser engine (i.e. QtWebEngine/Preview) is a big supporter of using vh and vw with svg images over the older % format that Webkit used. Chrome's engine treats % much different from vh and vw units.
% according to css rules, is supposed to be relative to the parent element that contains it. In some cases that is a document height. The vw and vh are always relative to the viewport (screen size).
All browser based engines such as Calibre editor, Thorium, Readium, and etc should support the vh and vw. The old % for svg is just not used much given it is interpreted differently by different engines.
You should be able to detach Preview and make it be the size of a Kobo screen but I have no idea what built-in css for margins and spacing are, fonts used, etc for that e-reading device so it may take some changed css and trial and error.
I can not make Preview act more e-reader like as different e-readers with their different layout engines all react differently.
Trying to mimic one reader is pretty much worthless for epub developers who need their epubs to look good on a wide variety of devices.
Again, that is why testing on a large number of e-reading devices is so critical to find robust compromises.
KevinH
Quote:
Originally Posted by ChrisI
Using vh worked, thank you. Is vw window width?
I have been using Calibre to test view my books, but I will look into the other e-readers.
What I was trying to do with the Sigil preview was to size the window so that a page of text matched what I see on my Kobo.
Would it be possible for preview to treat the window size, whatever it is dragged to, to be the page size? What if, for example, it just interpreted height % as vh instead?
I understand that preview is not an e-reader. But it is nice to get the immediate feedback while editing. The closer it can mimic an e-reader, the more useful it is to me.
|