12-02-2021, 03:24 AM | #1 |
Enthusiast
Posts: 29
Karma: 10738
Join Date: Aug 2018
Device: none
|
Remove Font-Family but keep Serif/serifless
Hi there,
I am trying to solve the following problem: When I convert my epubs I normally remove the propery "font-family" as I want all my books displayed without the publisher's fonts. This is especially helpful when I use Google Books Online Reader, because often book fonts are too small or not to my taste. When removing font-family I can read all my books with Georgia or Verdana font online. But there are some Ebooks which use both serif and serifless fonts, for example serifless for headlines and serif for text body. This information gets lost when I remove font-family. Is there a way in Calibre to remove the font-family, but keep both serif and serifless fonts? Thanks FK |
12-02-2021, 03:28 AM | #2 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the style rules, they allow you to match on property values. Transform styles in the edit book tool or if you aredoing a conversion under the look & feel section ofthe conversion dialog.
|
Advert | |
|
12-02-2021, 03:57 AM | #3 |
Enthusiast
Posts: 29
Karma: 10738
Join Date: Aug 2018
Device: none
|
Thanks for your info.
Could you give me an example as I don't really know what to do here? I made a little doc file with two words, one serif and one serifless and converted it without removing font-family. The generated stylesheet.css looks like this: Code:
.block_ { display: block; padding: 0; margin: 0 0 8pt } .calibre { color: black; display: block; font-family: serif; font-size: 1em; padding-left: 0; padding-right: 0; text-align: justify; margin: 0 5pt } .text_ { font-family: "Times New Roman", serif } .text_1 { font-family: "Verdana", sans-serif } Do I have to use "additional css" or "change styles.."? Thanks. |
12-02-2021, 04:46 AM | #4 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Create a rule in transform styles
if the property font-family matches-pattern: sans-serif then change the value to sans-serif |
12-07-2021, 09:13 AM | #5 |
Enthusiast
Posts: 29
Karma: 10738
Join Date: Aug 2018
Device: none
|
Thanks again for your help.
"if the property font-family matches-pattern: sans-serif then change the value to sans-serif" Does this make sense? If it is sans-serif then change to the same? Code:
.text_ { font-family: "Times New Roman", serif } Removing font family, and then re-inserting it? I still have to figure it out, have some experimenting to do... |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automatically remove font-family on conversion? | Barty | Calibre | 9 | 04-04-2019 01:57 AM |
unable to remove serif from epub with other css properties | leftright | Editor | 19 | 08-27-2015 06:22 AM |
Mobigen Sans-serif generic family in mobigen generated .mobi files | Symmetria | Kindle Formats | 7 | 12-10-2013 03:47 PM |
Serif font for JBL | demingite | Ectaco jetBook | 3 | 12-13-2010 09:41 PM |
Do you prefer the Reader's serif or its sans serif font? (poll) | Alexander Turcic | Sony Reader | 9 | 11-25-2006 12:15 PM |