Repository navigation
Open
Labels
area/conformancePDF/A, PDF/UA, preflight, veraPDF gatesarea/layouthigh-level document/layout engineenhancementNew feature or requesttype/featurenew capability
Description
Problem
Paragraph, heading, list item and cell each take one language string. A text run has none, so a Dutch sentence
cannot quote an English term with its own language. (origin/main 1c61fa6.)
src/VellumPdf.Layout/Elements/TextRun.cs:43:public sealed class TextRun(string Text, TextStyle Style); its
only members areText(:58) andStyle(:86).TextStylehas no language member (src/VellumPdf.Layout/Core/TextStyle.cs; its public members areFontRef,Font,
FontSize,Leading,Color,EffectiveLeading,LinkUriandMeasureString,:21-257).- Language exists per element:
Paragraph.Language(Paragraph.cs:118),Heading.Language(Heading.cs:131),
ListItem.Language(ListItem.cs:76),Cell.Language(Cell.cs:183). - The whole paragraph is one marked-content sequence:
ParagraphRenderer.cs:178
(mcid = canvas.BeginMarkedContent(StructType);), and the struct element is oneP(:328). - Heading and list item text are plain strings (
Heading.cs:35,ListItem.cs:35), so they cannot carry runs
(Layout: only Paragraph supports inline runs — Heading and ListItem take one string #367).
Measured
Measured in the 2026-11-16 handbook research on VellumPdf 2.3.3 (not reproduced for this issue): the phrase
"het Engelse woord return" could only be tagged with the paragraph's language, and the P had no Span child.
Why it matters
ISO 14289-1 7.2: changes in natural language shall be declared. The handbook quotes English interface terms
and messages inside Dutch sentences.
Scope
TextRun.Language(additive; BCP 47).TextStyle.Languageis the alternative; the design review picks one.- The renderer closes the paragraph's marked-content sequence at a language change and opens a
Spanchild
with/Lang, either as a structure element or as a marked-content property
(/Span <</Lang (en) /MCID n>> BDC). Both need Kernel: a structure element cannot hold mixed kids (MCID, MCR, OBJR, element) or content on several pages #604 (mixed kids) and Kernel: marked-content sequences cannot carry a property list, so artifacts have no Type, Subtype or BBox #605 (property lists). - The same mechanism applies to heading and list item once Layout: only Paragraph supports inline runs — Heading and ListItem take one string #367 gives them runs.
- Text extraction order does not change.
Acceptance
Paragraph([run nl, run en, run nl])producesP > [MCID, Span(Lang en) > MCID, MCID]or the equivalent
marked-content/Lang(assert on the tree and the content stream). In marked content the language is written as
/Lang (en)under Kernel: marked-content sequences cannot carry a property list, so artifacts have no Type, Subtype or BBox #605's string rule (ASCII tag as a plain literal string).- veraPDF
ua1language rules (7.2) pass, and the Reader's extracted text is identical to a single-language
paragraph with the same text. - A run without
Languagewrites the bytes it writes today (golden test). - A language tag that is empty or not BCP 47 is handled as
Paragraph.Languagehandles it today (the brief states
what that is; this issue adds no new refusal). - The test fails on origin/main 1c61fa6, proven by mutation.
Relates to
- Layout: the full PDF/UA-2 element set, with Alt, ActualText, Lang and Ref #293, Layout: only Paragraph supports inline runs — Heading and ListItem take one string #367, Layout: culture-aware formatting driven by /Lang #322, Kernel: a structure element cannot hold mixed kids (MCID, MCR, OBJR, element) or content on several pages #604, Kernel: marked-content sequences cannot carry a property list, so artifacts have no Type, Subtype or BBox #605.
Metadata
Metadata
Assignees
Labels
area/conformancePDF/A, PDF/UA, preflight, veraPDF gatesarea/layouthigh-level document/layout engineenhancementNew feature or requesttype/featurenew capability
Activity