Skip to content

Improve SysFont documentation and add font verification warning. Closes #2643 #3373

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

Merged

Conversation

mv805
Copy link
Contributor

@mv805 mv805 commented Mar 5, 2025

Hello. This is my propsal to solve the usability issue noted here #2643 where I give my analysis into the issue.
I decided just to update the docs with a minor clarification and improve the warning to help prompt future users to double check their name inputs. This should prevent the issue from occuring as long as the user reads the docs and warnings 😃

The following short code can be ran to confirm the new warning:

import pygame
pygame.init()

font_size = 20  # some default font they might want

font = pygame.font.SysFont(pygame.font.get_default_font(), font_size)  # gives warning and defaults to freesansbold. Now you should see the updated warning prompting to double check name input.

print("Font loaded:", font.name)  # confirm that freesansbold loaded by default

pygame.quit()

@mv805 mv805 requested a review from a team as a code owner March 5, 2025 08:31
@mv805 mv805 changed the title Improve SysFont documentation and add font verification warning Improve SysFont documentation and add font verification warning. Closes #2643 Mar 5, 2025
@mv805 mv805 requested review from ankith26 and gresm March 7, 2025 07:14
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing! 🥳

@ankith26 ankith26 added this to the 2.5.4 milestone Mar 8, 2025
Copy link
Contributor

@gresm gresm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@damusss damusss added docs sysfont pygame.sysfont labels Mar 11, 2025
@damusss damusss merged commit 12141bf into pygame-community:main Mar 11, 2025
25 checks passed
@mv805 mv805 deleted the sysfont-warning-and-doc-clarification branch March 12, 2025 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs sysfont pygame.sysfont
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants