Skip to content

Japanese font glyph with direction "ttb" is drawn to incorrect position #2656

@masushin

Description

@masushin

What did you do?

I tried to draw Japanese font glyph by following test code.

from PIL import Image, ImageDraw, ImageFont

txt = Image.new('RGBA', (200,200), (255,255,255,255))
fnt = ImageFont.truetype("GenEiAntiqueN-Medium.otf", 80)
d = ImageDraw.Draw(txt)
d.text((60,20), "あい", font=fnt, fill=(0,0,0,255), direction="ttb")
txt.show()

What did you expect to happen?

I expected to get the following image.

ai

What actually happened?

I got the following image.

ai2

Glyphs are drawn to deviate to the lower left.

Also, it seems that these glyphs are drawn overlapping.
(It may be better to deal with this after the first problem has been solved..)

The font file using in my code can be got from the following link.
http://okoneya.jp/font/GenEiAntique-3.0.zip

Incidentally, I tried it using other font "ヒラギノ 明朝".
It included in Japanese mac OS. And same problem appear.
So, I think it is not problem with a specific font file.

Please let me know if there are mistake in my code.

What versions of Pillow and Python are you using?

Python 3.6.0
Pillow 4.2.1

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