06-26-2024, 08:00 PM | #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. |
|
06-26-2024, 09:52 PM | #2 |
Well trained by Cats
Posts: 30,503
Karma: 58055868
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 |
06-26-2024, 10:36 PM | #3 | |
Wizard
Posts: 1,401
Karma: 7000000
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. |
|
06-27-2024, 12:46 AM | #4 |
Zealot
Posts: 149
Karma: 1451628
Join Date: Jul 2021
Device: N/A
|
|
06-27-2024, 01:13 AM | #5 |
null operator (he/him)
Posts: 21,107
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
06-27-2024, 04:47 AM | #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. |
|||
06-27-2024, 11:08 PM | #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? |
06-28-2024, 05:42 AM | #8 |
Well trained by Cats
Posts: 30,503
Karma: 58055868
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 |
06-28-2024, 05:59 AM | #9 |
Wizard
Posts: 1,401
Karma: 7000000
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. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extra CSS @font-face losing font url | Amalthia | Conversion | 5 | 02-10-2024 07:04 PM |
Epub to PDF Issue: text lines cut in half (Chinese font vertical-rl script) | ignosticism | Conversion | 4 | 01-28-2021 12:17 PM |
Managing Blank Lines Following <p> Using CSS | SeaCanary | Sigil | 29 | 02-22-2014 09:41 PM |
Determine font and font size on incoming epub? | peaceridge | Calibre | 4 | 01-30-2012 04:35 PM |
comment out lines in CSS | cybmole | Sigil | 3 | 05-10-2011 06:54 AM |