Expand description
Language-aware text normalization shared by print and EPUB output.
Applied at render time, never stored in the model, so the author’s text stays as typed and changing the book language re-quotes everything.
Structs§
- Carry
- What
smartencarries from one run of a paragraph to the next (the text between formatting changes), so quotes after a change open and close correctly. Each paragraph, title or caption starts fromCarry::default(). - Quotes
- Quotation style for a language.
- Smarten
Options - Options for
smarten.
Functions§
- german_
nbsp - German: non-breaking (thin would be nicer, NBSP is safer across readers) spaces inside common abbreviations and between numbers and units.
- normalize
- Everything print and EPUB apply to a run of manuscript text:
smartenfor the language, then for Germangerman_nbsp.primaryis the primary language subtag (crate::Lang::primary);carryas forsmarten. - normalize_
with normalizewith other options than the language’s own, e.g.Quotes::DE_GUILLEMETSfor a German book set with guillemets.- opening_
split - Where a chapter’s first paragraph splits for a drop cap, as byte offsets
into
s:(initial_end, lead_in_end). The initial runs up to and including the first letter or digit (so it carries any opening quote before it); the lead-in is the rest of that word and two more whitespace-separated words (a lone dash counts as a word), or all ofsif there are fewer.Nonewhenshas no letter or digit. Print and EPUB both split with this, so they cannot disagree; each decides for itself what may stand before the letter. - smarten
- Convert typewriter punctuation to typographic punctuation.