Skip to content

Feature idea: make get_fonts also return the font objects #3607

@Lucas-C

Description

@Lucas-C

Current state

_get_fonts() is a method of PageObject.

It is a bit unclear to me if this method is part as pypdf public API, as there are unit tests for this method,
but it starts with an underscore and is used nowhere in pypdf internal code.

Goal

I'd like to be able to know the size of the embedded fonts in a PDF document.

Hence I suggest this:

  • rename _get_fonts() into get_fonts() to make it clearer that it is a public method
  • instead of return 2 sets, it could now return 2 dicts, with the associated fonts mapped to their names in the PDF document

What do you think?
Would you be open to this idea?

Metadata

Metadata

Assignees

Labels

is-featureA feature requestneeds-discussionThe PR/issue needs more discussion before we can continue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions