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

sysfont (3432) on non-os platforms #1694

Open
GalacticEmperor1 opened this issue Feb 12, 2023 · 1 comment · May be fixed by #1967
Open

sysfont (3432) on non-os platforms #1694

GalacticEmperor1 opened this issue Feb 12, 2023 · 1 comment · May be fixed by #1967
Labels
sysfont pygame.sysfont

Comments

@GalacticEmperor1
Copy link
Collaborator

Issue №3432 opened by illume at 2022-08-28 17:54:11

So far seems sysfont runs but won't return anything. (I think)

https://github.com/pygame/pygame/pull/3225/files# diff-ce847b7a6780bf12cf5be3fa9bdb8d243af1d47ea2e1e2c6a1bc4dea21a9d1fcR201

Browsers usually have a lot of fonts available.


Comments

# # pmp-p commented at 2022-08-28 20:31:14

Browsers usually have a lot of fonts available.

but pygame cannot use browser fonts since it only use canvas. To use browser fonts you need Dom interfacing modules which are not default in CPython or pyodide, ( only pygbag loader they cannot be dynamically loaded )

it's possible to list the font on the host before packing files ( like pygbag packager does) or get the font list from a json file on server.

it would only be a matter of choosing which file holds it and its format ( the same as which is actually parserd would save some code), i think an ENV var like FC_LIST to point the file would be fine

I think the title is too restrictive as it can also help on android and embedded linux with no fc-* tools or restricted to single process

@pmp-p
Copy link
Member

pmp-p commented Sep 27, 2024

idea: how hard would it be to replace failing pygame.freetype.SysFont() calls to a valid default font instance and a warning ?

browser / wasi / android don't have access to Sysfont. But they still can access the shipped default font.

@pmp-p pmp-p changed the title wasm emscripten sysfont (3432) sysfont (3432) on non-os platforms Sep 27, 2024
@pmp-p pmp-p linked a pull request Sep 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sysfont pygame.sysfont
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants