Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 05-10-2013, 09:06 AM   #1
fxp33
Zealot
fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.
 
Posts: 144
Karma: 109220
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD
Multiple fonts in ebooks

Hi,

What is the best way to use multiple fonts ? (in multilingual ebooks, for example)

First of all, I noticed two different behaviours depending on the filename of the ebook (please do correct me if I am wrong):
  • .epub (regular epub) : if the stylesheet doesn't specify a font, one and only one font is applied to all the book. An empty box is displayed if a character doesn't exist in the font.
    • Example: if you choose a chinese font, the chinese will be correctly displayed but some pronunciation in latin characters (pinyin) might be broken because of the lack of accents in this font. Even if there are plenty of fonts with accent installed by default on the device.
  • .kepub.epub (access epub) : if no stylesheet is specified in the book, the engine can use different fonts to match all the characters (chinese, arabic, hebrew, tibetan...) in the book (the loading of fonts can take some time, though)
    • Example: in a bilingual epub showing sanskrit, and french, as long as there is a sanskrit font installed in the device, two different fonts will be applied to the text, depending on the language of the word.


Are there other options than those?
  1. include specific fonts inside the epub, and using the stylesheet to display them
    • Perfect control: the book will be correctly displayed whether the user has installed the fonts or not, and whether the book is an epub or a kepub.epub.
    • Heavier book (especially for large CJK (chinese, japanese, korean) fonts
    • No liberty for the user (unless the user re-edits the stylesheet)
  2. letting the user choose them in the device
    • very difficult with regular epub (only one font for the whole book)
    • requires that the different characters sets of the book have corresponding fonts installed on the device (an advice at the beginning of the book would be nice)
  3. having a stylesheet with generic font families
    • Would eventually work on regular epub and kepub.epubs
    • no guaranty on the result
    • Unfortunately, the font-family doesn't apply to character sets (who knows how to use the "unicode-range" css property? And how is it understood by our engines?)

I consider that there is no definite solution, and that everyone has to deal with the three dimensions of the problem (size - liberty - simplicity) depending on the expected audience of their production.

I would be happy to hear about your ideas, tips, tricks and the different solutions you use (or would be using).

On a more "activist" plan, any suggestions about how we could improve and help such publication would also be nice. At this stage I miss:
  • a list of the character sets covered by the default kobo fonts
  • a bundle of a minimum list of fonts to cover the missing character sets ("a mobileread recommendation") to harmonize multilingual edition

François
fxp33 is offline   Reply With Quote
Old 05-10-2013, 08:38 PM   #2
fxp33
Zealot
fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.
 
Posts: 144
Karma: 109220
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD
Here is the list of fonts for the Kobo Glo 2.5.0:

From:
\kobo-update-2.5.0\KoboRoot\usr\local\Trolltech\QtEmbedded-4.6.2-arm\lib\fonts

I don't know why but the files cannot be opend in windows (not a valid font file).

If someone knows a way to tell which unicode character range each of them covers... especially for Ryumin and MP Gothic which seem pretty big.
  • 77 888 Amasis-Bold.ttf
  • 75 616 Amasis-BoldItalic.ttf
  • 76 016 Amasis-Italic.ttf
  • 72 688 Amasis.ttf
  • 56 656 Avenir-Bold.ttf
  • 50 704 Avenir-BoldItalic.ttf
  • 49 904 Avenir-Italic.ttf
  • 54 816 Avenir.ttf
  • 59 856 Caecilia-Bold.ttf
  • 48 448 Caecilia-BoldItalic.ttf
  • 48 224 Caecilia-Italic.ttf
  • 66 640 Caecilia.ttf
  • 114 912 georgia.ttf
  • 115 920 georgiab.ttf
  • 111 376 georgiai.ttf
  • 112 688 georgiaz.ttf
  • 54 288 GillSans-Bold.ttf
  • 48 336 GillSans-BoldItalic.ttf
  • 48 304 GillSans-Italic.ttf
  • 54 128 GillSans.ttf
  • 6 142 864 Gothic MB101.otf
  • 108 176 KoboNickel-Bold.ttf
  • 100 256 KoboNickel-BoldItalic.ttf
  • 93 024 KoboNickel-Italic.ttf
  • 97 824 KoboNickel.ttf
  • 62 400 Malabar-Bold.ttf
  • 53 296 Malabar-BoldItalic.ttf
  • 53 648 Malabar-Italic.ttf
  • 64 512 Malabar.ttf
  • 32 144 OpenDyslexic-Bold.otf
  • 56 592 OpenDyslexic-BoldItalic.otf
  • 49 632 OpenDyslexic-Italic.otf
  • 28 192 OpenDyslexic-Regular.otf
  • 9 449 936 Ryumin.otf

François
fxp33 is offline   Reply With Quote
Old 05-10-2013, 10:04 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 1,849
Karma: 5698904
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Aura HD, Glo, Nexus 7, iPad 3
Quote:
Originally Posted by fxp33 View Post
Here is the list of fonts for the Kobo Glo 2.5.0:

From:
\kobo-update-2.5.0\KoboRoot\usr\local\Trolltech\QtEmbedded-4.6.2-arm\lib\fonts

I don't know why but the files cannot be opend in windows (not a valid font file).

If someone knows a way to tell which unicode character range each of them covers... especially for Ryumin and MP Gothic which seem pretty big.
François
FontForge reports Gothic from 2.0.4 to contain:

Non-Unicode Glyphs 1490/0
Basic Multilingual Plane U+0000-U+FFFF 210/60930
Number Forms U+2150-U24ff 29/58
Enclosed Alphanumerics U+2460-U24FF 141/160
Dingbats U+2700-U27BF 10/191
Enclosed CJK Letters and Months U3200-U32FF 30/254

The font files from Kobo firmware later than 2.0.4 will not open because they are obfuscated to prevent people from simply copying them for use elsewhere.

Regards,
David
DNSB is offline   Reply With Quote
Old 05-11-2013, 06:58 AM   #4
fxp33
Zealot
fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.
 
Posts: 144
Karma: 109220
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD
Thanks a lot DNSB,

I will make some testing on CJK files with Gothic. Until I saw its size I didn't suspect I could use it for chinese and japanese texts.

Regards

François
fxp33 is offline   Reply With Quote
Old 05-12-2013, 11:23 AM   #5
Anak
Addict
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 378
Karma: 401766
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
I know there is another issue when two different font families are used.
A sans-serif font for headers and a serif font for bread text.
The user agent (device) should use its default font family for sans serif and serif fonts. No actual fonts are embedded in the epub/kepub it self.

The regular epub shows the headers with sans-serif font (correct).
The kepub uses the serif font for headers (incorrect).

In this example different font families were used for header an non-header text but applies to every element (or class) for which a different font family is defined.

Just use the code below in a normal epub 2 package.

Simple css
Code:
body {
margin:0;
font-family:serif; /* use the default ua serif font */
font-size:100%;
font-weight:normal;
font-style:normal;
font-variant:normal;
line-height:1.3em;
text-indent:0;
text-align:justify;
}
h1,h2,h3,h4 {
font-family:sans-serif; /* telling the ua to use a sans-serif font (override default font setting (body tag)*/
}
p {
margin:0; /* p tag: no specific font settings use the default font  as defined in body tag */
padding:0;
}
Simple html file
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="../Styles/Style0001.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <h2>This headline (h2-tag) should use the default ua sans-serif font.</h2>

  <p>This is the bread text and should be displayed with the default ua serif font.</p>
</body>
</html>

Last edited by Anak; 05-12-2013 at 03:19 PM.
Anak is offline   Reply With Quote
Old 05-12-2013, 02:36 PM   #6
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 573
Karma: 63112
Join Date: Apr 2013
Device: Kobo Glo, Kindle 4
@fxp33: are you sure the problem is not caused by the epubs themself? Try to convert with Calibre plugin a problematic epub to kepub and see if characters are displayed or not.
Lucas Malor is offline   Reply With Quote
Old 05-12-2013, 03:19 PM   #7
fxp33
Zealot
fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.fxp33 is far more humble than you.
 
Posts: 144
Karma: 109220
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD
Quote:
Originally Posted by Anak View Post
I know there is another issue when two different font families are used.
A sans-serif font for headers and a serif font for bread text.
...
The regular epub shows the headers with sans-serif font (correct).
The kepub uses the serif font for headers (wrong).
My first try using your code confirmed this unexpected behavior.

Haven't found a workaround yet


François
Attached Files
File Type: epub Anak Fxp33 - test multi font v2.kepub.epub (16.1 KB, 26 views)
File Type: epub Anak Fxp33 - test multi font v3.kepub.epub (2.0 KB, 24 views)
fxp33 is offline   Reply With Quote
Old 05-12-2013, 05:08 PM   #8
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,705
Karma: 3818505
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
@Anak,

I'm afraid I don't have an answer to your question, but I thought I'd mention the following that I discovered when I first got the Glo.

You should take care where/when you use the font-family: serif statement. On Kobos it will usually display its 'Document Default' font (Georgia) rather than the serif font you may have selected from the font menu. In your example, you'll probably get away with it because the Kobo automatically overrides body {font-family: xxx} with your selected font, but if you use font-family: serif at a lower level than body (e.g. at the <p> level or in a class) you'll get Georgia and it won't be changeable from the Kobo font settings. I've found it safest to not use font-family: at all rather than code it as serif.

I have not found this to be the case on any of my previous non-Kobo readers. Of course, I haven't re-tested since my initial experiments so I suppose it could have changed in the last 6 months.

A comment on your original problem - ignoring font-family: sans-serif/monospace seems to be very common on Android epub reading apps as well. It's why I prefer Mantano over some of the other major names.
jackie_w is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embed multiple fonts? writerkit Conversion 1 05-08-2013 01:45 AM
Multiple publishers for ebooks? Quiss Writers' Corner 14 08-25-2012 04:46 PM
Same page, multiple fonts? larryt Kobo Reader 17 08-10-2012 08:59 AM
One eBook, multiple fonts? sehlat Calibre 2 07-11-2011 08:14 PM
Touch Fonts and ebooks brudigia Barnes & Noble NOOK 2 06-18-2011 06:30 PM


All times are GMT -4. The time now is 03:13 AM.


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