Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Dec 27, 2020

Helps #5124

When saving, FontFile only saves 256 characters.

Pillow/src/PIL/FontFile.py

Lines 102 to 111 in b48cfa7

with open(os.path.splitext(filename)[0] + ".pil", "wb") as fp:
fp.write(b"PILfont\n")
fp.write(f";;;;;;{self.ysize};\n".encode("ascii")) # HACK!!!
fp.write(b"DATA\n")
for id in range(256):
m = self.metrics[id]
if not m:
puti16(fp, [0] * 10)
else:
puti16(fp, m[0] + m[1] + m[2])

This PR notes this when discussing converting from other font formats.

@radarhere radarhere changed the title Document limited number of FontFile characters Document limited number of characters in FontFile Dec 27, 2020
@hugovk hugovk merged commit 8d62314 into python-pillow:master Dec 29, 2020
@radarhere radarhere deleted the imagefont branch December 29, 2020 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants