Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-15-2016, 01:11 AM   #1
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Preventing hyphenation in chapter titles?

I'm doing a number of books that have chapter titles and I'd like to prevent those from getting automatically hyphenated while leaving the main text alone. My understanding is that one can use the following properties in the stylesheet for the chapter header:

Code:
-webkit-hyphens: none !important;
-epub-hyphens: none !important;
-moz-hyphens: none !important;
adobe-hyphenate: none !important;
BUT ... whenever I use the adobe-hyphenate property, my stylesheet will no longer validate with the W3C validator! That doesn't seem like a good thing!

So should I use this property or not? And if I don't, will I get hyphenation of chapter titles on readers using the Adobe engine?

Confused beginner!
graycyn is offline   Reply With Quote
Old 11-15-2016, 03:52 PM   #2
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
You will need to use adobe-hyphenate: none; if you want to turn off the automatic hyphenation on Adobe-based readers.

Edit: The W3C validator is a useful tool for picking up spelling mistakes in CSS, because it will report a typo like text-algin:justify; as an error. But there is no way for it to tell the difference between a misspelt known property and a correctly-spelt unknown property like adobe-hyphenate.

Last edited by GeoffR; 11-15-2016 at 04:35 PM. Reason: The W3C validator ...
GeoffR is offline   Reply With Quote
Advert
Old 11-15-2016, 05:28 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
WHat does epubcheck say about this?
JSWolf is offline   Reply With Quote
Old 11-15-2016, 06:32 PM   #4
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Quote:
Originally Posted by GeoffR View Post
You will need to use adobe-hyphenate: none; if you want to turn off the automatic hyphenation on Adobe-based readers.

Edit: The W3C validator is a useful tool for picking up spelling mistakes in CSS, because it will report a typo like text-algin:justify; as an error. But there is no way for it to tell the difference between a misspelt known property and a correctly-spelt unknown property like adobe-hyphenate.
So essentially it's perfectly safe to use, but I'll have to accept that the CSS isn't going to pass validation? I guess I can live with that, just irks my perfectionist tendencies....

Thanks for confirming!



Sent from my Nexus 9 using Tapatalk
graycyn is offline   Reply With Quote
Old 11-15-2016, 06:49 PM   #5
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Quote:
Originally Posted by JSWolf View Post
WHat does epubcheck say about this?
Epubcheck seems fine with it! So I guess I'll run with it. Just want to get it as good as I can. Have run the CSS through CSSLint, that's all good too.

Works on my oldest reader Sony PRS-350, fine in ADE, great with Google Play books, seems to open and display OK in most popular Android reading apps, though some clearly have less CSS support than others. I can't test on iBooks, don't own any iDevices.




Sent from my Nexus 9 using Tapatalk
graycyn is offline   Reply With Quote
Advert
Old 11-15-2016, 07:09 PM   #6
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
There is also just plain ol':

hyphens: none;
Tex2002ans is offline   Reply With Quote
Old 11-16-2016, 09:50 PM   #7
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Turns out hyphens: none also triggered an error warning from the W3C validator. So I took that AND the adobe-hyphenate COMPLETELY OUT and stress tested the book by putting it on my Sony PRS-350 with font at XXL. No chapter titles got hyphenated.

Then I uploaded it to Play Books and cranked font to 700% ... that wasn't exactly pretty, but NO chapter titles hyphenated.

So I believe for practical purposes, using just the webkit, epub and moz properties will be fine without anything else. I know the stylesheets will validate with those and if 700% font size didn't cause something to hyphenated, can't imagine much would in practical use.

Sent from my Pixel C using Tapatalk
graycyn is offline   Reply With Quote
Old 11-17-2016, 01:44 AM   #8
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
If you are using centred or left-aligned text for your headers then you are probably okay to do without adobe-hyphenate with current Adobe readers, but I wouldn't rely on it as the hyphenation behaviour has changed from version to version.

Last edited by GeoffR; 11-17-2016 at 02:12 AM. Reason: ... or left-aligned ...
GeoffR is offline   Reply With Quote
Old 11-17-2016, 02:40 AM   #9
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Quote:
Originally Posted by GeoffR View Post
If you are using centred or left-aligned text for your headers then you are probably okay to do without adobe-hyphenate with current Adobe readers, but I wouldn't rely on it as the hyphenation behaviour has changed from version to version.
In this instance it was left aligned headers. I didn't realize the hyphenation behavior was changing version to version, but I'll keep that in mind, thanks!

Sent from my Nexus 9 using Tapatalk
graycyn is offline   Reply With Quote
Old 11-17-2016, 03:22 AM   #10
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 graycyn View Post
BUT ... whenever I use the adobe-hyphenate property, my stylesheet will no longer validate with the W3C validator! That doesn't seem like a good thing!

[...]

Turns out hyphens: none also triggered an error warning from the W3C validator.
Is it an ERROR, or is it a WARNING?

What exactly is the Validator saying and what are the settings you are using? If you press on the More Options button in the Validator, you can see more detailed settings (Profile, Vendor Extensions, [...]).

In CSS, it doesn't hurt if the parser runs across properties it doesn't understand. A device that only understands CSS2 and runs across CSS3 "hyphens: none" should ignore it + do absolutely nothing with that information, then just move on.

What you should look out for though is a serious blunder, like a missing/extra ; or {}. ADE absolutely chokes and throws away the entire CSS file if there is any sort of parsing error in the CSS.

Quote:
Originally Posted by graycyn View Post
So I believe for practical purposes, using just the webkit, epub and moz properties will be fine without anything else. I know the stylesheets will validate with those and if 700% font size didn't cause something to hyphenated, can't imagine much would in practical use.
  • -webkit-hyphens: none;
    • This applies to any Webkit-based reader (iBooks/Safari, Chrome [I assume Google Play Books is using?], Sigil, Calibre, [...]).
    • Note: Chrome 55 should be finally be introducing the unprefixed hyphens property.
    • Note #2: In Sigil and Calibre you will see zero difference, since their webviewers currently don't implement automatic hyphenation anyway. :P
  • -moz-hyphens: none;
    • This applies to any Mozilla-based renderer (Firefox).
    • Note: Around Firefox 43, Mozilla changed to the unprefixed hyphens property.
  • -ms-hyphens: none;
    • This applies to IE/Edge.
  • -epub-hyphens: none;
  • adobe-hyphenate: none;
    • This is an Adobe-specific recommendation for ADE/RMSDK-based readers (all the older EPUB2 readers, Nook, Bluefire, [...]).
  • hyphens: none;
    • This is the actual CSS3 method of specifying no hyphenation.

Last edited by Tex2002ans; 11-17-2016 at 02:13 PM.
Tex2002ans is offline   Reply With Quote
Old 11-17-2016, 06:11 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by graycyn View Post
Works on my oldest reader Sony PRS-350
You cannot use Sony Readers to test hyphenation. They don't support hyphenation so they wont ever hyphenate. The version of ADE used is either too old or Sony chose not to support hyphenation.
JSWolf is offline   Reply With Quote
Old 11-17-2016, 03:47 PM   #12
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Quote:
Originally Posted by JSWolf View Post
You cannot use Sony Readers to test hyphenation. They don't support hyphenation so they wont ever hyphenate. The version of ADE used is either too old or Sony chose not to support hyphenation.
OK, that's good to know! However, I also used my Kobo Aura HD with font size and margins at maximum and that was OK as well.

Sent from my Pixel C using Tapatalk
graycyn is offline   Reply With Quote
Old 11-17-2016, 03:52 PM   #13
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Quote:
Originally Posted by Tex2002ans View Post
Is it an ERROR, or is it a WARNING?

What exactly is the Validator saying and what are the settings you are using? If you press on the More Options button in the Validator, you can see more detailed settings (Profile, Vendor Extensions, [...]).

In CSS, it doesn't hurt if the parser runs across properties it doesn't understand. A device that only understands CSS2 and runs across CSS3 "hyphens: none" should ignore it + do absolutely nothing with that information, then just move on.

What you should look out for though is a serious blunder, like a missing/extra ; or {}. ADE absolutely chokes and throws away the entire CSS file if there is any sort of parsing error in the CSS.


  • -webkit-hyphens: none;
    • This applies to any Webkit-based reader (iBooks/Safari, Chrome [I assume Google Play Books is using?], Sigil, Calibre, [...]).
    • Note: Chrome 55 should be finally be introducing the unprefixed hyphens property.
    • Note #2: In Sigil and Calibre you will see zero difference, since their webviewers currently don't implement automatic hyphenation anyway. :P
  • -moz-hyphens: none;
    • This applies to any Mozilla-based renderer (Firefox).
    • Note: Around Firefox 43, Mozilla changed to the unprefixed hyphens property.
  • -ms-hyphens: none;
    • This applies to IE/Edge.
  • -epub-hyphens: none;
  • adobe-hyphenate: none;
    • This is an Adobe-specific recommendation for ADE/RMSDK-based readers (all the older EPUB2 readers, Nook, Bluefire, [...]).
  • hyphens: none;
    • This is the actual CSS3 method of specifying no hyphenation.
I'm not home right now, so I can't check and see what it said, but what I remember is that the W3C validator objected to hyphens: none; because it was CSS 3 and the rest was CSS 2.1? Something like that.

Sent from my Pixel C using Tapatalk
graycyn is offline   Reply With Quote
Old 11-17-2016, 04:58 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by graycyn View Post
OK, that's good to know! However, I also used my Kobo Aura HD with font size and margins at maximum and that was OK as well.

Sent from my Pixel C using Tapatalk
If you are using the hyphenation dictionary that comes with the firmware, that's fairly useless as well because the settings in the hyphenation dictionary are set too high.

LEFTHYPHENMIN 5
RIGHTHYPHENMIN 5

That means you won't get hyphens unless the line can handle 6 characters (including the hyphen). Also, words won't hyphen if they are less than 5 to the left & right of the hyphen. I found a hyphenation dictionary that works very well and set the options to allow more hyphenation and less craters (gaps). Install it and try your ePub again.

https://www.mobileread.com/forums/sho...d.php?t=252405
JSWolf is offline   Reply With Quote
Old 11-18-2016, 11:00 AM   #15
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
Quote:
Originally Posted by JSWolf View Post
You cannot use Sony Readers to test hyphenation. They don't support hyphenation so they wont ever hyphenate. The version of ADE used is either too old or Sony chose not to support hyphenation.
the Sony t3 hyphenates - badly, usually.

leastways the one I used to own did. Annoyed the hell out of me, but then it broke anyway
T3 used a newer version of ADE than the T1, T2 did
stumped is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter #s or Chapter Titles? bmcox Writers' Corner 33 02-01-2013 07:03 AM
Prevent titles hyphenation in iPad and iPhone fante1998 ePub 0 02-24-2012 05:43 AM
Ebook chapter titles: with or without chapter number? amoroso Writers' Corner 16 06-14-2011 06:35 AM
PRS-350 Breaks after Chapter Titles Rand Brittain Sony Reader 2 10-25-2010 12:53 PM


All times are GMT -4. The time now is 02:04 AM.


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