11-01-2021, 03:19 PM | #1 |
Junior Member
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! |
11-01-2021, 03:58 PM | #2 |
A Hairy Wizard
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!! |
Advert | |
|
11-01-2021, 05:41 PM | #3 |
Bookmaker & Cat Slave
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 |
11-01-2021, 05:44 PM | #4 |
Resident Curmudgeon
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.
|
11-02-2021, 04:34 AM | #5 | |||
Junior Member
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: none
|
Thank you to all of you for the replies!
Quote:
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:
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:
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. |
|||
Advert | |
|
11-02-2021, 12:34 PM | #6 |
Bookmaker & Cat Slave
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 |
11-02-2021, 02:45 PM | #7 |
Resident Curmudgeon
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?
|
11-02-2021, 03:23 PM | #8 |
the rook, bossing Never.
Posts: 11,586
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
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.
|
11-03-2021, 04:36 AM | #9 |
Junior Member
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 :-) |
11-03-2021, 12:58 PM | #10 | ||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Exactly. 99% of the time, it's Soft Hyphens:
Soft hyphens! Can you open the book in Sigil and press Tools > Reports > Characters in HTML Files: 1. Does your EPUB have the "soft hyphen" listed anywhere? 2. Does it have any other hyphen-like characters?
or (odd) hyphen characters?
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:
(Best to just strip all CSS hyphens completely, then leave it up to the device/reader.) Quote:
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:
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. |
||||
11-04-2021, 02:23 PM | #11 | ||||
Junior Member
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: none
|
Quote:
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:
Quote:
Quote:
Thanks! |
||||
|
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 |