Quote:
Originally Posted by JSWolf
Is this eBook for you or one that you plan to sell? Because if it is one you plan to sell, your var won't work in a lot of cases.
|
Indeed, maybe it's used, but I've never seen
var(--font-family-common); in an ebook, ever.
Ebooks use HTML and CSS, but the specs don't support everything a browser supports. The actual eink ereaders also support less of the specs than Apps do, and they vary in support too.
Quote:
In CSS there are five generic font families:
- Serif fonts have a small stroke at the edges of each letter. They create a sense of formality and elegance.
- Sans-serif fonts have clean lines (no small strokes attached). They create a modern and minimalistic look.
- Monospace fonts - here all the letters have the same fixed width. They create a mechanical look.
- Cursive fonts imitate human handwriting.
- Fantasy fonts are decorative/playful fonts.
|
These are the fall backs for when the app or ereader the user/reader has can't support the chosen font.
This applies to epub (all versions), azw3(KF8) and KFX. It doesn't apply to old mobi as that doesn't have CSS.
Other old formats such as LRF and especially older formats for Palm and CE also are very limited. Mobi can just about do a generic Sans, Serif and Monospace, each in normal, italic, bold and bold italic.
I think LRF may not do true italic, but use Oblque. An Oblique rendering is simply the font angled. True italic is the same family, but an actual separate font and some letters may use a different shape. Similarly some ancient systems simply repeat the normal font offset to make it bold. Real bold is a separate font. Cursive is not italic, though some cursive fonts originated as Italic.
Some fonts representing older writings may have Serif, Cursive or Fantasy as the fall back depending on their style.
Some fonts should NEVER have "bold" applied, so if they are in an <h tag you need CSS to set it to normal as usually any <h tag with no css is rendered bold.
See
https://www.w3schools.com/Css/css_font.asp
It's a real error not to have one of the 5 fallback font families specified.
Printed books are high resolution, so except for children and some text books they will be Serif.
Stuff for web page, computer screens, TV screens etc is traditionally low resolution, so use Sans.
An ebook screen (eink or phone/tablet app) is typically 2 to 4 times the resolution of traditional laptops and monitors and can be about 1/2 the resolution of paper. So Serif is common, but not all fonts that work on paper will be suitable.