![]() |
#1 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jun 2024
Device: Kobo Sage
|
How to determine which CSS lines are specifying a font?
I have a book that was pretty terribly set up by the publisher, and I've had to fix some of the CSS in it. However, I'm having trouble with getting Calibre to recognize the fonts for it. It came with all of the font files it was supposed to, but two of them were referenced incorrectly in the stylesheet and also had invalid properties in the actual font files (they were bold fonts but not actually self-identifying as bold). So, I pulled the fonts out, added them to a directory where Calibre can find them, and attempted to polish the book to embed them.
The problem is, Calibre seems to be insisting that the stylesheet is specifying different properties than one of the fonts has, even though I can't find those properties anywhere in the stylesheet. Specifically, what I'm seeing is this: Quote:
Is there a way to determine what lines Calibre is using to compose the font specification? If not, how can I figure out what I'm missing here? I'm running Calibre 7.12 on macOS 14.5, if it's relevant. |
|
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,204
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
bold is the old way (and older readers want that as well as EPUB2
![]() the numbers are the newer way of specifying font-weight (I have seen a chart. there are more number levels than the old) Each font has an internal table (normal, bold, italic, bold-italic). That is 4 font files to make up the complete FAMILY (not al faces have all 4, so substitutes are sometimes called out and the check will complain that the names do not match the Family |
![]() |
![]() |
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,246
Karma: 5566620
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Did you hack the epub and manually add files to it or did you use the Calibre Editor and select Add/Import new files? You could also install a font program, like Sourceforge and check what is specified in the font file. |
|
![]() |
![]() |
![]() |
#4 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 139
Karma: 1000102
Join Date: Jul 2021
Device: N/A
|
|
![]() |
![]() |
![]() |
#5 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,798
Karma: 27405122
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
#6 | |||
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jun 2024
Device: Kobo Sage
|
Quote:
Quote:
I've been using FontForge to check things with fonts in order to do things like get the font family name (because it was very wrong in the stylesheet originally for this font; it was listed as the font filename rather than the font family name). I've also been able to inspect other relevant properties with it, too (see the attachment for a screenshot). Quote:
If that's not currently an option, though, this should be able to get me the info I need. It'll just take me a while to find where every use of every relevant element is. |
|||
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jun 2024
Device: Kobo Sage
|
Hmmm. Doesn't seem like I can edit posts, so I guess I need to make a new reply?
But, I just used that Live CSS tool and went through every element in the book that uses one of the classes that references the font I'm having issues with, and every computed style came up with a font-weight of 700 and a font-stretch of 75%. I'm absolutely mystified as to where that mismatch is coming from. Is there anything else I can try to track this down? |
![]() |
![]() |
![]() |
#8 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,204
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
font-stretch?
FWIW My Kobo's don't like some valid CSS being used: letter-spacing causes words to run together. eg ChapterTitle IMHO K.I.S.S. (an least for some things) ?? Isn't Live CSS a temporary (that session) operation?? I use the 'Inspector' to try and decode the CSS nesting. Right click on a / the problem paragraph (in the Preview pane): Inspect element |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,246
Karma: 5566620
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Why don't you post the book here. Maybe someone will spot the issue.
If the book is in copyright, remember to scramble it first. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extra CSS @font-face losing font url | Amalthia | Conversion | 5 | 02-10-2024 06:04 PM |
Epub to PDF Issue: text lines cut in half (Chinese font vertical-rl script) | ignosticism | Conversion | 4 | 01-28-2021 11:17 AM |
Managing Blank Lines Following <p> Using CSS | SeaCanary | Sigil | 29 | 02-22-2014 08:41 PM |
Determine font and font size on incoming epub? | peaceridge | Calibre | 4 | 01-30-2012 03:35 PM |
comment out lines in CSS | cybmole | Sigil | 3 | 05-10-2011 05:54 AM |