Skip to content

Document exceptions to the nobreak role and non-breaking characters #2511

@ryan-carpenter

Description

@ryan-carpenter

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

  • Document exceptions to the nobreak role
  • Consider adding a note about formatting table content by cell as this is a common context for using non-breaking text.
  • Consider adding more information about the Character Replacements page
  • Adjust the documentation for Asciidoctor PDF about required characters on the Prepare a Custom Font page which advises that "You need to ensure these glyphs are present in your prepared font or configure a fallback font that provides them." This instruction is suitable for most of the required non-Latin characters, but not for the non-breaking ones, which will not behave as intended if these alone (and not the surrounding text) are supplied by Prawn's fallback font.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions