Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-10-2015, 05:55 AM   #31
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
I have been following this with (somewhat bemused) interest. At first I didn't see the point of what you're trying to do--that you were searching for the solution to a problem that doesn't exist. So I looked at the Chicago Manual of Style for enlightenment and found that, as expected, it didn't address the situation at all. But when I look closer, I see that there is indeed a sliver of space between doubled quotation marks, and these are not duplicated in my (ancient, to be sure) version of Word. I'm at 10.25-26 in the 14th edition.

The CSM gives this example, of a quote within a quote within a quote: “I eat what I see.”’” But on the printed page, there is a discernible (though just discernible) space between the single quote and the enclosing double quotes.

Later: Interestingly, after hitting Post, I can see the barest sliver between those sets of quotes. It's more than I see in Word (or pasted into this window) but still less than what I see in the CSM.

Last edited by Notjohn; 05-10-2015 at 05:59 AM.
Notjohn is offline   Reply With Quote
Old 05-10-2015, 06:44 AM   #32
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Notjohn View Post
The CSM gives this example, of a quote within a quote within a quote: “I eat what I see.”’” But on the printed page, there is a discernible (though just discernible) space between the single quote and the enclosing double quotes.
If there are outer + inner quotes right next to eachother, typographically, there should be a thin space in between:

Code:
This is a sample of “ ‘Outer Quotes’ right next to ‘inner quotes.’ ”
Although with the problems with many ereader fonts missing the thin space character, you may want to use a non-breaking space to be more compatible (although I find this to be much too large):

Code:
This is a sample of “ ‘Outer Quotes’ right next to ‘inner quotes.’ ”
I just settle on this:

Code:
This is a sample of “‘Outer Quotes’ right next to ‘inner quotes.’”
and hope that the kerning on the device/user font would properly kern the “‘ and ’” pair.

Having normal spaces around the quotation marks might lead to the device causing some ugly line breaks and/or the quotation marks may get mangled if you run it through some "smarten punctuation" algorithms.

Side Note: I ran into this same exact question when I was first OCRing books. I thought that the space between quotation marks was a typo the first few times I ran across it (it rarely occurs in the books/journals I convert). So I went hunting down the explanation. Don't have a specific source, but I recall spending a few days reading all the sites/topics on the subject.

Last edited by Tex2002ans; 05-10-2015 at 06:56 AM.
Tex2002ans is offline   Reply With Quote
Advert
Old 05-10-2015, 09:25 AM   #33
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Notjohn View Post
I have been following this with (somewhat bemused) interest. At first I didn't see the point of what you're trying to do--that you were searching for the solution to a problem that doesn't exist. So I looked at the Chicago Manual of Style for enlightenment and found that, as expected, it didn't address the situation at all. But when I look closer, I see that there is indeed a sliver of space between doubled quotation marks, and these are not duplicated in my (ancient, to be sure) version of Word. I'm at 10.25-26 in the 14th edition.

The CSM gives this example, of a quote within a quote within a quote: “I eat what I see.”’” But on the printed page, there is a discernible (though just discernible) space between the single quote and the enclosing double quotes.

Later: Interestingly, after hitting Post, I can see the barest sliver between those sets of quotes. It's more than I see in Word (or pasted into this window) but still less than what I see in the CSM.
Spacing between letters is kerning.

Traditionally, this was the domain of the printer and font cutter. Certainly not the editor or writer, which is who the Chicago Manual is written for. They left that to those with inky fingers. It was a craft, not something codified in a manual.

These digital days the "typesetter" is often quite unaware of the typographic techniques and conventions that evolved over the centuries. And the first decades of digital type had very little input from typographers. And so we see straight quotemarks on book covers, slanted type masquerading as italic, and any number of other typographic faux pas on a daily basis. The tools to create fine typography are there in all the layout software, but are often ignored or misused.


The authoritative work in this field is The Elements of Typographic Style by Robert Bringhurst.
I can't find him pronouncing on the issue explicitly, but in his discussion of quotation marks he uses the illustration below, and there isn't a comma in that book he didn't personally approve. The space between the marks is clear.

I primarily work in print publishing, and long ago took an interest in fonts and was soon adjusting and adding kerns to the ones I used. When I noticed a spacing problem I would try to fix it by adjusting the font kerning table, then it would be automatically fixed every time that combination of characters came up. While with ebooks I've had to abandon a lot of the niceties I would apply to print, when possible I try to apply the same principles. And the mashing together of quotation marks is something that makes me wince in any medium.

In an ebook I generally leave the body text as the default, so each user can choose what suits his device. So I can't kern the fonts, even if it was supported by all the ebook readers.

After all the suggestions and info by others and my own experimentation, I found that my original solution, thinsp, works in most cases in epubs. But not readers using Qt4. Older versions of Calibre and Sigil in particular

<p>“&thinsp;‘Honeymoon


Letter-spacing, like :
<span style="letter-spacing:.166em">“</span>‘Honeymoon
works in Sigil and Calibre, but not in FBreader. And apparently is not officially supported in epub2.

Margins work in most cases too, but not in FBreader (which is a bit deficient in support for margin styles).
<p>“<span style="margin-left:0.166em">‘</span>Honeymoon
or
<p><span style="margin-right:0.166em">“</span>‘Honeymoon

I had the bright idea I could create a pseudo space character by :
<p>“<span style="margin-left:0.166em"/>‘Honeymoon

This works in Sigil, Calibre and Firefox, but not FBreader. And Sigil's "pretty print" clean on save would just delete it, apparently deciding it was a NOP. Not a good sign it would be left alone or honoured by other software.

I did find one method that works universally to create arbitrary spacing, by scaling a nbsp:
<p>“<span style="font-size:0.6em">&nbsp;</span>‘Honeymoon
The 0.6 factor gives a result close to thinsp.

So, I'll recall that if I need to do some odd spacing in the future, But for the original quotes, I'll revert to thinsp, as it turns out that the only problem is with the program (Calibre) I was using to preview it, not the other apps and readers.

It was educational, even if I ended up back where I started.
Attached Thumbnails
Click image for larger version

Name:	quotes.png
Views:	265
Size:	3.1 KB
ID:	138153  

Last edited by AlanHK; 05-10-2015 at 11:04 AM.
AlanHK is offline   Reply With Quote
Old 05-10-2015, 11:11 AM   #34
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by AlanHK View Post
In an ebook I generally leave the body text as the default, so each user can choose what suits his device. So I can't kern the fonts, even if it was supported by all the ebook readers.
Note that, by going through all the trouble of encoding the spacing in some other way, you are preventing those who have a properly kerned font installed and selected as default from actually using it.
Jellby is offline   Reply With Quote
Old 05-10-2015, 02:22 PM   #35
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Jellby View Post
Note that, by going through all the trouble of encoding the spacing in some other way, you are preventing those who have a properly kerned font installed and selected as default from actually using it.
If their font was properly kerned, what they'd see would be identical in either case.

And the 999 out of 1000 readers who don't have such a setup will get a layout without merged quotemarks.

So, win-win.
AlanHK is offline   Reply With Quote
Advert
Old 05-10-2015, 03:30 PM   #36
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by AlanHK View Post
The authoritative work in this field is The Elements of Typographic Style by Robert Bringhurst.
I agree, quite a good book, but he is wrong on sentence spacing though.

Quote:
Originally Posted by Jellby View Post
Note that, by going through all the trouble of encoding the spacing in some other way, you are preventing those who have a properly kerned font installed and selected as default from actually using it.
I agree. The span solution seems quite hackish to me. Reminds me of the ol' soft hyphen discussion, where hyphenation is best left to the devices themselves. The solution looks ok on the surface, but it would cause more pain in the long-run.

Hyphenation should be left to the hyphenation algorithm, kerning should be left to the font, and the text itself should be pure.

At least things have gotten better on this front since ~2011-2012:

https://www.mobileread.com/forums/sho...d.php?t=132182
https://www.mobileread.com/forums/sho...d.php?t=189487
Tex2002ans is offline   Reply With Quote
Old 05-10-2015, 03:54 PM   #37
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by AlanHK View Post
If their font was properly kerned, what they'd see would be identical in either case.
Only if your hardcoded spacing happens to match the kerning for the particular font, and only if the renderer doesn't add the kerning to the spacing (I'm not sure if there's any spec on how HTML/CSS elements should affect kerning). And this at the cost of possibly breaking searching, cluttering the code and maybe triggering other bugs (I think ADE will consider both sides of the <span> as valid hyphenation points).

Quote:
And the 999 out of 1000 readers who don't have such a setup will get a layout without merged quotemarks.
998 of them couldn't care less, just as they don't care about straight/curly quotes, punctuation inconsistently inside/outside italics, poor justification, ligatures, etc.

But don't misunderstand me, I don't mean the HTML/CSS way is wrong, only that it's not perfect and you should consider the cons as well as the pros to make your decision. And of course, as long as your decision is different from mine, I may try to convince you
Jellby is offline   Reply With Quote
Old 05-10-2015, 09:10 PM   #38
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Tex2002ans View Post
I agree. The span solution seems quite hackish to me. Reminds me of the ol' soft hyphen discussion, where hyphenation is best left to the devices themselves. The solution looks ok on the surface, but it would cause more pain in the long-run.

Hyphenation should be left to the hyphenation algorithm, kerning should be left to the font, and the text itself should be pure.

At least things have gotten better on this front since ~2011-2012:
Ideally it would be taken care of automatically. But I can't fix every font or every layout system.

I'm not going to go through a book and put spans between each pair of characters. In fact, only 5 in the entire book. This is just a small tweak that fixes a small problem.

As for "hackish"... I guess you've never looked at the code of the average commercial ebook. Or one produced by a Calibre conversion. I have spent hours cleaning up stupid code and endless nested spans that negate each other. Sometimes an ebook can be reduced by 20% or more just by simplifying the code with a bunch of S&R.

The tiny bit of code I add is functional. But how it looks on the page/screen is the only real test, and I think this looks better.


Quote:
Originally Posted by Jellby View Post
Only if your hardcoded spacing happens to match the kerning for the particular font, and only if the renderer doesn't add the kerning to the spacing (I'm not sure if there's any spec on how HTML/CSS elements should affect kerning). And this at the cost of possibly breaking searching, cluttering the code and maybe triggering other bugs (I think ADE will consider both sides of the <span> as valid hyphenation points).
If the font kerning doesn't match my hard coded spacing, then by replacing it I've improved it.
It's not going to break searching, unless you are search for a pair of nested quotemarks. As I got it, the text had a singel spce between them anyway, so its no less searchable.

I hope the hyphenation isn't idiotic enough to put a hyphen between two quotemarks.


Quote:
Originally Posted by Jellby View Post
998 of them couldn't care less, just as they don't care about straight/curly quotes, punctuation inconsistently inside/outside italics, poor justification, ligatures, etc.

But don't misunderstand me, I don't mean the HTML/CSS way is wrong, only that it's not perfect and you should consider the cons as well as the pros to make your decision. And of course, as long as your decision is different from mine, I may try to convince you
Of course its not "perfect". I considered a dozen alternatives and chose the least imperfect. Doing nothing is cleaner code but worse typography.
AlanHK is offline   Reply With Quote
Old 05-11-2015, 03:25 AM   #39
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by AlanHK View Post
If the font kerning doesn't match my hard coded spacing, then by replacing it I've improved it.
What? Do you suggest that your single "0.166em" space (or whatever) is the best possible spacing for all and every font? I beg to differ

Quote:
I hope the hyphenation isn't idiotic enough to put a hyphen between two quotemarks.
I had the same hope when I was younger I've see hyphenations before question marks and after opening quote marks, and I mean real hyphenation, not just a linebreak. Of course the same could happen if you had the quote marks with nothing between them, but having a span boundary between the quote marks increases the chances of something like this happening.

Just an example of how some things that can go wrong:

Code:
some line with <a name="p123"/>an empty element

some line with<a name="p123"/> an empty element
They should be the same, right? Well, it turns out in ADE a line break can happen right after the <a>, and in the first case the preceding space is not discarded, resulting in a line with a visible space at the right margin (if justified). Ebook renderers are much more idiotic than we would like.
Jellby is offline   Reply With Quote
Old 05-11-2015, 03:56 AM   #40
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Jellby View Post
What? Do you suggest that your single "0.166em" space (or whatever) is the best possible spacing for all and every font? I beg to differ
It's better than nothing, which is the default in every font I've looked at (except, presumably, yours).
I haven't seen an alternative that is widely supported.

Quote:
Originally Posted by Jellby View Post

I had the same hope when I was younger I've see hyphenations before question marks and after opening quote marks, and I mean real hyphenation, not just a linebreak. Of course the same could happen if you had the quote marks with nothing between them, but having a span boundary between the quote marks increases the chances of something like this happening.
Fine, you can run your quotemarks together for fear of rogue hyphenation. I'll separate them and take the risk.

Last edited by AlanHK; 05-11-2015 at 08:02 AM.
AlanHK is offline   Reply With Quote
Old 05-11-2015, 06:45 AM   #41
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
When I was at university, I spent every Wednesday afternoon at the print shop, laying out the student paper on the block. I never ran into this question! Perhaps the linotypists, like the Chicago Manual of Style, felt it wasn't necessary for my education. Or perhaps they'd never encountered quotes-within-quotes.

Out of curiosity, I looked at my most recent e-book to see whether it contained any instance of quote-within-quote. It doesn't, but I did discover several straight apostrophes instead of &rsquo;s! I will fix them when I get back from the gym.
Notjohn is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 03:52 PM.


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