Skip to content

Commit d7d48df

Browse files
authored
Merge pull request #8771 from radarhere/fontfile
2 parents 769a14d + ae7c492 commit d7d48df

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Tests/test_fontfile.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@
44

55
import pytest
66

7-
from PIL import FontFile
7+
from PIL import FontFile, Image
8+
9+
10+
def test_compile() -> None:
11+
font = FontFile.FontFile()
12+
font.glyph[0] = ((0, 0), (0, 0, 0, 0), (0, 0, 0, 1), Image.new("L", (0, 0)))
13+
font.compile()
14+
assert font.ysize == 1
15+
16+
font.ysize = 2
17+
font.compile()
18+
19+
# Assert that compiling again did not change anything
20+
assert font.ysize == 2
821

922

1023
def test_save(tmp_path: Path) -> None:

0 commit comments

Comments
 (0)