Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 12-02-2021, 03:24 AM   #1
FelixKrull
Enthusiast
FelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watch
 
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
FelixKrull is offline   Reply With Quote
Old 12-02-2021, 03:28 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-02-2021, 03:57 AM   #3
FelixKrull
Enthusiast
FelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watch
 
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
    }
I am not sure what to do next if I want to remove those fonts, but keep the serif/sans-serif info.

Do I have to use "additional css" or "change styles.."?

Thanks.
FelixKrull is offline   Reply With Quote
Old 12-02-2021, 04:46 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 12-07-2021, 09:13 AM   #5
FelixKrull
Enthusiast
FelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watchFelixKrull is clearly one to watch
 
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
    }
How can I achieve that always "Georgia" is used for serif, no matter what font-family is coded in the style sheet?

Removing font family, and then re-inserting it?

I still have to figure it out, have some experimenting to do...
FelixKrull is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 02:42 PM.


MobileRead.com is a privately owned, operated and funded community.