Factor out saving metrics in FontFile#9417
Factor out saving metrics in FontFile#9417fjhenigman wants to merge 1 commit intopython-pillow:mainfrom
Conversation
|
Hi. To outline the problem, you've said that you would like to convert I'm guessing you saw https://pillow.readthedocs.io/en/stable/reference/ImageFont.html#imagefont-module and https://github.com/python-pillow/pillow-scripts/blob/main/Scripts/pilfont.py. They've sort of presumed that you only need to convert once, or maybe only convert a small number of fonts, but presumably you would like your users to be able to make this conversion for any PCF or BDF font they might choose at runtime, and you would like to do so efficiently. My suggestion would be adding a Also, just to properly understand the need, what is it that you want to do with the |
|
Yes exactly, I am using ImageDraw to draw text and would like to support bdf and pcf fonts. If it was just for me or just a couple fonts, I would use pilfont.py to convert them and deal with the resulting bitmaps and .pil files. But for an application with wider use, it would be nice if any user could directly feed it any pcf or bdf files they may have. |
Facilitates creating an ImageFont from a PCF or BDF file on the fly, without creating any new files, with code like this:
This isn't ideal, creating a file in memory and using an underscore function. Maybe it's preferable to add functionality to ImageFont.py instead?