Disabling hypenation in ebooks

br
bruno
Posts: 3
Joined: Fri Jun 14, 2019 8:53 am
Platform: Mac

Fri Jun 14, 2019 9:03 am Post

Hello,
I'm trying to compile an ebook in ePub format. The original text doesn't contain any hypenation.
I've opened it in Calibre and it looks perfect, but in the Apple Books app hypenation is enabled - and most words are hypenated in the wrong way!
I've fixed this by putting "hypens: none" in the CSS file, buy I was wondering if there is a better way to control this directly from Scrivener? I was unable to find anything about this in the manual.

Thanks,
Bruno Del Frate

User avatar
AmberV
Posts: 22954
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Fri Jun 14, 2019 10:11 am Post

I’ve fixed this by putting “hypens: none” in the CSS file, buy I was wondering if there is a better way to control this directly from Scrivener? I was unable to find anything about this in the manual.


You definitely can handle this from Scrivener’s side of things, and that general approach is documented in §24.7, CSS:

  1. In the compile overview screen, double-click on your compile Format in the left sidebar to edit it.
  2. Go into the CSS pane, and first make sure “Append Custom CSS Stylesheet” is set (it should be by default).
  3. Add the following CSS to the left column:

    Code: Select all

    p { -webkit-hyphens: none; hyphens: none; }

That should do it. It’s also worth noting that whether or not hyphenation is used by Books is a reader preference, in the General pane. Generally I am a proponent of leaving these decisions up to the reader, and by forcing the matter with CSS you’re removing the reader’s choice in the matter. You’re also reducing the quality of the type if the reader prefers full justification. They’ll get unsightly gaps between words and such.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

br
bruno
Posts: 3
Joined: Fri Jun 14, 2019 8:53 am
Platform: Mac

Sun Jun 16, 2019 8:49 am Post

Thanks for your reply, AmberV.
That's what I already did, but I was just wondering if there was a way to edit language and hypenation options somewhere in the Scrivener settings, instead of having to edit CSS files.
I agree, disabling hypenation isn't the best choice, but I'm still unable to get my whole text hypenated without errors.
As my book is written in Italian language, perhaps I have to specify this somewhere in Scrivener, so correct hypenation rules can be applied?

Here's an example: correct spelling for the underlined word should be "consape-volezza".

Schermata 2019-06-16 alle 10.43.32.png
Schermata 2019-06-16 alle 10.43.32.png (43.79 KiB) Viewed 12 times


Thanks,
Bruno Del Frate

br
bruno
Posts: 3
Joined: Fri Jun 14, 2019 8:53 am
Platform: Mac

Sun Jun 16, 2019 9:16 am Post

I think I've found the solution. In my ebook metadata, I just had to type "it" in the language code field and recompile the ebook: this fixed all the hypenation errors! :-)