Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2024, 04:38 AM   #1
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
fake error on embed fonts

calibre editor show some "errors" about embed fonts
show error with font-family: "Charter";
Unexpected missing generic font family (font-family-no-missing-generic-family-keyword). See detailed description suggest
and here the link to which i'm referring https://stylelint.io/user-guide/rule...family-keyword)
but no error with font-family: "Charter", serif;

but on my iPad mini no difference with or without serif;
so fake error for me ... i hope the dev can add an option for future next rel to hide or ignore error like this.
larysa is offline   Reply With Quote
Old 12-08-2024, 05:53 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,572
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
It is not 'Fake'. It is just a warning that if your system does not have the specified font, you will get odd results without a fallback.
I can't remember seeing that with an embedded font and no fallback called out.
theducks is online now   Reply With Quote
Advert
Old 12-08-2024, 09:26 AM   #3
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
yes i know, just a warning
but this warning it's about all class with same font. so lot of class, lot of warning (or error) on check book.
and this for me, is with all various fonts embed on my ebooks

i repeat, i hope Kovid Goyal add an option to ignore this warning/error on future release (from old calibre 3.95 version, used on my old pc with win 7, never see this warning, and all book displayed fine on my ipad)

Last edited by larysa; 12-08-2024 at 09:30 AM.
larysa is offline   Reply With Quote
Old 12-08-2024, 09:58 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,764
Karma: 24967300
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No its a perfectly legitimate warning. You should always specify a fallback family for an embedded font.. That way the user agent can pick a better fallback if for whatever reason it is unable to use the embedded or referenced font.
kovidgoyal is offline   Reply With Quote
Old 12-08-2024, 11:49 AM   #5
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
ye, understand. but i just wish an option to ignore warnings

and another way to avoid errors is var(--font-family-common);

this option can't load family font (like serif) but calibre don't show warning
larysa is offline   Reply With Quote
Advert
Old 12-09-2024, 03:52 AM   #6
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
what i mean is that with the code var(--font-family-common); no replacement font is specified, but calibre does not detect errors. why?
larysa is offline   Reply With Quote
Old 12-09-2024, 09:52 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 77,399
Karma: 139110232
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by larysa View Post
what i mean is that with the code var(--font-family-common); no replacement font is specified, but calibre does not detect errors. why?
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.
JSWolf is offline   Reply With Quote
Old 12-09-2024, 11:13 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,764
Karma: 24967300
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by larysa View Post
what i mean is that with the code var(--font-family-common); no replacement font is specified, but calibre does not detect errors. why?
Because calibre's error checking is not out to catch every possible way you can decide to shoot yourself in the foot, just common mistakes. Feel free to send a patch to the stylelint project to add a rule for that if this bothers you.
kovidgoyal is offline   Reply With Quote
Old 12-09-2024, 01:42 PM   #9
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
bother ? oh no mate, no problem for me

and Jon the ebook it's just for me. i'm private user, no selling. I'm just trying a code to not show error on calibre check book. but maybe i could share my book version, so maybe better to use font-family: "Charter", serif; code
larysa is offline   Reply With Quote
Old 12-09-2024, 02:03 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 77,399
Karma: 139110232
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by larysa View Post
bother ? oh no mate, no problem for me

and Jon the ebook it's just for me. i'm private user, no selling. I'm just trying a code to not show error on calibre check book. but maybe i could share my book version, so maybe better to use font-family: "Charter", serif; code
To be honest, it's not a big deal to edit the font-family line to add the fallback code. What I do in most cases is delete the embedded fonts and if any of the fonts used were sans-serif, I do a font-family: sans-serif; in place of the the font(s). if the fonts are a serif, I just use my custom font. If the font is something like a font for handwriting or one I want to keep, I'll keep them. But most body fonts used are not good enough.
JSWolf is offline   Reply With Quote
Old 12-09-2024, 07:09 PM   #11
Quoth
Reading till the spring
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,700
Karma: 96948653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by JSWolf View Post
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.

Last edited by Quoth; 12-09-2024 at 07:15 PM.
Quoth is offline   Reply With Quote
Old 12-09-2024, 07:21 PM   #12
Quoth
Reading till the spring
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,700
Karma: 96948653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by JSWolf View Post
To be honest, it's not a big deal to edit the font-family line to add the fallback code.



If the font is something like a font for handwriting or one I want to keep, I'll keep them. But most body fonts used are not good enough.
Indeed while an embedded letter, telegram, note or heading might use some fancier font, boring and simple is best for body text.

See any paperback novel.
Quoth is offline   Reply With Quote
Old 12-09-2024, 10:04 PM   #13
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,813
Karma: 87300001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by Quoth View Post
Indeed, maybe it's used, but I've never seen var(--font-family-common); in an ebook, ever.
The use of “var(--font-family-common)” depends on a previous declaration of --font-family-common, setting its value to a valid generic font name. That property name is nothing special. It is just an example given in the Stylelint documentation.
jhowell is offline   Reply With Quote
Old 12-10-2024, 04:56 AM   #14
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
Quote:
Originally Posted by JSWolf View Post
To be honest, it's not a big deal to edit the font-family line to add the fallback code. What I do in most cases is delete the embedded fonts and if any of the fonts used were sans-serif, I do a font-family: sans-serif; in place of the the font(s). if the fonts are a serif, I just use my custom font. If the font is something like a font for handwriting or one I want to keep, I'll keep them. But most body fonts used are not good enough
i agree, and i do the same with my ebooks. but recently on use Charter font, built into my ipad, this beautiful font has a flaw, however, in my reading language: when i have a word like L'ha the L almost overlaps with the h, i almost have no space in the apostrophe.
so i downloaded a generic Charter font from the web, built into my book and now my ipad no longer "sees" the font flaw like the original one, but uses an appropriate distance between the L and the h, as it should be and as ipad does with all the other default built-in fonts

but embed font with calibre, with font-family: "Charter"; only calibre show a warning, this is why i've start this thread
larysa is offline   Reply With Quote
Old 12-10-2024, 05:09 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 77,399
Karma: 139110232
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by larysa View Post
i agree, and i do the same with my ebooks. but recently on use Charter font, built into my ipad, this beautiful font has a flaw, however, in my reading language: when i have a word like L'ha the L almost overlaps with the h, i almost have no space in the apostrophe.
so i downloaded a generic Charter font from the web, built into my book and now my ipad no longer "sees" the font flaw like the original one, but uses an appropriate distance between the L and the h, as it should be and as ipad does with all the other default built-in fonts

but embed font with calibre, with font-family: "Charter"; only calibre show a warning, this is why i've start this thread
While it works, if the program you are using to read the book doe snot like the font, the fallback will be used.
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
To Embed Fonts or Not to Embed Fonts keress ePub 25 03-09-2020 09:46 PM
Can it embed fonts? chalimac Kobo Reader 1 06-27-2017 06:46 PM
Embed fonts in mobi NIRC Kindle Formats 34 02-25-2016 11:59 PM
Is it possible to really embed fonts yet? LaurelRusswurm ePub 25 11-17-2011 11:25 PM
Is it possible to UN embed fonts? lmronan Sigil 14 06-04-2010 10:26 AM


All times are GMT -4. The time now is 04:54 AM.


MobileRead.com is a privately owned, operated and funded community.