Skip to content

Only include fonts effectively used in the final PDF document #1382

@Lucas-C

Description

@Lucas-C

Quoting @andersonhc in #1133 (comment):

I am running some tests and it's interesting your PR makes it clear we are letting unused fonts end up in the output document.
The page 1 will have "F1" and "F4" in the resources dictionary, and page 2 will have "F3" and "F4".
"F2" is added on the final document and not referenced at all. "F4" is added to the resource list because of set_font() although not used.
I have documents with many fallback fonts and there is a considerable amount of unused font data added to the documents.

fpdf2 should NOT include unused fonts.

We should implement a mechanism to only add to the final PDF document the fonts actually used.

cf. comment #1382 (comment) below for mor details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions