-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document exceptions to the nobreak role and non-breaking characters #2511
Comments
Actually, I would say that these exceptions are specifically applicable to Asciidoctor PDF since it's Asciidoctor PDF that cannot always honor the requested behavior. |
Good point. Edited the issue to reinstate all the suggestions. |
What information is expected here? It's not clear how that page is related to this issue. |
Initially, I was thinking it might be helpful to add Something else I overlooked was the Asciidoctor PDF page on roles. This is another potential place to mention the exceptions. The custom font page already states clearly that some of the required Unicode characters are often missing from non-default fonts. "You need to ensure these glyphs are present in your prepared font or configure a fallback font that provides them." Maybe the only clarification needed is to add that non-breaking glyphs, if used, should be included in the primary font to ensure that Asciidoctor PDF will honor them. |
And it also mentions the requirements for using a custom font with Asciidoctor PDF. See https://docs.asciidoctor.org/pdf-converter/latest/theme/prepare-custom-font/#required-characters
I feel like this is already implied. A font needs to provide glyphs for the required characters or else unexpected behavior will likely happen. |
also document the impact the use of the fallback font has on the nobreak and nowrap roles
So here's what I realized. The documentation for Asciidoctor PDF lists the built-in inline roles that it supports, but it does not include nobreak, nowrap, and pre-wrap. Since these roles have nuances (such as the impact of a fallback font) when used with Asciidoctor PDF, it is worth repeating them here. That gives us the opportunity to document the exceptions. In brief, if Asciidoctor PDF reaches for the fallback font to render a character, that will introduce a break opportunity, regardless of what role is set or what the adjacent characters are. I have added a warning to the page about fallback fonts. |
The nobreak role and non-breaking characters should prevent breaks from occuring within a span or string of text, but unintended breaks may occur in files generated with Prawn when the span or string includes mixed fonts.
The reason is that Prawn creates separate fragments for the different fonts, and allows breaks between the fragments.
This means that the nobreak role and non-breaking glyphs will only behave as intended when supported by the target font.
Unfortunately, this is not the case for many of the most common fonts, which typically do not include non-breaking hyphens, narrow no-break space, or zero-width word joiner.
See discussion in the Asciidoctor Zulip chat
Suggestions
The text was updated successfully, but these errors were encountered: