Thread: Troubleshooting Embedding font breaks font-family?
View Single Post
Old 06-13-2020, 07:30 AM   #1
Calan
Junior Member
Calan began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2020
Device: Kindle Paperwhite and iPad Pro
Embedding font breaks font-family?

Hi there,

I have a pdf book I bought and converted to azw3 via Amazon and calibre. I'm spending some time using calibre to clean up the formatting before I start reading it, but I'm running into a strange problem when trying to embed a custom font - embedding a font seems to break font-family from working.

I've successfully tested the following for using a different font for sub-chapters:

Code:
h1.part-title {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  margin-top: 2em;
  margin-bottom: 1.5em;
  text-align: center;
  text-indent: 0;
}
For the chapter headings I'd like to embed a non-standard font, but when I do, it doesn't work, and the above sub-chapter formatting stops, too, and they all revert to the standard font the Kindle is using for the book.

I don't even need to add @font-family or apply it to the h1.chapter-title part of the css - simply adding the font to the ebook and add it to kindle, the subchapters go back to the normal font. (I had initially added the font, added the @font-family to the css, and specified it in the h1.chapter section of the css, but had that problem; the part-title wouldn't format correctly until I completely removed the ttf).

I should note that it all displays perfectly in the calibre editor when I add the font and code.

I'm using a ttf, but have also tried an otf. I thought it might be something with this specific font, so I downloaded an open source font from google fonts, and the same thing happens when adding it to the ebook.

Am I missing something simple here?

Using a Kindle Paperwhite on firmware 5.12.4.

Thanks!
Calan is offline   Reply With Quote