Merge pull request #8771 from radarhere/fontfile

This commit is contained in:
Hugo van Kemenade 2025-02-22 17:27:55 +02:00 committed by GitHub
commit d7d48df9af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,20 @@ from pathlib import Path
import pytest
from PIL import FontFile
from PIL import FontFile, Image
def test_compile() -> None:
font = FontFile.FontFile()
font.glyph[0] = ((0, 0), (0, 0, 0, 0), (0, 0, 0, 1), Image.new("L", (0, 0)))
font.compile()
assert font.ysize == 1
font.ysize = 2
font.compile()
# Assert that compiling again did not change anything
assert font.ysize == 2
def test_save(tmp_path: Path) -> None: