Repository: matplotlib/matplotlib
File: galleries/users_explain/text/fonts.py (Python)

Code before:
  | Type 1 (PDF with usetex) | Type 3 (PDF/PS)            | TrueType (PDF)             |
  +==========================+============================+============================+
  | One of the oldest types, | Similar to Type 1 in       | Newer than previous types, |
  | introduced by Adobe      | terms of introduction      | used commonly today,       |
  |                          |                            | introduced by Apple        |
  +--------------------------+----------------------------+----------------------------+
  | Restricted subset of     | Full PostScript language,  | Include a virtual machine  |
  | PostScript, charstrings  | allows embedding arbitrary | that can execute code!     |
  | are in bytecode          | code (in theory, even      |                            |
  |                          | render fractals when       |                            |
  |                          | rasterizing!)              |                            |
  +--------------------------+----------------------------+----------------------------+
  | These fonts support font | Do not support font hinting| Hinting supported (virtual |
  | hinting                  |                            | machine processes the      |
  |                          |                            | "hints")                   |
  +--------------------------+----------------------------+----------------------------+
  | Subsetted by code in     | Subsetted via external module                           |
  | `matplotlib._type1font`  | `fontTools <https://github.com/fonttools/fonttools>`__  |
  +--------------------------+----------------------------+----------------------------+

.. note::

   Adobe disabled__ support for authoring with Type 1 fonts in January 2023.
   Matplotlib uses Type 1 fonts for compatibility with TeX: when the usetex
   feature is used with the PDF backend, Matplotlib reads the fonts used by
   the TeX engine, which are usually Type 1.

   __ https://helpx.adobe.com/fonts/kb/postscript-type-1-fonts-end-of-support.html

Other font specifications which Matplotlib supports:

- Type 42 fonts (PS):

  - PostScript wrapper around TrueType fonts
  - 42 is the `Answer to Life, the Universe, and Everything!
    <https://en.wikipedia.org/wiki/Answer_to_Life,_the_Universe,_and_Everything>`_
  - Matplotlib uses the external library
    `fontTools <https://github.com/fonttools/fonttools>`__ to subset these types of
    fonts

- OpenType fonts:

  - OpenType is a new standard for digital type fonts, developed jointly by
    Adobe and Microsoft
  - Generally contain a much larger character set!
  - Limited support with Matplotlib

Font subsetting
^^^^^^^^^^^^^^^

The PDF and PostScript formats support embedding fonts in files, allowing the

Review comment (suggestion):
```suggestion
   Matplotlib uses Type 1 fonts for compatibility with TeX; when the usetex
   feature is used with the PDF backend, Matplotlib reads the fonts used by
   the TeX engine, which are usually Type 1.
```

Code after:
  | Type 1 (PDF with usetex) | Type 3 (PDF/PS)            | TrueType (PDF)             |
  +==========================+============================+============================+
  | One of the oldest types, | Similar to Type 1 in       | Newer than previous types, |
  | introduced by Adobe      | terms of introduction      | used commonly today,       |
  |                          |                            | introduced by Apple        |
  +--------------------------+----------------------------+----------------------------+
  | Restricted subset of     | Full PostScript language,  | Includes a virtual machine |
  | PostScript, charstrings  | allows embedding arbitrary | that can execute code!     |
  | are in bytecode          | code (in theory, even      |                            |
  |                          | render fractals when       |                            |
  |                          | rasterizing!)              |                            |
  +--------------------------+----------------------------+----------------------------+
  | Supports font            | Does not support font      | Supports font hinting      |
  | hinting                  | hinting                    | (virtual machine processes |
  |                          |                            | the "hints")               |
  +--------------------------+----------------------------+----------------------------+
  | Subsetted by code in     | Subsetted via external module                           |
  | `matplotlib._type1font`  | `fontTools <https://github.com/fonttools/fonttools>`__  |
  +--------------------------+----------------------------+----------------------------+

.. note::

   Adobe disabled__ support for authoring with Type 1 fonts in January 2023.
   Matplotlib uses Type 1 fonts for compatibility with TeX; when the usetex
   feature is used with the PDF backend, Matplotlib reads the fonts used by
   the TeX engine, which are usually Type 1.

   __ https://helpx.adobe.com/fonts/kb/postscript-type-1-fonts-end-of-support.html

Other font specifications which Matplotlib supports:

- Type 42 fonts (PS):

  - PostScript wrapper around TrueType fonts
  - 42 is the `Answer to Life, the Universe, and Everything!
    <https://en.wikipedia.org/wiki/Answer_to_Life,_the_Universe,_and_Everything>`_
  - Matplotlib uses the external library
    `fontTools <https://github.com/fonttools/fonttools>`__ to subset these types of
    fonts

- OpenType fonts:

  - OpenType is a new standard for digital type fonts, developed jointly by
    Adobe and Microsoft
  - Generally contain a much larger character set!
  - Limited support with Matplotlib

Font subsetting
^^^^^^^^^^^^^^^

The PDF and PostScript formats support embedding fonts in files, allowing the