![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
|
Embedded fonts in kepub goes hiding...
While testing some things I embedded fonts for the very first time. Looked as expected in Sigil (and Calibre). Alright... ok on my kobo, yes! not ok on my kobo....what?!
I'm sure I'm doing some rookie mistake, but what? The embedded fonts work fine as epub, but as kepub I have to set Font Face to Publisher Default. If I choose any font, which I usually do, they don't show. (I searched but didn't find any info about this. If this was a real problem I think there would be discussions about it. Thus I think I'm doing something not correct.) I'm using two different fonts, no difference between them. Here is my code: <p><span class="freemono">some text...</span></p> css: span.freemono { font-family: "FreeMono", serif; font-size: 1em; } @font-face { font-family: 'FreeMono'; font-weight: normal; font-style: normal; src: url('../Fonts/FreeMono.ttf'); } Or is it something in Calibre and/or the kepub-plugin that needs to be set? Last edited by patrik; 03-09-2016 at 03:32 PM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
This is just the way the KePub reader works (the ePub reader works differently though). If you select publisher default you get the embedded fonts. If you select any other font, that selection overrides everything in the KePub.
There is a firmware patch that can change this behaviour, named `Un-Force user font-family in KePubs`. Edit: To see the diference between how the KePub and ePub readers work, these are the respective sections of the built-in stylesheet that are activated when you select a font other than "Publisher default" from the device's font menu: ePub reader: Code:
body, p { font-family: -ua-default !important; } Code:
* { font-family: %1 !important; } Last edited by GeoffR; 03-10-2016 at 12:33 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
|
Hmm, ok, thank you Geoff, I understand.
(Is there somewhere I can see how other e-readers handles this? Like Kindle, Pocketbook, etc.) For the "fancy" font I'm playing around with, it fall-backs to built-in font, which is fine (as in the reader will get something readable, just not as fancy). But I picked the other font because it has characters not available in the built-in fonts. These characters are simply not shown. Is there a way to get a fall-back to something else? (The characters are ballot-box, empty, with-cross, and the cross by itself.) |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
If you are just making the book for yourself, then the best solution is to patch the firmware to fix the problem with the KePub reader, and then you don't need to change the book at all.
But if you are publishing the book for others to read, then I don't think there is any solution involving embedded fonts. Without a patch the KePub reader is just plain broken in this regard. A workaround for the special symbols would be to use images instead of embedded fonts, and size the images as height:1em;width:auto; so that they scale to match the text size. If you use real SVG images then they can look just as good as an embedded font, and since the symbols are not being used as letters in a word it won't matter that they don't work with the dictionary lookup or search functions. (You could also use bitmap images, but they will give a much poorer result than SVG images.) --- For the ePub version, I would strongly sugguest that you make sure the reader can override the embedded font used for the books main body of text. It is okay to force the use of your font for headings and other decorative purposes, but if you force the reader to use your embedded font for the main paragraph text then at best you will irritate a lot of readers, and at worst some readers with dyslexia, vision impairments, etc. might not be able to read your book at all. The best way to do that is to set the font-family to your embedded font in body (and in h1,h2 headers, spans for special cases, etc.), but leave the font-family undefined (or explicitly set font-family:inherit) in the paragraph styles used for the main body of text. That way if the reader selects publisher default then they will get the embedded fonts as you chose them including for the main body of text, but if they select their own font then they will still get your embedded fonts for headings etc. but will get their own selected font for the main body of text. (This advice applies to the kePub version too I guess, but only those readers who have patched their device will see the benefit, others will see no difference.) |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,855
Karma: 22003124
Join Date: Aug 2014
Device: Kobo Forma, Kobo Sage, Kobo Libra 2
|
Why not load the font on your kobo that way you have the option to choose it, and still adjust all the other settings, except for weight. And if you wanted weight there is a patch via the same option Geoff mentioned
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
|
So far I have only made epub's for myself (from books I bought as pdf, or scanned a few), and then I only cared that it looked ok for me.
But this is a little project where I'm digitalizing a very, very rare book from 1887 and I plan to share (for free) with my peers within a profession. So it has to work for other e-readers (and iPad/Android) besides my own. This is a massive learning moment for me. I test things much more now, and I must say I'm very surprised how much of the epub-specification most software doesn't support. -- The first character in the first word in most chapters are a very special font. I have been playing around with making my own font, or buy a very similar one, but now I'm not sure if it's worth it due to all these embedded font-challenges. For special characters, the ballot box is the only one I noticed so far. There may be more. Thanks for the tip on svg for the characters, that seems to be the easiest and probably most supported way to do it. (I'll probably play around with fonts just for fun though... ![]() -- This place is fantastic! I learn much, much more here compared to from the epub-books I have bought. Thanks again! ![]() |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
patrik: Just a warning, unless you keep everything simple, nothing works on all ereader devices and apps. This goes for all epub based readers, and when you add conversion to a Kindle format, it gets worse.
Using SVG is probably the best solution for the future, but I don't know how well it works on older devices. There are still a lot of Sony's and older devices out there. I also don't know how it translates to Kindles. I would recommend a post in the Workshop or epub forum here for this type of question. There are some very experienced ebook makers hanging around there. |
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,740
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Just a bit of advice Freemono is an awful font.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Glo Kobo fonts naming conventions and embedded fonts | roger64 | Kobo Reader | 0 | 05-09-2013 06:30 AM |
Troubleshooting PW embedded fonts? | morrow | Amazon Kindle | 12 | 11-15-2012 07:17 PM |
embedded fonts | Wally S | Workshop | 15 | 01-21-2012 03:57 PM |
Embedded fonts? | Greenmantle | Kobo Reader | 66 | 07-27-2011 08:20 PM |
Embedded fonts, Calibre, and choice of fonts | AlexBell | ePub | 8 | 05-30-2010 06:00 AM |