Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kobo missing characters #19

Open
ldutra opened this issue May 8, 2019 · 12 comments
Open

Kobo missing characters #19

ldutra opened this issue May 8, 2019 · 12 comments

Comments

@ldutra
Copy link

ldutra commented May 8, 2019

Having charged lgpsi.epub in my Kobo Aura One, I realised it is nearly unusable. While it works OK in the Android ePub readers I have tried until now — Google Play Books, for instance — in Kobo most accented characters are missing. I am really clueless about this. I guess it is either the lack of a good Greek font in my device, or some character codification issue in lgpsi.epub itself. Any pointers would be welcome.

@ldutra
Copy link
Author

ldutra commented May 8, 2019

I managed to put in title.txt:

---
lang: grc
---

But still the Kobo does not show most accented characters. Embedding SIL Gentium makes the file unreadable, even if epubcheck works nice. My best guess would be to load a suitable font in the Kobo’s fonts directory, but how to make the ePub use it, preferrably from something in title.txt?

@honza
Copy link
Contributor

honza commented May 8, 2019

Is there a way to reproduce it in the calibre previewer by fiddling with the settings?

@ldutra
Copy link
Author

ldutra commented May 8, 2019

I have no idea. I guess I could try an alternative reader in my Kobo, but it usually needs rebooting the device and foregoing the standard interface. For now I will keep looking for a way to ask pandoc to specify a font I have charged at the Kobo. It seems there is a YAML parameter called greekfont.

@ldutra
Copy link
Author

ldutra commented May 9, 2019

I managed to get a working ePub in Kobo. Instead of manipulating the ePub after the fact, I used the pandoc --epub-embed-font and --css options. So, my ebook.sh reads:

pandoc --epub-embed-font=/usr/share/fonts-sil-gentiumplus/woff/GentiumPlus-R.woff --epub-embed-font=/usr/share/fonts-sil-gentiumplus/woff/GentiumPlus-I.woff --css=src/epub.css -s --toc -o docs/lgpsi.epub src/title.txt $(ls -1 src/*.md)

Obviously, this is highly specific for my system, but I guess if one knows enough about pandoc, ePub and fonts one would be able to generalise and create something more useful.

My epub.css — the first part was just the generated CSS file I conserved for good measure:

/* This defines styles and classes used in the book */
body { margin: 5%; text-align: justify; font-size: medium; }
code { font-family: monospace; }
h1 { text-align: left; }
h2 { text-align: left; }
h3 { text-align: left; }
h4 { text-align: left; }
h5 { text-align: left; }
h6 { text-align: left; }
h1.title { }
h2.author { }
h3.date { }
ol.toc { padding: 0; margin-left: 1em; }
ol.toc li { list-style-type: none; margin: 0; padding: 0; }
a.footnote-ref { vertical-align: super; }
em, em em em, em em em em em { font-style: italic;}
em em, em em em em { font-style: normal; }

@font-face {
font-family: GentiumPlus;
font-style: normal;
font-weight: normal;
src:url("../fonts/GentiumPlus-R.woff");
}
@font-face {
font-family: GentiumPlus;
font-style: italic;
font-weight: normal;
src:url("../fonts/GentiumPlus-I.woff");
}
body { font-family: "GentiumPlus"; }

Now the file contents display nicely, even if the title in the Kobo interface’s list of books still shows empty squares in place of most accented characters.

As mentioned before, I beefed up title.txt, but I guess only the lang: grc was actually necesary:

% Ἡ Ἑλληνικὴ γλῶσσα καθ᾿ αὑτὴν φωτιζόμενη
% Seumas MacDonald
% 2019-05
---
lang: grc
greekfont: GentiumPlus
---

@ryanfb
Copy link
Contributor

ryanfb commented May 9, 2019

There may be an issue with Unicode normalized forms here as well - I just did a test run of converting everything to Normalized Form C, and almost every line was affected (at a quick glance, there are many many instances of oxia instead of tonos). On some devices this can affect display of text as well. So maybe all the text should be normalized to NFC before conversion.

@ldutra
Copy link
Author

ldutra commented Jun 27, 2019

Downloaded the latest ePub, the issue remains.

@ryanfb
Copy link
Contributor

ryanfb commented Jul 9, 2019

Can you try with the attached epub and report back? I've normalized the Markdown to NFC before converting for it (may need to unzip before copying):
lgpsi.zip

@ldutra
Copy link
Author

ldutra commented Jul 11, 2019

No luck yet. It seems the Kobo really has a trouble interpreting the file as it is. Incidentally, I have tried my procedure above with the latest file and failed; will try again later.

@ldutra
Copy link
Author

ldutra commented Dec 10, 2019

Checked the latest ePub on the site with a new Kobo Forma, the issue remains.

@ldutra
Copy link
Author

ldutra commented Jan 23, 2020

Tried latest version again, no luck.

@ldutra
Copy link
Author

ldutra commented Aug 22, 2020

Yet again tried, now compiling from the current tree and after a Kobo update, no luck. Will fiddle again.

@ldutra
Copy link
Author

ldutra commented Aug 22, 2020

Now I think I understand a wee bit better what is happening. For some reason my changed files above do not work anymore. I then loaded Gentium-R.ttf (not GentiumPlus-R.woff) and related files at my Kobo, and then I could read the files allright after choosing Gentium from the font menu. GentiumPlus would not even appear in the menu. So I changed my title.txt and epub.css to point to the Gentium TrueType fonts, and all is well again. I do not know how this should affect the files as published — I do not know if it is a Kobo defficiency, and if there is a more generic way of solving the issue. But now I can read LGPSI again in my Kobo, comfortably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants