A Workaround for a Toki Pona Font-Display Issue

I think I’ve found a workaround to my font issues in the ebook version of the Toki Pona translation of The Lonely Little Fridge! I’ll be able to put out an ebook after all!

The book is put together with Toki Pona text, with both latin letters and a Toki Pona script called sitelen pona (“good drawing”), in parallel. The sitelen pona text is actually regular latin text with a special font applied, which changes its appearance drastically.

The sitelen pona text was not appearing properly in the ebook version. And only in the ebook version. Text in PDFs for print appeared properly, even though both ebook and PDF were exported from the same InDesign file!

The text with the problem. The letter o is still visible in the sitelen pona text (top line) in this screenshot taken from the ebook version.
The text without the problem, in this screenshot taken from the PDF version.

Figuring what was actually going on is a tale of exploration into strange new places…

I had to explore font construction, a new thing for me. A font can use ligature rules to replace strings of characters with individual characters: when it sees a specific string of characters, it replaces the symbols (“glyphs”) it shows for those characters on screen with a different glyph with the same meaning. This is the way that the glyphs for the letters ‘f’, ‘f’, and ‘l’ can be replaced with one glyph ‘ffl’ that combines the three letters into one symbol for easier reading. The underlying text remains the same.

Anyway, the font I’m using for Toki Pona does this on a grand scale. It considers entire words to be ligatures and replaces the series of glyphs of their letters with a glyph for the word’s symbol in the sitelen pona script! And since it’s only changing glyphs, the underlying text is not changed, and I can simply apply the font with a paragraph style to make the change!

But there was a problem.

The sitelen pona font was not changing the glyphs of certain single-character Toki Pona words in epub files. It was leaving the latin-letter glyphs behind while changing everything around them! And it was *only* doing this in epubs; the same font exported from the same InDesign file into a PDF intended for print rendered properly.

I was on the verge of abandoning my plans for an epub version of the book.

However, as a last resort, I decided to do some exploration. I googled the construction of OpenType fonts and how they handled ligatures. Then I downloaded a program called FontForge and used it to look at the construction of the sitelen pona font. And I found something.

If I was interpreting the sitelen pona font’s internal instructions correctly, it would replace *pairs* of single letters with the proper glyphs, but there seemed to be no instructions specifying what to do with single letters.

So an experiment was in order.

In my InDesign file, I changed the paragraph style of affected text from sitelen pona to regular latin characters, doubled the single-character words, and changed the paragraph style back to the sitelen pona font. The text in the sitelen pona font was rendered by InDesign properly on screen, as I expected.

Then I exported to epub.

And it rendered properly! The modified text appeared as it should in the epub, in Apple Books, Adobe Digital Editions, and Calibre Ebook Viewer.

I decided to test things by exporting from InDesign to a PDF. This too rendered properly.

So there’s my workaround. Misspell some text, and then it is rendered properly when the font is changed to display the sitelen pona text. (The latin-letter text in parallel is spelled properly.)

Now I can make an ebook as well as the hardcover version, just in time for IngramSpark’s summer sale! And I can wrap up the project and finish paying my translator!

And a new artistic field has appeared on my horizon: *font design*…