Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade SDL_ttf to 2.22.0, add test for a bugfix #2688

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions buildconfig/download_win_prebuilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def get_urls(x86=True, x64=True):
'983484dd816abf25cdd5bce88ac69dbca1ea713a'
],
[
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-devel-2.20.2-VC.zip',
'dee48e9c5184c139aa8bcab34a937d1b3df4f503'
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-devel-2.22.0-VC.zip',
'2d4f131909af2985b5ebc5ed296d28628c87c243'
],
[
'https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.2/SDL2_mixer-devel-2.6.2-VC.zip',
Expand Down Expand Up @@ -223,12 +223,12 @@ def copy(src, dst):
copy(
os.path.join(
temp_dir,
'SDL2_ttf-devel-2.20.2-VC/SDL2_ttf-2.20.2'
'SDL2_ttf-devel-2.22.0-VC/SDL2_ttf-2.22.0'
),
os.path.join(
move_to_dir,
prebuilt_dir,
'SDL2_ttf-2.20.2'
'SDL2_ttf-2.22.0'
)
)
copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd $(dirname `readlink -f "$0"`)

SDL2="SDL2-2.28.5"
IMG2="SDL2_image-2.8.2"
TTF2="SDL2_ttf-2.20.2"
TTF2="SDL2_ttf-2.22.0"
MIX2="SDL2_mixer-2.6.3"


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
12593eb78fcca877a8dfb78cf21a4e6feba7dc87c964de378ac462b36d8e41ecb587222cb41d5f56dd35b838e1b9867b8ae0cf2f4d2a01afaf23ac8c11edc84d SDL2-2.28.5.tar.gz
0ff345824f95158dfa72f83f9d4a540601c178cd759334bf849c14a2920b5330d0763413b58c08b3deba8d3a4ccb6ea2a8159f87efe4cbb0e8ea850f63d09454 SDL2_image-2.8.2.tar.gz
2e9da045d2fdab97236c3901b3d441834a67a47c8851ddfb817c9db6f23ed9fb355a5ef8d2158d0c9959a83934e8cd1b95db8a69eaddf8f7fcca115f01818740 SDL2_mixer-2.6.3.tar.gz
b54e93b100712e3764cd80d4e4b16cd4c2a6853620f675941a4214320b0ee29a583d57ad56cd5fdb5c7a32d7615cbf43bc3fa55337b01623cee7219ebb43667c SDL2_ttf-2.20.2.tar.gz
34a1d210d8f1b1e802139d65ba47e36033bb7881e75a8862c1b1c515565bef85e3d81ee42e952aa664de043debef387ba60088a9cf3ba3297413db39a13af912 SDL2_ttf-2.22.0.tar.gz
19 changes: 19 additions & 0 deletions test/font_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,25 @@ def test_render_multiline(self):
two_lines = f.render("hello\nworld", False, "black", None, 200)
self.assertGreater(two_lines.get_height(), one_line.get_height())

@unittest.skipIf(
pygame.font.get_sdl_ttf_version() < (2, 22, 0), "bug fixed in SDL_ttf 2.22.0"
)
def test_render_multiple_newlines(self):
if pygame_font.__name__ == "pygame.ftfont":
return

f = pygame_font.Font(None, 20)
one_newline = f.render("\n", True, "black", "white")
two_newlines = f.render("\n\n", True, "black", "white")
three_newlines = f.render("\n\n\n", True, "black", "white")
self.assertTrue(
one_newline.get_height()
< two_newlines.get_height()
< three_newlines.get_height()
Matiiss marked this conversation as resolved.
Show resolved Hide resolved
)
self.assertEqual(one_newline.get_height() * 2, two_newlines.get_height())
self.assertEqual(one_newline.get_height() * 3, three_newlines.get_height())


@unittest.skipIf(IS_PYPY, "pypy skip known failure") # TODO
class FontTypeTest(unittest.TestCase):
Expand Down
Loading