Skip to content

Commit 25824d7

Browse files
committed
unify pygame-web/pyodide/static Freetype init
1 parent be55232 commit 25824d7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src_c/static.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ static struct PyModuleDef mod_pygame_static = {PyModuleDef_HEAD_INIT,
269269
PyMODINIT_FUNC
270270
PyInit_pygame_static()
271271
{
272+
// cannot fail here, and font_initialized is already set to 1 in font.c .
273+
TTF_Init();
274+
275+
// for correct input in wasm worker
276+
SDL_SetHint("SDL_EMSCRIPTEN_KEYBOARD_ELEMENT", "1");
277+
272278
load_submodule("pygame", PyInit_base(), "base");
273279
load_submodule("pygame", PyInit_constants(), "constants");
274280
load_submodule("pygame", PyInit_surflock(), "surflock");

0 commit comments

Comments
 (0)