Skip to content

Why not ship with a default font able to change font size in ImageDraw.Draw.text? #6622

@wikiwen

Description

@wikiwen

What did you do?

Hello, every author of Pillow! Thank you create this powerful tool in image processing.
I want to draw a text in a image. But I found so inconvenient to change font size. As the default font is unsupported to change font size, I need to download a truetype font file, and define a object ImageFont to change font size. Why not shipped with a default font able to change font size in ImageDraw.Draw.text like opencv?

What are your OS, Python and Pillow versions?

  • OS: CentOS
  • Python: 3.7
  • Pillow: 9.2.0
# Now: default font. can't change font size. Often so small in a image.
draw.text((10, 25), "world", font=None)

# Now: need download arial.ttf to change font size
font = ImageFont.truetype("arial.ttf", 15)
draw.text((10, 25), "world", font=font)

# Expected: default font, set font_size
draw.text((10, 25), "world", font_size=15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions