Skip to content

Absent pixels when drawing font #4569

@gaoxinge

Description

@gaoxinge

What did you do?

  • I use pillow to draw font.

What actually happened?

1

  • I observe there are some absence pixels on the top of numbers: 0, 2, 3, 8, 9 .

What are your OS, Python and Pillow versions?

  • OS: win10
  • Python: 3.6.1
  • Pillow: 7.1.1
from PIL import Image, ImageFont, ImageDraw

ttf_path = "vista-hei-all.ttf"
text = "0123456789"
text_size = 35

font = ImageFont.truetype(ttf_path, text_size)
text_width, text_height = font.getsize(text)
canvas = Image.new("RGBA", [text_width, text_height], (255, 0, 0, 0))
draw = ImageDraw.Draw(canvas)
draw.text((0, 0), text, font=font, fill="#000000")
canvas.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAny unexpected behavior, until confirmed feature.Font Rendering

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions