Geschützter Bindestrich (0x2011) wird nicht in umfliessbares EPUB exportiert

New Here ,
May 30, 2022 May 30, 2022

Copy link to clipboard

Copied

Der geschützte Bindestrich soll einen Zeilenumbruch nach dem Strich verhindern, z.B. soll bei "Haustüren und -tore" der Strich nicht allein am Zeilenende stehen. Tippe ich einen solchen Bindestrich  (non-breaking Hyphen) mit Ctrl+Alt+-, dann zeigt InDesign ihn richtig an, aber als "Ersetzte Glyphe" mit gelber Markierung. InDesign behandelt den Strich korrekt, er bleibt immer beisammen mit "tore", aber exportiert wird nur ein ganz gewöhnlicher Bindestrich anstatt "‑" und der bleibt im EPUB bei Umbruch einsam am Zeilenende stehen.

Dies passiert nicht nur bei der Schrift "Stempel Garamond LT OT", die das erforderliche Zeichen (0x2011) tatsächlich nicht enthält; ich habe es auch mit der Arial, Times New Roman und Minion Pro versucht – überall die gleiche gelbe Markierung "Ersetzte Glyphe" und im umfliessbaren EPUB nur ein gewöhnlicher Bindestrich. Ich habe es mit InDesign 2020 und 2022 versucht – überall dasselbe.

Was läuft hier falsch? Was muss ich tun, um den geschützten Bindestrich als non-breaking Hyphen (‑) ins EPUB zu bringen?

TOPICS
EPUB

Views

77

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , May 31, 2022 May 31, 2022
Tested on my end. The regular hyphen, discretionary hyphen, en-dash and em-dash all export as correct glyphs. The nonbreaking hyphen is converted to a regular hyphen. I would regard this as a bug. There is no reason for InDesign to convert this character, but it clearly is doing so. I then edited the XHTML file and put ‑ in place of each hyphen in a long test paragraph. Thorium respects its 'no break' characteristic. Interestingly, though, Kindle Previewer does not. As Thorium is for...

Likes

Translate

Translate
Adobe Community Professional ,
May 30, 2022 May 30, 2022

Copy link to clipboard

Copied

InDesign should handle the non-breaking hyphen in all standard fonts. If you are seeing a replacement glyph, it is most likely the fault of the font.

 

Although EPUB is basically HTML/CSS/web format, some readers are selective in what character set they support. Some may simply not support the upper ASCII and Unicode characters, or not a full set of them.

 

EPUB readers often want to manage their own hyphenation (along with base font sizes and line spacing) and will override or ignore such elements in a document. I have not experimented with non-breaking hyphens, so I can't say if they are supported in Thorium and Kindle Previewer, my benchmark readers.

 

If you are seeing a proper hyphen glyph for a non-breaking hyphen in InDesign, you can examine the contents of the EPUB (use any ZIP file tool to open it) to see if the correct character is in place in the XHTML content file.

 

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2022 May 31, 2022

Copy link to clipboard

Copied

Thanks for your quick reply. But it's not the EPUB reader's fault that the EPUB only shows a normal hyphen instead of the non-breaking hyphen. I can see in the Calibre editor which hyphen InDesign is exporting. In all fonts the non-breaking space is  correctly exported as " " and in all fonts the nonbreaking hyphen is NOT exported as "‑"

So:

"Haustüren[non-breaking space]und [non-breaking hyphen]tore" is exported as: "Haustüren und -tore"

 Same with the Cambria font. For Cambria, InDesign shows the nonbreaking hyphen without the yellow "Replaced Glyph" marker, but again just a regular hyphen instead of "‑" is exported.

I have now deleted all fonts in Windows and reinstalled them according to the instructions "Adobe Fonts: Beheben Sie Schriftprobleme". That didn't help either!

Now all I can do is replacing all those wrong hyphens to "‑"with Calibre? Is there no other way to fix this InDesign error?

Thanks for your help.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 31, 2022 May 31, 2022

Copy link to clipboard

Copied

Tested on my end. The regular hyphen, discretionary hyphen, en-dash and em-dash all export as correct glyphs. The nonbreaking hyphen is converted to a regular hyphen.

 

I would regard this as a bug. There is no reason for InDesign to convert this character, but it clearly is doing so.

 

I then edited the XHTML file and put ‑ in place of each hyphen in a long test paragraph. Thorium respects its 'no break' characteristic. Interestingly, though, Kindle Previewer does not.

 

As Thorium is for many of us the benchmark EPUB reader, it indicates that there is no good basis for InDesign to make this change. A bugfix/feature request is definitely in order here. (I will follow up with that after this post.)

 

If you absolutely must have nonbreaking behavior from an InDesign export, I see two methods. One would be to replace those glyphs with the correct code. You might find it easiest if you use an odd character in the document instead of a hyphen; perhaps a string like #!# that can be search-and-replaced in the XHTML. The tilde (~) might make a good compact substitute if you do not otherwise use it in the document.

 

(I don't much like the EPUB editing/management tools. I would extract the XHTML and edit it with a basic code editor instead. But use whichever method is comfortable for you.)

 

The other is to use a CSS style. Apply an InDesign character style across both words and the hyphen. It can be a null style (doing nothing). Name it NOBREAK or something similar. Then, in CSS, use the following code:

 

 

span.NOBREAK {
white-space:nowrap;
}

 

 

That forced no breaks in both Kindle Previewer and Thorium even though the hyphen had been replaced. You might use color codes to make it easier to use (apply a color in the InDesign style; remove it in the CSS definition).

 

Unfortunately, the InDesign character setting "No Break" is not honored in the export. That would just be too easy.

 

ETA: posted as requested bug fix.

 

|| Word & InDesign to Kindle (& EPUB): a Professional Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2022 Jun 01, 2022

Copy link to clipboard

Copied

LATEST

Many Thanks for Testing and for your proposed solution with CSS. You’ve made my day.

Somehow comforting to see it's InDesigns fault and not my PEBCAK 😉

I almost believed I was the only one with this problem.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines