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

Appearance settings

Commit c94923e

Browse filesBrowse files
committed
Reword introduction and small bits
1 parent 5999170 commit c94923e
Copy full SHA for c94923e

File tree

Expand file treeCollapse file tree

1 file changed

+20
-15
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+20
-15
lines changed

‎doc/users/fonts.rst

Copy file name to clipboardExpand all lines: doc/users/fonts.rst
+20-15Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
All about Matplotlib and Fonts!
1+
Fonts in Matplotlib Text Engine
22
===============================
33

4-
The story of fonts has been quite eventful throughout time. It involves
5-
contributions of tech giants such as the likes of Adobe, Apple and Microsoft.
4+
Matplotlib needs fonts to work with its text engine, some of which are shipped
5+
alongside the installation. Users can configure the default fonts, or even
6+
provide their own custom fonts! Follow this guide.
67

7-
Types
8-
-----
9-
In practice, there are 3 types Matplotlib supports (in addition to
10-
'core fonts', more about which is explained later in the guide):
8+
However, Matplotlib also provides an option to offload text rendering to a TeX
9+
engine (``usetex=True``). Consult this guide.
10+
11+
Fonts have a long and sometimes incompatible history in computing, leading to
12+
different platforms supporting different types of fonts. In practice, there are
13+
3 types of font specifications Matplotlib supports (in addition to 'core
14+
fonts', more about which is explained later in the guide):
1115

1216
.. list-table:: Type of Fonts
1317
:header-rows: 1
@@ -57,13 +61,14 @@ a way that when these documents are visually scaled, the text does not appear
5761
pixelated.
5862

5963
This can be achieved by virtually embedding the *whole* font file within the
60-
output document. However, this can lead to **very large documents**, wherein
61-
most of the size bandwidth is captured by that font file data.
64+
output document. However, this can lead to very large documents, as some
65+
fonts (for instance, CJK - Chinese/Japanese/Korean fonts) can contain a large
66+
number of glyphs, and thus their embedded size can be quite huge.
6267

63-
Font Subsetting is a way to embed only the *required* glyphs within the
64-
documents. Fonts can be considered as a collection of glyphs, so ultimately the
65-
goal is to find out *which* glyphs are required for a certain array of
66-
characters, and embed only those within the output.
68+
Font Subsetting can be used before generating documents, to embed only the
69+
*required* glyphs within the documents. Fonts can be considered as a collection
70+
of glyphs, so ultimately the goal is to find out *which* glyphs are required
71+
for a certain array of characters, and embed only those within the output.
6772

6873
.. note::
6974
The role of subsetter really shines when we encounter characters like **ä**
@@ -73,8 +78,8 @@ characters, and embed only those within the output.
7378

7479
Luckily, Matplotlib uses a fork of an external dependency called
7580
`ttconv <https://github.com/sandflow/ttconv>`_, which helps in embedding and
76-
subsetting stuff. (however, recent versions have moved away from ttconv to pure
77-
Python for certain types: for more details visit
81+
subsetting font data. (however, recent versions have moved away from ttconv to
82+
pure Python for certain types: for more details visit
7883
`these <https://github.com/matplotlib/matplotlib/pull/18370>`_, `links <https://github.com/matplotlib/matplotlib/pull/18181>`_)
7984

8085
| *Type 1 fonts are still non-subsetted* through Matplotlib. (though one will encounter these mostly via *usetex*/*dviread* in PDF backend)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.