Skip to content

Misleading deprecations documentation for getsize #7802

@stweil

Description

@stweil

The documentation suggests that this old code

width, height = font.getsize("Hello world")

should be replaced by

left, top, right, bottom = font.getbbox("Hello world")
width, height = right - left, bottom - top

A 1:1 replacement would require different new code

left, top, right, bottom = font.getbbox("Hello world")
width, height = right - left, bottom

The documentation should mention that and maybe link to this comment.

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