Skip to content

Updated outdated docs for pygame.freetype module and added note at top #3472

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eshan-Shah
Copy link

To the docs for the pygame.freetype module, I added a note at the top warning and suggesting users to use the better maintained pygame.font module. I also removed any false statements from the longer description of the pygame.freetype module.

@Eshan-Shah Eshan-Shah requested a review from a team as a code owner June 4, 2025 19:54
Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

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

Hi, thank you for contributing :) I have some small requests

  • freetype isn't older than pygame.font, it was an attempt to replace it but eventually failed. you can just say that it's an outdated alternative to pygame.font (plus the other things you said)
  • the note needs to be on the same indentation level as the module, with the proper spaces. run docs --full again after your change.
  • the grammar in the note should be improved

@damusss damusss added the docs label Jun 4, 2025
Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

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

Good start! But I see a few places for improvement.

Thanks for the contribution 🎉

Copy link
Member

Choose a reason for hiding this comment

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

This file should not be modified by hand, as the header says it's autogenerated. It's actually an important file and pygame-ce will not compile without it (it's the built-in docs for the pygame.freetype module)

Copy link
Member

Choose a reason for hiding this comment

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

This header file gets regenerated when you run python dev.py docs --full

@@ -5,12 +5,15 @@

.. module:: pygame.freetype
:synopsis: Enhanced pygame module for loading and rendering computer fonts
.. note:: The ``pygame.freetype`` module is no longer being maintained,
and instead use of :mod:`pygame.font` is strongly recommended.


| :sl:`Enhanced pygame module for loading and rendering computer fonts`
Copy link
Member

Choose a reason for hiding this comment

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

This slug line should be updated too

Yet is has absolutely no dependencies on the SDL_ttf library.
The ``pygame.freetype`` module is an old pygame module for font functionality
and has since been replaced by the newer :mod:`pygame.font` module.
It has absolutely no dependencies on the SDL_ttf library.
It is implemented directly on the FreeType 2 library.
The ``pygame.freetype`` module is not itself backward compatible with
:mod:`pygame.font`.
Copy link
Member

Choose a reason for hiding this comment

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

Below here, there should be some changes too because ftfont is a pygame.font-like API that wraps pygame.freetype, and it's still written in a way that intends to replace font

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pygame-ce‘s freetypeFont seems not support ’escape character‘ ?
3 participants