Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
Eshan-Shah wants to merge 1 commit into pygame-community:main
base: main
Choose a base branch
Loading
from Eshan-Shah:freetype-font-escape-char-docs-update

Conversation

@Eshan-Shah
Copy link

@Eshan-Shah Eshan-Shah commented Jun 4, 2025

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

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

@oddbookworm oddbookworm Jun 5, 2025

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

@oddbookworm oddbookworm Jun 5, 2025

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

and instead use of :mod:`pygame.font` is strongly recommended.


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

@oddbookworm oddbookworm Jun 5, 2025

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

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

@oddbookworm oddbookworm Jun 5, 2025

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

Reviewers

@oddbookworm oddbookworm oddbookworm requested changes

@damusss damusss damusss requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

AltStyle によって変換されたページ (->オリジナル) /