Pillow, draw text not working for bar-code font

2019-08-25 03:18发布

问题:

I am using pillow to draw some texts in my images. So far so good, this is working for normal fonts. But when I use this bare-code font pillow is not drawing anything. Also no error occurs, any ideas?

This is code snippet shows loading the font and drawing the text, the font_file (path) is correct.

font = ImageFont.truetype(font_file, line.styles.font_size)
# Drawing the text in my image
self.draw_inst.text((pos_x, pos_y), line.text, font=font, fill=(0, 0, 0))

The code is working for every other font I use.