Repository navigation
Description
Problem
Document.SetDefaultFont only affects Document.Add(string). Other elements fall back to TextStyle.Default,
which is unembedded Helvetica. In a document with Conformance set, a list or table without an explicit style
breaks the font-embedding requirement and the save says nothing.
Evidence (origin/main 1c61fa6):
src/VellumPdf.Layout/Document.cs:41holds_defaultStyle. The only read is inAdd(string, TextStyle?)
at:842:Add(new Paragraph(text, style ?? _defaultStyle)).- The documentation says so (
Document.cs:342-345): "nothing else reads it ... aParagraph,Heading,
list, table or running band never uses it." src/VellumPdf.Layout/Core/TextStyle.cs:59:public FontReference FontRef { get; init; } = Standard14.Helvetica;- Fallbacks to the default:
ListRenderer.cs:321(_list.DefaultStyle ?? TextStyle.Default),
TableRenderer.cs:118and:212(_table.DefaultCellStyle ?? TextStyle.Default),Paragraph.cs:151
(style ?? TextStyle.Default) andHeading.cs:163(style ?? new TextStyle { FontSize = 14 }, which is
Helvetica too),RunningBand.cs:182(Style = style ?? TextStyle.Default;) and
TableGridResolver.cs:279(table.DefaultCellStyle ?? TextStyle.Default, the column-width pass).
Measured
Measured in the 2026-11-16 handbook research on VellumPdf 2.3.3 (not reproduced for this issue): with
SetDefaultFont set to an embedded DejaVuSans, every list and table cell used /F1 12 Tf (/Helvetica), and
veraPDF and the library's preflight both failed ISO 14289-1 7.21.4.1-1. #545 (nested marker drawn as ?)
appears through the same fallback.
Why it matters
ISO 19005-2 6.2.11.4.1 requires every font used for rendering to be embedded (read via NEN Connect on
2026-11-17). Until this is fixed the caller must style every element by hand.
Scope (v2.4: report; refused only in strict mode, which is opt-in)
- At save, detect each element that resolved to an unembedded standard-14 font while
Conformanceis not
None, and report it through the diagnostics channel (Layout: one general diagnostics channel and an opt-in strict mode (the additive half of #496 and the channel of #304) #607): element kind, its position in the document,
and the font name. - Strict mode refuses the save and names the element.
- Default refusal, and making
SetDefaultFontapply to every element, stay in 3.0 (Refuse the input 2.3.x only reports: the contract changes a patch cannot make #484, Conformance: a PDF/A or PDF/UA claim is stamped on a document the library's own preflight rejects #474). A document
that renders today still saves by default. - Update the XML documentation of
SetDefaultFont,Table.DefaultCellStyle, the list type andParagraph
andHeadingto name the fallback and the report.
Acceptance
- A document with
Conformance = PdfA2u, an embedded font set throughSetDefaultFontonly, one list and one
table reports two fallbacks, naming the list and the table. - The same document with explicit styles on both reports nothing.
- With
Conformance = Nonenothing is reported. - Strict mode throws and names the element; default saves with the bytes it writes today.
- The test fails on origin/main 1c61fa6, proven by mutation.
Relates to
- Conformance: a PDF/A or PDF/UA claim is stamped on a document the library's own preflight rejects #474 (which also covers a PDF/UA claim without embedded fonts), Refuse the input 2.3.x only reports: the contract changes a patch cannot make #484, Layout: one diagnostics channel, before a third one-off warning type is invented #496, Layout: named styles with inheritance #292 (named styles), Layout: one general diagnostics channel and an opt-in strict mode (the additive half of #496 and the channel of #304) #607.
Activity
fix(kernel,layout): settle review findings on the glyph-0 and unembed…
fix(kernel,layout): report glyph 0 and unembedded fonts (#657)