![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kindle Oasis, iPad Pro
|
How to Modify @font-face on Conversion?
Is there a way to modify the @font-face in CSS files that already exist in a given book so that it is modified during conversion?
For example, I want to convert: @font-face { font-family: Hlv } to @font-face { font-family: Helvetica } during conversion so that it will reference the fonts correctly using the correct name of the font. Using style transformation, transformation doesn't affect font-family under @font-face in a given CSS file, but it will affect the rest of the references to the font-family in the same CSS file. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,950
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Why fight it doing a conversion?
Open the editor and fix it (saved search if repetitive) |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kindle Oasis, iPad Pro
|
Quote:
![]() And because I'd like to set it up to automate for future books. Last edited by JonnieCache; 04-20-2019 at 03:32 PM. |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,256
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can use the Transform styling tool to adjust CSS properties, should work for the "font-family" property in @font-face rules as well, though I have not tested. See the Look & feel section of the conversion dialog.
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kindle Oasis, iPad Pro
|
Quote:
I thought that the transform styling tool should work for that purpose. But when it didn't work, I thought perhaps @font-face rules were deliberately excluded for some (technical?) reason. So, it seems this may just be a bug in the conversion process when Calibre applies the transform rules. Here is a screenshot of some of the transform rules that I've set up: Here are a couple screenshots of the original eBook CSS before conversion: Then after conversion, here are a couple of screenshots. You can see that the @font-face rules were not transformed. I would like to embed the fonts in all of my EPUBs if they aren't included already. Although I realize this increases the size of the books, I would like to view the books as they were intended by the author/publisher. I'm not a font expert, but as I understand it, the problem with the embedding process is due to how different platforms (macOS, Windows, Linux) refer to the fonts and also differences between identification of .TTF and .OTF versions of the same font across the platforms. In the CSS, the font may be listed as "AJensonPro-Lt" (from Windows?), but macOS sees it as "Adobe Jenson Pro Lt". So, when Calibre tries to embed the font, it doesn't see the font from macOS as it is listed in the CSS. I realize that this may be a big undertaking, but font substitution would be a cool feature to add. That way, the user could set up the fonts to substitute, not only for editing, but also for previews and the E-Book Viewer. I wish the OSs would support font substitution natively and allow users to tweak them. Let me know your thoughts.. Thank you in advance! Jonathan Last edited by JonnieCache; 04-21-2019 at 03:21 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,256
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Open a bug report and I will look into extending the transform styling tool to also work with properties in @-rules.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suppressing font-face declarations | roger64 | Editor | 2 | 09-26-2017 05:46 AM |
@font-face is not embedded | iliakan | Conversion | 2 | 01-12-2015 02:29 AM |
Modify font sizes? | sneakyspider | Kindle Developer's Corner | 3 | 05-10-2013 03:52 PM |
Am I using @font-face correctly? | phossler | Sigil | 12 | 11-30-2012 04:38 PM |
Trying to modify conversion parameters | Terisa de morgan | Conversion | 2 | 11-28-2012 12:35 AM |