Skip to content

Commit f00c49c

Browse files
authored
Merge pull request #2688 from pygame-community/matiiss-upgrade-sdl-ttf-2.22.0
Upgrade `SDL_ttf `to `2.22.0`, add test for a bugfix
2 parents 8d16a6f + 6e6d044 commit f00c49c

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

buildconfig/download_win_prebuilt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def get_urls(x86=True, x64=True):
8686
'983484dd816abf25cdd5bce88ac69dbca1ea713a'
8787
],
8888
[
89-
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-devel-2.20.2-VC.zip',
90-
'dee48e9c5184c139aa8bcab34a937d1b3df4f503'
89+
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-devel-2.22.0-VC.zip',
90+
'2d4f131909af2985b5ebc5ed296d28628c87c243'
9191
],
9292
[
9393
'https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.2/SDL2_mixer-devel-2.6.2-VC.zip',
@@ -223,12 +223,12 @@ def copy(src, dst):
223223
copy(
224224
os.path.join(
225225
temp_dir,
226-
'SDL2_ttf-devel-2.20.2-VC/SDL2_ttf-2.20.2'
226+
'SDL2_ttf-devel-2.22.0-VC/SDL2_ttf-2.22.0'
227227
),
228228
os.path.join(
229229
move_to_dir,
230230
prebuilt_dir,
231-
'SDL2_ttf-2.20.2'
231+
'SDL2_ttf-2.22.0'
232232
)
233233
)
234234
copy(

buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cd $(dirname `readlink -f "$0"`)
55

66
SDL2="SDL2-2.28.5"
77
IMG2="SDL2_image-2.8.2"
8-
TTF2="SDL2_ttf-2.20.2"
8+
TTF2="SDL2_ttf-2.22.0"
99
MIX2="SDL2_mixer-2.6.3"
1010

1111

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
12593eb78fcca877a8dfb78cf21a4e6feba7dc87c964de378ac462b36d8e41ecb587222cb41d5f56dd35b838e1b9867b8ae0cf2f4d2a01afaf23ac8c11edc84d SDL2-2.28.5.tar.gz
22
0ff345824f95158dfa72f83f9d4a540601c178cd759334bf849c14a2920b5330d0763413b58c08b3deba8d3a4ccb6ea2a8159f87efe4cbb0e8ea850f63d09454 SDL2_image-2.8.2.tar.gz
33
2e9da045d2fdab97236c3901b3d441834a67a47c8851ddfb817c9db6f23ed9fb355a5ef8d2158d0c9959a83934e8cd1b95db8a69eaddf8f7fcca115f01818740 SDL2_mixer-2.6.3.tar.gz
4-
b54e93b100712e3764cd80d4e4b16cd4c2a6853620f675941a4214320b0ee29a583d57ad56cd5fdb5c7a32d7615cbf43bc3fa55337b01623cee7219ebb43667c SDL2_ttf-2.20.2.tar.gz
4+
34a1d210d8f1b1e802139d65ba47e36033bb7881e75a8862c1b1c515565bef85e3d81ee42e952aa664de043debef387ba60088a9cf3ba3297413db39a13af912 SDL2_ttf-2.22.0.tar.gz

test/font_test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,25 @@ def test_render_multiline(self):
318318
two_lines = f.render("hello\nworld", False, "black", None, 200)
319319
self.assertGreater(two_lines.get_height(), one_line.get_height())
320320

321+
@unittest.skipIf(
322+
pygame.font.get_sdl_ttf_version() < (2, 22, 0), "bug fixed in SDL_ttf 2.22.0"
323+
)
324+
def test_render_multiple_newlines(self):
325+
if pygame_font.__name__ == "pygame.ftfont":
326+
return
327+
328+
f = pygame_font.Font(None, 20)
329+
one_newline = f.render("\n", True, "black", "white")
330+
two_newlines = f.render("\n\n", True, "black", "white")
331+
three_newlines = f.render("\n\n\n", True, "black", "white")
332+
self.assertTrue(
333+
one_newline.get_height()
334+
< two_newlines.get_height()
335+
< three_newlines.get_height()
336+
)
337+
self.assertEqual(one_newline.get_height() * 2, two_newlines.get_height())
338+
self.assertEqual(one_newline.get_height() * 3, three_newlines.get_height())
339+
321340

322341
@unittest.skipIf(IS_PYPY, "pypy skip known failure") # TODO
323342
class FontTypeTest(unittest.TestCase):

0 commit comments

Comments
 (0)