Skip to content

Conformance: the font rules read page content only, so an exemption is decided on partial evidence #450

Open

Description

@Tim81

ContentStreamUsage.Analyze reads a page's own /Contents and nothing else. Its Do case records the XObject name and does not recurse. Annotation appearance streams and Type 3 CharProcs are never scanned.

GetReachableContentStreams exists in the same file and reaches all of them. Five rules use it. None of the font rules do.

Why it became urgent

While that limit only ever widened the set of fonts checked, it was safe under-detection: a font used solely inside a form XObject simply went unchecked.

#445 introduced the first place the same scan could narrow the set, in the text-rendering-mode-3 exemption, and a blind spot used to narrow is a wrong exemption rather than a missed check. It had to add a document-wide suppression to stay safe: a drawn form XObject, an annotation carrying an appearance stream, a selected Type 3 font, or content that failed to decode or parse now disables the exemption entirely.

What that costs

The guard is conservative in two directions. A font drawn only inside a form XObject is still not checked at all. And any page carrying one of those constructs loses the exemption even when nothing is hiding there, so a legitimately exempt font gets reported.

Routing the font rules through GetReachableContentStreams would replace the guard with an answer: the tally would see the shows that are actually there, and the exemption could be decided on complete evidence rather than suppressed on the possibility of incomplete evidence.

Each stream carries its own /Resources, so the work is mapping a stream's own font resource names to font objects before tallying, not just concatenating bytes.

Provenance

All code, read directly. No ISO reading is needed to establish it.

Refs #418, #428.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions