05-07-2015, 12:48 PM | #1 |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
support for XXspace chars in epub
I thought I was clever when I worked out how to add pseudo-kerning between a single and double quotemarks, so they didn't turn into a triple.
I noticed some books put a normal space, [“ ‘] but that allows a linebreak between the quotes. I thought looked too wide, so I use : [“ ‘]. And later when indenting some poetry, I used   (em-space) characters. That looked okay on Sigil. And I'm told it works on iPad iBooks. But I noticed both these characters display as black boxes in Calibre's ebook-reader. Is that just a bug in Calibre, or are these characters not officially meant to be used in ePubs? |
05-07-2015, 01:08 PM | #2 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Using named entities may be problematic in epubs, but the black boxes are probably due to the font lacking those characters, or to a buggy renderer, every Unicode character is allowed in epubs.
|
Advert | |
|
05-07-2015, 01:55 PM | #3 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
05-07-2015, 03:09 PM | #4 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
I have Georgia as the default serif font for Calibre, and also in Sigil, but it displays correctly in Sigil but not Calibre reader. It also displays correctly in Calibre editor preview. Georgia is a pretty complete font, and I tried Times New Roman and that's also boxes. And I converted the epub to mobi using Kindle previewer. The spaces display in everything, in Georgia. So I think the font and code is valid, it's just Calibre. |
|
05-08-2015, 05:39 AM | #5 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
  is not supported by my PRS 650 even if i have fonts in the ebook. Sigil is not trust worthy here, cause it uses QT5 which will render and allow much more as declared in the epub Standard, e.g. Sigil will follow all pseudo-classes, but no epub2 reader will follow this style.
|
Advert | |
|
05-08-2015, 06:13 AM | #6 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Speaking of em spaces, I am reading The Far Side of Paradise, Mizener's wonderful biography of F. Scott Fitzgerald. It was published in the 1950s, I think. I was astonished to see a double-wide space following every sentence, much as we were taught in typing class at Brewster Free Academy (using Army-surplus Remington manual typewriters). I have never before seen such a thing in a published book. What was Houghton Mifflin thinking?
I apologize for hijacking the thread, but to me this is a momentous discovery (despite the fact that I'd read the book years ago) and I just had to tell someone! |
05-08-2015, 11:16 AM | #7 | ||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
I'm using XP, which doesn't support QT5 apps. So I'm using an older version of Calibre and its minions, which shows the problem. I tried all the spaces in Sigil's "insert" : nbsp ensp emsp thinsp shy nnbsp of these only nbsp and shy worked, the rest are black boxes. Great. You don't even need a glyph to display a space. Any font should work. I expect issues with Chinese or Hieroglyphics, but spaces should be trivial and work in everything. So now I have to use stupid thick nbsp instead of thin. And I replaced each em with 3 nbsp, which looks really stupid in code but works. Quote:
Look at a few random old books on Google Books or at your local library. By the 1950s it would be uncommon but obviously still acceptable. But now of course with easy DTP and all the self published crap, double spacing, straight quotemarks and every other typographic horror is to be seen. Last edited by AlanHK; 05-08-2015 at 11:43 AM. |
||
05-08-2015, 11:47 AM | #8 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Actually, you do need a glyph for spaces. Although I believe they can all reference the same blank glyph?
If the space is not recorded in the font, how does the software know it's a space? |
05-08-2015, 12:46 PM | #9 | ||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
But I guess my hope is in vain. Quote:
If you edit a font and put a glyph in a space slot, the result can be poor. The software will break lines at this character, for instance, expecting it to be a space between words. I use an old DTP app that writes to postscript, which I have studied as I occasionally modify it to get some effect. When doing kerned and justified text it outputs one character, then a number to advance before the next. So any spaces are elastic. I know epub layout doesn't give us that control, but it demonstrates one simple way arbitrary spaces can be created whether they're in the font file or not. |
||
05-08-2015, 12:55 PM | #10 |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Rather than adding a character, wrap one of the punctuation marks in a styled <span>, and add some space with an margin setting in the CSS. You can then make the gap exactly how wide you want.
|
05-08-2015, 02:03 PM | #11 | |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
For example, it is entirely valid and within the defined purpose of font files to redefine a space as some arbitrary glyph. I can guarantee you there is someone, somewhere, who has good reasons to do just that... no matter how bad you may feel it looks. There is no reason why rendering software should make a special exception just for *spaces to hardcode their definition rather than allow the font to define it. In fact, there is every reason NOT to. |
|
05-08-2015, 02:35 PM | #12 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
For spacing between quotes, I prefer to rely on font kerning and, since most fonts don't have proper kerning for these pairs, I modify the font I use in my reader.
|
05-08-2015, 03:14 PM | #13 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
So I know you can put any glyph in any slot. But if you do it with a text font and not just a grabbag of symbols, it will screw up on the page. There are excellent reasons for software to treat space characters specially, and they do, as I gave an example earlier. How else can it know where to wrap a string of text? Layout software will break at a "space" regardless if you put a actual glyph there. Anyway, all these "special" spaces could be created on the screen/page regardless if they have a slot in the font file. DTP page layout software does that. But ebook rendering is less predictable. |
|
05-08-2015, 03:20 PM | #14 | ||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
But what epub readers have kerning? I think that's even less likely to be supported than these "exotic" spaces. Quote:
Maybe I could use "letter-spacing". I'll play with it. Last edited by AlanHK; 05-08-2015 at 03:28 PM. |
||
05-08-2015, 03:27 PM | #15 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Both my readers (Kobo Aura and Cybook Orizon) support kerning, even my old Gen3 supported kerning if I remember correctly. They support using custom fonts too, without embedding, so I can enjoy kerning (and ligatures) in any book.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ePub CSS @fontface Unicode chars render in <td>, not in <div>, other elements | Abelinkin | ePub | 2 | 06-05-2012 04:24 AM |
Junk chars in splitted file names converting lit to epub | ozofmoz | Conversion | 2 | 07-15-2011 02:53 AM |
PDF->epub: double l chars changed | bobkoure | Conversion | 1 | 05-02-2011 10:05 PM |
0.7.44 Problem with national chars while converting to epub | AdamV | Conversion | 5 | 02-08-2011 08:01 PM |
Replacing Chars in URL | DAiki | Calibre | 5 | 10-13-2008 09:25 AM |