View Full Version : Special chararcters on the iPad or why does Apple not support Font-embedding?


georg3200
09-30-2010, 11:52 AM
Hi there,

we produce epubs for our customers. We often have texts with foreign characters that are not contained in the normal characters like ğ (g with breve). I think its a Turkish character.

We usually do this by embedding a font into the epub. But this does not work in the iPad. No font-embedding on the iPad.

Using the HTML-Code "&# 287 ;" (remove the blanks) works in Firefox, but not in an epub and of course not at all on the iPad.

So, does someone has an idea how to show such a character on the iPad?
Or are we the only ones who have to display foreign language in an EPUB on the iPad?

pholy
09-30-2010, 01:02 PM
Have you looked at Liz Castro's book _EPUB Straight to the Point_ ? It's excellent, especially for iBook publishers. You can find it at her blog site http://www.pigsgourdsandwikis.com/

I think it discusses the thirty or so available fonts and how to use them, but not the character coverage of each font. One hopes that one of the fonts gives fairly complete Unicode coverage... Perhaps a search at support.apple.com might help (not likely, though)

charleski
09-30-2010, 03:21 PM
I don't think Castro's book really covers this.

The fact is that, while Apple's inbuilt fonts have a much wider coverage than ADE's, they're still far from complete. If you need to use a character that's not supported, then you're out-of-luck as far as iBooks is concerned, there's no way of getting it to display beyond rendering it as an image.

jharker
09-30-2010, 05:16 PM
Actually, it's perfectly possible to embed fonts in iBooks. I documented the basic technique in a blog post (http://bergenstreetpaperco.blogspot.com/).

Essentially you can use any font, but it must be converted into SVG font format. Also, although it is possible to replace the entire text with the embedded font, it is extremely slow and carries other drawbacks. Still, for rendering individual characters, such as for math or isolated non-Latin words, this method works quite well.

However, for your situation all you really need is accented Latin characters, which I'm pretty sure the iPad is equipped to handle. I haven't done this before. But here's a guess: save your file using UTF-8 encoding. (It should be in UTF-8 anyway. Make sure your headers specify UTF-8 as well.) Then just use the actual character instead of the HTML-code.

Let us know how it goes!

Chang
10-05-2010, 04:18 AM
I have similar problem but just only with ADE. I should present the known symbols of a man ♂ (alt+11) and a woman ♀ (alt+12). Works well e.g. in Firefox but not in ADE where they show up as question marks. I don't want to do font embedding. I guess at the moment I don't have any option to show these symbols without font embedding. Do you know if ADE will expand its support for special characters in the future? Should I leave the symbols there and wait for new version of ADE or just remove the symbols? What do you think?

st_albert
10-05-2010, 11:21 AM
I have similar problem but just only with ADE. I should present the known symbols of a man ♂ (alt+11) and a woman ♀ (alt+12). Works well e.g. in Firefox but not in ADE where they show up as question marks. I don't want to do font embedding. I guess at the moment I don't have any option to show these symbols without font embedding. Do you know if ADE will expand its support for special characters in the future? Should I leave the symbols there and wait for new version of ADE or just remove the symbols? What do you think?

Another option you have is to use graphic images of the symbols. Not very appealing either, but if you only need those two symbols, maybe it's practical in your case.

jharker
10-05-2010, 12:00 PM
Chang, yes, I think your only options for ADE at this point are font-embedding or using an image.

One question: are you sure your file is saved using UTF-8 encoding?

Jellby
10-05-2010, 12:04 PM
You could create and embed a minimalistic font with just the two symbols.

Freeshadow
10-05-2010, 12:37 PM
You could create and embed a minimalistic font with just the two symbols.

http://www.unifycommunity.com/wiki/index.php?title=Create_a_new_TrueType_font_using_a _subset_of_characters_from_an_existing_TrueType_fo nt

frabjous
10-05-2010, 01:34 PM
Actually, it's perfectly possible to embed fonts in iBooks. I documented the basic technique in a blog post (http://bergenstreetpaperco.blogspot.com/).

This surprises me. When the iPad was first released, I made an ePub with an embedded SVG font to see if it would work (since I knew mobile Safari supported SVG fonts), and had someone test it, and it didn't work.

See here (post #15) (http://www.mobileread.com/forums/showthread.php?p=858089)

Did I do something wrong there?

charleski
10-05-2010, 02:19 PM
Actually, it's perfectly possible to embed fonts in iBooks.

This surprises me. When the iPad was first released, I made an ePub with an embedded SVG font to see if it would work (since I knew mobile Safari supported SVG fonts), and had someone test it, and it didn't work.

See here (post #15) (http://www.mobileread.com/forums/showthread.php?p=858089)

Did I do something wrong there?

He's using the <cite> hack.

Apple's approach is idiotic and stubborn, but it's quite clear: they don't want book designers to have any control over the fonts, they don't even want them to be able to specify which inbuilt font is used. Some of the loopholes that existed have been closed off, and the <cite> loophole will probably be 'fixed' in a future version.

It would be unwise to rely on a hack for something that's essential to your book. The only robust option that won't break in a future version would be to render the characters or symbols that you need as individual pieces of svg and embed those inline with the text.

frabjous
10-05-2010, 02:41 PM
Thanks, I should have read further on in the blog post that jharker linked to. "Actually, it's perfectly possible to embed fonts in iBooks." has got to be one of the most misleading claims I've seen. "Perfectly possible" to me does not suggest the need for mangling the mark-up of my XHTML files beyond recognition and the use of many other ugly hacks that don't follow common sense and good practice techniques for creating eBooks to work well cross-platform.

Chang
10-06-2010, 03:41 AM
One question: are you sure your file is saved using UTF-8 encoding?

I'm sure that it's UTF-8. ADE just doesn't support these special characters. I decided to make those two symbols as pictures because I try to avoid font embedding. I tried to find a optimal size for the pictures so they look good no matter what the font size is. Of course, with super big font size the symbols don't look so good next to a big letters but who reads e-books with massive font size anyway :) Thank you all for help and good answers!

jharker
10-06-2010, 10:32 AM
One possibility, I think, would be to create those characters as SVG graphics. Then they should be scaled correctly when the font is resized. This advice is based on hearsay -- I've never actually done that before.