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-01-2021, 03:19 PM   #1
red_scharlach
Junior Member
red_scharlach began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: none
Hyphenation not working on epub 2

Hi, there,

I'm creating an epub 2. Source file was InDesign, I've exported as html as usual, tuned the code, applied my regular css I've used on other books of the same collection and finished the book with Sigil.

In my e-books, I set the hyphenation of regular paragraphs in "auto", like this:

p {
hyphens: auto;
}

And I set it to "none" on the elements I don't want to hyphenate

However, this time hyphenation is not working as usual and that's driving me nuts. The EPUB is exactly as the other ones I've made before, but, this time, on the Sigil (and also Dreamweaver) previsualization of the html file I'm getting a square character instead of the hyphen:



And when I open the EPUB on Apple iBooks and Adobe Digital Editions, hyphenation is not working at all on regular <p>, as if it was set to "none".

Any idea why this may be happening?

I hope someone can help me!
Thanks!
red_scharlach is offline   Reply With Quote
Old 11-01-2021, 03:58 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,119
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I am certainly not an expert on hyphens - I don't use them, I prefer ragged-right. But boxes, or other symbols like that, usually happen when the symbol it is trying to use is not supported by the font.

I would start by removing any custom font, and just use a standard/default one. If that doesn't fix it, I would test by changing the language settings you are using. Perhaps the language is trying to use a non-standard hyphen symbol??

edit:

Welcome to MR!!
Turtle91 is offline   Reply With Quote
Advert
Old 11-01-2021, 05:41 PM   #3
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,463
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
So, do I understand that you mean to say that you turn hyphens off on specific Words? Is that right?

Hitch
Hitch is offline   Reply With Quote
Old 11-01-2021, 05:44 PM   #4
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: 74,570
Karma: 129670952
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Remove all CSS code that has to do with hyphens. See if it works.
JSWolf is offline   Reply With Quote
Old 11-02-2021, 04:34 AM   #5
red_scharlach
Junior Member
red_scharlach began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: none
Thank you to all of you for the replies!

Quote:
Originally Posted by JSWolf View Post
Remove all CSS code that has to do with hyphens. See if it works.
Hi, JSWolf!

Done it, and without that code the book has no hyphens at all (and no squares instead of hyphens), but that's not what i want to get!

Quote:
Originally Posted by Hitch View Post
So, do I understand that you mean to say that you turn hyphens off on specific Words? Is that right?

Hitch
Hi, Hitch!

No, regular <p> are supposed to be justified and with automatic hyphenation, but instead of a hyphen I'm getting that square character (previewing the html file in Sigil and Dreamweaver) or no hyphenation at all (opening the epub in Ibooks and ADE).
There are other elements (like h1, h2...) where I set hyphenation to "none".


Quote:
Originally Posted by Turtle91 View Post
I am certainly not an expert on hyphens - I don't use them, I prefer ragged-right. But boxes, or other symbols like that, usually happen when the symbol it is trying to use is not supported by the font.

I would start by removing any custom font, and just use a standard/default one. If that doesn't fix it, I would test by changing the language settings you are using. Perhaps the language is trying to use a non-standard hyphen symbol??

edit:

Welcome to MR!!
Hi Turtle!
The language settings are not the problem. Text is in spanish and is declared properly on the <html> line at the beggining of each file.

Regarding the fonts, I have no embedded fonts in the epub, I always try to avoid them to keep it simple and having no issues with licensing. I only specify preferred fonts, like this:

body {
font-family: Cambria, Horley, Athelas, Times, serif;
}

I've tried to remove this line from the CSS and this had no effect on the problem with hyphens, square characters still there.

However, I've noticed that there are a couple of sections on the epub where hyphenation was working properly. For these sections I have a different set of preferred fonts:

.creditos {
font-family: Arial, Helvetica, sans-serif;
}

I tried to apply this set to the whole body and... it works!

I have no idea why this is happening. I've done dozens of epubs from this same publisher, and the CSS and the structure of the HTML I had in this one were the same as in the previous ones. In the old ones, preferred font sets were the same I had in this one and they worked flawlessly.

My guess is that the problem has something to do with text encoding and that it probably comes from the original source in InDesign. The only variable with this book compared with the previous ones was that the designer of the paper version was a different person and he does some weird things in InDesign I've had to deal with, maybe there was something strange with text encoding in the InDesign file that was affecting the html export. But I'm not an expert in InDesign, so I don't know how to check it.
red_scharlach is offline   Reply With Quote
Advert
Old 11-02-2021, 12:34 PM   #6
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,463
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Could it be--is it possible--that the print designer used a unique character for the dash? Rather than the usual, plain-old, vanilla, boring dash?

What's the encoding or the UTF-8 address of the character? Is it a dash/minus, or an emdash, endash or something else?

Hitch
Hitch is offline   Reply With Quote
Old 11-02-2021, 02:45 PM   #7
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: 74,570
Karma: 129670952
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Can you post a sample of the ePub so we can take a look at it?
JSWolf is offline   Reply With Quote
Old 11-02-2021, 03:23 PM   #8
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,586
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Hitch View Post
What's the encoding or the UTF-8 address of the character? Is it a dash/minus, or an emdash, endash or something else?
Someone once used a unicode minus instead of dash for hyphen. How they managed to type it? It won't display in some fonts and also rendering, if there are no spaces, won't line-break at it! It looks the same on many fonts.
Quoth is offline   Reply With Quote
Old 11-03-2021, 04:36 AM   #9
red_scharlach
Junior Member
red_scharlach began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: none
Hi again to everyone,

After doing more testing and being unable to find out what was going on, I've tried to check the epub on another computer. I borrowed the Macbook of a colleague and... it's working ok there! After noticing that, I've opened my old epubs in my Mac and they are behaving exactly as the one I was producing now, with the square character instead of regular dash for hyphen, and they work fine on my colleague's Mac.

So mistery solved, the problem is not in the epub, but in my computer... Now I have to find out what happens to my Mac, some weeks ago, when I produced the last epubs before the one I was doing now, everything was fine. But that's another problem.

Thank you to all for your help, this forum rocks! I already knew it cos I've been a silent reader for years, but now I can confirm it :-)
red_scharlach is offline   Reply With Quote
Old 11-03-2021, 12:58 PM   #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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Hitch View Post
Could it be--is it possible--that the print designer used a unique character for the dash? Rather than the usual, plain-old, vanilla, boring dash?


Exactly.

99% of the time, it's Soft Hyphens:
  • Odd/phantom hyphenation?
  • Red squigglies in correctly spelled words?
  • Blank squares (or question marks) appearing randomly in your words?
  • Search not working correctly?

Soft hyphens!

Quote:
Originally Posted by red_scharlach View Post
Any idea why this may be happening?
Can you open the book in Sigil and press Tools > Reports > Characters in HTML Files:

Click image for larger version

Name:	Sigil.-.Characters.Report.-.Soft.Hyphens.png
Views:	267
Size:	8.0 KB
ID:	190008

1. Does your EPUB have the "soft hyphen" listed anywhere?

2. Does it have any other hyphen-like characters?
  • – (U+2013) = EN DASH
  • — (U+2014) = EM DASH
  • − (U+2212) = MINUS SIGN

or (odd) hyphen characters?
  • ‐ (U+2010) = HYPHEN
  • ‑ (U+2011) = NON-BREAKING HYPHEN

Side Note: First time ever coming across those two in the wild... Latest ebook I was reading hyphenated very oddly on my phone... showing up as "random" question marks.

They used HYPHEN (U+2010) instead of the plain ol' HYPHEN-MINUS (U+002D) (the one on your keyboard).

Turns out, many fonts don't have that character (~1/2 on my computer have it).

Aaaaand as I read red_scharlach's responses to JSWolf+others... I'm suspecting that may be the issue here.

Quote:
Originally Posted by red_scharlach View Post
In my e-books, I set the hyphenation of regular paragraphs in "auto", like this:

p {
hyphens: auto;
}
There's no need to specify hyphens, unless you overwrote it someplace else.

(Best to just strip all CSS hyphens completely, then leave it up to the device/reader.)

Quote:
Originally Posted by red_scharlach View Post
And I set it to "none" on the elements I don't want to hyphenate
Don't do that in ebooks. It's a poor idea.

Remember, readers can be reading on HUGE FONTS on very skinny/small devices (think cellphone). Disabling hyphenation only gets in the way.

The best example is: "Acknowledgments".

Imagine that heading, unbroken, in huge font, on a cellphone.

For more info, see the great 2018 article: EPUBSecrets.org: "User Experience: What Works, and How?"

Quote:
Originally Posted by Quoth View Post
Someone once used a unicode minus instead of dash for hyphen. How they managed to type it? It won't display in some fonts and also rendering, if there are no spaces, won't line-break at it! It looks the same on many fonts.
Yes, that minus-signs-instead-of-hyphens was a "famous" one... creating hell for Text-to-Speech.

I referenced it quite a few times over the years.

That ebook got taken down way back in 2014.

* * *

Side Note: In Print, all readers see is the surface result. Typographers control exactly where things land on the page + control the font/font-size. Authors/designers can also get away with gibberish (wrong characters + hacks), as long as it "looks okay".

But in Ebooks, the underlying text/code—not just the surface—matters. Readers can be reading on all different devices (large monitors, cellphones) + in completely different ways (Text-to-Speech, Night Mode, HUGE font size, all different fonts), so you have to remove those hacks + use the proper characters.

You used MINUS SIGN instead of a hyphen? Text-to-Speech will be saying "minus" in the middle of your words.

You forced black text? Sure, your Print book will look fine (since it's on white paper), but your ebook will be black-on-black text when the reader puts on Night Mode.

Marked your language wrong? Text-to-Speech will pronounce things wrong, you'll get red squigglies, and auto-hyphenation will be busted.

"Symbol" font + using "abcd" for all your Greek characters? That will become gibberish in an ebook. Use the proper Unicode characters: αβγδ.

Images of characters instead of the actual characters? The second the reader changes colors or raises the font size, it'll explode.

Scenebreaks as a blank gap between paragraphs? No good in ebooks. New scenes may fall on the exact top/bottom of a screen, (and users may override your CSS), so it's best to use a visible mark instead.

Last edited by Tex2002ans; 11-03-2021 at 07:10 PM.
Tex2002ans is offline   Reply With Quote
Old 11-04-2021, 02:23 PM   #11
red_scharlach
Junior Member
red_scharlach began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: none
Quote:
Originally Posted by Tex2002ans View Post


Exactly.

99% of the time, it's Soft Hyphens:
  • Odd/phantom hyphenation?
  • Red squigglies in correctly spelled words?
  • Blank squares (or question marks) appearing randomly in your words?
  • Search not working correctly?

Soft hyphens!
Hi! Now I'm 99% sure that the problem is my computer, as I've said I checked the epub in Sigil on another computer and it was working fine, and lately I've been having problems with other software on my Mac, so I think there may be something bad with it. This weekend I will reinstall MacOs to check it up.

However, if the problem were the soft hyphens, shouldn't I see them in the code, with the "shy" entity or similar? My code is clean, I have no undesired entities there.

Quote:
Originally Posted by Tex2002ans View Post
Can you open the book in Sigil and press Tools > Reports > Characters in HTML Files:

Attachment 190008

1. Does your EPUB have the "soft hyphen" listed anywhere?

2. Does it have any other hyphen-like characters?
  • – (U+2013) = EN DASH
  • — (U+2014) = EM DASH
  • − (U+2212) = MINUS SIGN

or (odd) hyphen characters?
  • ‐ (U+2010) = HYPHEN
  • ‑ (U+2011) = NON-BREAKING HYPHEN
I had already checked this and there's nothing strange in the report, just one (U+2013) = EN DASH that is ok as it's used.


Quote:
Originally Posted by Tex2002ans View Post
There's no need to specify hyphens, unless you overwrote it someplace else.

(Best to just strip all CSS hyphens completely, then leave it up to the device/reader.)
But if I have the text justified (as the customer requires), it is not a better idea to set hyphening on as default to avoid some lines being too opened?

Quote:
Originally Posted by Tex2002ans View Post
Don't do that in ebooks. It's a poor idea.

Remember, readers can be reading on HUGE FONTS on very skinny/small devices (think cellphone). Disabling hyphenation only gets in the way.

The best example is: "Acknowledgments".

Imagine that heading, unbroken, in huge font, on a cellphone.

For more info, see the great 2018 article: EPUBSecrets.org: "User Experience: What Works, and How?"
Yes, I'm aware of that, that's why I keep heading's font not to big and I also check the epubs on a very narrow screen (300px wide) to make sure there are no problem with headings unbroken. I think the chances of somebody having a problem like that as I design the epubs are so small that don't make up for the ugliness of finding broken headings for almost every user. But I certainly will think about it.

Thanks!
red_scharlach is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura epub, kepub, hyphenation and word-spacing pblasi Kobo Reader 5 08-22-2014 05:13 AM
Hyphenation issue with epub bebraw Calibre 2 06-06-2014 05:55 AM
Hyphenation not working with kepubs Anak Kobo Reader 9 08-12-2013 06:22 PM
Coolreader Epub support: CSS and hyphenation tuxor Onyx Boox 6 03-27-2012 09:18 AM
EPUB to MOBI hyphenation using Calibre nargyris Kindle Formats 2 02-04-2011 05:33 PM


All times are GMT -4. The time now is 02:26 PM.


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