|
4 | 4 | ====================== |
5 | 5 |
|
6 | 6 | .. module:: pygame.freetype |
7 | | - :synopsis: Enhanced pygame module for loading and rendering computer fonts |
8 | | - |
9 | | -| :sl:`Enhanced pygame module for loading and rendering computer fonts` |
10 | | -
|
11 | | -The ``pygame.freetype`` module is a replacement for :mod:`pygame.font`. |
12 | | -It has all of the functionality of the original, plus many new features. |
13 | | -Yet is has absolutely no dependencies on the SDL_ttf library. |
14 | | -It is implemented directly on the FreeType 2 library. |
15 | | -The ``pygame.freetype`` module is not itself backward compatible with |
16 | | -:mod:`pygame.font`. |
17 | | -Instead, use the ``pygame.ftfont`` module as a drop-in replacement |
18 | | -for :mod:`pygame.font`. |
| 7 | + :synopsis: pygame module for loading and rendering computer fonts |
| 8 | + |
| 9 | +| :sl:`pygame module for loading and rendering computer fonts` |
| 10 | +
|
| 11 | +The ``pygame.freetype`` module is an alternative to :mod:`pygame.font`. |
| 12 | +It is implemented directly on the FreeType 2 library, and is not |
| 13 | +backward compatible with :mod:`pygame.font`. :mod:`pygame.font` |
| 14 | +relies on the SDL_ttf library, and due to the SDL_ttf team's efforts, |
| 15 | +``pygame.font`` is now the better supported of our font modules. |
| 16 | +In new code, the use of :mod:`pygame.font` is encouraged. |
| 17 | +``pygame.font``, unlike ``pygame.freetype``, has support for multiline text, |
| 18 | +text shaping for global writing systems, and rendering emoji with color. |
| 19 | + |
| 20 | +The ``pygame.ftfont`` module exists as a limited version of |
| 21 | +the :mod:`pygame.font` API, running on top of ``pygame.freetype``. |
| 22 | +Many of the recently added font features do not work on it. |
19 | 23 |
|
20 | 24 | All font file formats supported by FreeType can be rendered by |
21 | 25 | ``pygame.freetype``, namely ``TTF``, Type1, ``CFF``, OpenType, |
|
0 commit comments