03-25-2024, 08:03 AM | #1 |
Enthusiast
Posts: 43
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Set a font in CSS so that it doesn't change from the Aa menu?
I have an epub that includes captions defined with sans-serif font. When I load it into the Kobo (transformed into kepub by Calibre), if I choose "Publisher default", the text looks in serif style (I've read that the default font is Georgia), and the captions look sans-serif, as defined.
However when I select any other font (I prefer serif) in the "Aa" menu of the Kobo, it is applied to all the text and also to the captions, even though they are defined as sans-serif. I have tried embedding a sans-serif font (Aileron) and defining the captions with it, but the same thing still happens. Is there any way to set a font (embedded or not) in an epub so that the ereader will use that one and not another one even though I select another font in the "Aa" menu? I have found that I do not have this problem with the epub format, i.e. I can change the font in the "Aa" menu and the texts defined as sans-serif are still displayed in sans-serif. But I would prefer to have a solution for kepub. Last edited by repilo; 03-25-2024 at 08:35 AM. |
03-25-2024, 08:44 AM | #2 |
Grand Sorcerer
Posts: 10,151
Karma: 224760044
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Unfortunately there is no real solution for kepub. There is a patch addressing the issue, but I haven't gotten it to work properly.
|
03-25-2024, 04:41 PM | #3 |
Wizard
Posts: 1,026
Karma: 11500112
Join Date: Sep 2022
Device: Kobo Libra 2
|
The font menu overrides all fonts when you're using KEPUB. The only way to display the book with multiple fonts is to edit the CSS to use all the fonts you want ahead of time and then select the publisher font option, i.e. you're half way there. Instead of setting only the sans-serif font in the book, you need to define the serif font, as well.
|
03-25-2024, 05:33 PM | #4 |
Enthusiast
Posts: 43
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Thanks for the answers. I would have liked, using kepub, to be able to change the general font when I get tired of one and want to try another, but always keeping the captions with a sans serif font.
Another example would be a book about ancient Rome, with chapter titles and drop caps set with some ancient font (which I don't want to change) and the general text with a serif that I would be able to change when I feel like it. That would be nice, Kobo, if you're listening. |
03-25-2024, 06:03 PM | #5 |
Wizard
Posts: 1,026
Karma: 11500112
Join Date: Sep 2022
Device: Kobo Libra 2
|
If Kobo did that, then you'd have the opposite problem: people need to be able to change the font for accessibility, and if the font menu doesn't override all the fonts, then you may be stuck with some unreadable text if the publisher selected a bad font for certain paragraph styles. There's no universal solution except to edit the book beforehand with the fonts you want. If you like randomly changing the font for fun, then you have a lot of extra work ahead of you.
|
03-25-2024, 06:05 PM | #6 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
As soon as you choose anything other than 'Publisher Default' from the [Aa] menu then this sledgehammer override CSS is applied to your kepub: Code:
* { font-family: %1 !important;} If you want a lighter touch with the override CSS you have 2 choices:
@Sirtel, I don't know why the patch isn't working for you, it works fine for me. If you want to pursue it, feel free to PM me with a link to a book it doesn't work for. |
|
03-25-2024, 07:08 PM | #7 | ||
the rook, bossing Never.
Posts: 11,171
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
This was the Roman Alphabet 2000 years ago A B C D E F Z G H I K L M N O P Q R S T V X . They had no upper and lower case. That's close to the letter style used. C was pronounced K, like in Irish today, hence Caesar -> Kaiser. J was very much later simply I (or a Y sound) at the start of a word. No J. Lower case was invented in Ireland 600 years later, and was used in Ireland till about 120 years ago. It's similar to current lower case. It became Carolingian minuscule German Blackletter was used later, from about 11thC to 1941 when Hitler discontinued it (no-one is completely bad, just 99.99% bad). People might use a Fraktur family font for Blackletter headings of Gothic stuff. The Old English font is related and nothing to do with Old English. It's slightly more readable than German Blackletter. Blackletter, especially as body font, is very inaccessible. The User Font selection should have an Advanced setting where you pick fonts for sans, serif, monospace, cursive and decorative and have the option to leave headings unchanged. The "apply this font to everything" sledgehammer is lazy accessibility. Serif as a body and Sans as headings is a common choice. People used to web sites might want sans for body. People most easily read what they are used to. Quote:
Code:
.p1 { font-family: "Times New Roman", Times, serif; } .p2 { font-family: Arial, Helvetica, sans-serif; } .p3 { font-family: "Lucida Console", "Courier New", monospace; } https://www.w3schools.com/Css/css_font.asp It's managers and programmers that don't seem to understand accessibility. Last edited by Quoth; 03-25-2024 at 07:16 PM. |
||
03-26-2024, 05:26 AM | #8 | |
Enthusiast
Posts: 43
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Quote:
I still prefer kepub for other reasons. |
|
03-26-2024, 05:13 PM | #9 |
Wizard
Posts: 1,026
Karma: 11500112
Join Date: Sep 2022
Device: Kobo Libra 2
|
EPUB uses RMSDK for rendering. KEPUB uses WebKit. They're completely different engines. One of the reasons I prefer KEPUB is that it does support total font replacement. EPUB books can be formatted to forbid you from changing the font, but in KEPUB this formatting is ignored, which allows you to change the font without having to edit the book's CSS. Different people want different things.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is it possible to change the menu font? | tesseractcat | KOReader | 2 | 03-09-2019 06:27 PM |
Change to interface font doesn't stick | eater | Calibre | 3 | 02-21-2018 03:46 PM |
Touch Change font by editing ePub CSS | ExOblivione | Barnes & Noble NOOK | 8 | 12-25-2012 12:48 AM |
How to change the font-size in the body tag in css? | naisren | Conversion | 2 | 10-01-2012 05:52 PM |
Hacks First post here. Can I change the size of the default font set? | johnleo | Amazon Kindle | 3 | 08-09-2012 01:23 PM |