View Single Post
Old 06-26-2024, 07:00 PM   #1
Kreeblah
Junior Member
Kreeblah began at the beginning.
 
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:
Could not find a font in the "NewsGoth BdXCn BT" family exactly matching the CSS font specification, will embed a fallback font instead. CSS font specification:
  • font-weight: 700
  • font-style: normal
  • font-stretch: normal
Matched font specification: /Users/myuser/.fonts/News Gothic Bold Extra Condensed BT.ttf
  • font-weight: bold
  • font-style: normal
  • font-stretch: condensed
Meanwhile, I have nothing in the stylesheet specifying a numeric weight for the font (only "bold"), and each reference to this font has font-stretch listed as "condensed", so I don't know where "normal" is coming from. There's only one stylesheet in the book and I've done a bunch of grepping through the book's files to see if I'm missing anything anywhere else, but I'm coming up with nothing. Additionally, running Calibre in debug mode just prints the same information to the console.

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.
Kreeblah is offline   Reply With Quote