Skip to content

Commit 709500c

Browse files
tacaswellQuLogic
andauthored
DOC: edits from review
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent ec5d0b0 commit 709500c

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

doc/users/explain/fonts.rst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Matplotlib also provides an option to offload text rendering to a TeX engine
1515
(``usetex=True``), see :doc:`Text rendering with LaTeX
1616
</tutorials/text/usetex>`.
1717

18-
Fonts in PDF and postscript
18+
Fonts in PDF and PostScript
1919
---------------------------
2020

2121
Fonts have a long (and sometimes incompatible) history in computing, leading to
@@ -66,9 +66,9 @@ Other font specifications which Matplotlib supports:
6666
Font Subsetting
6767
~~~~~~~~~~~~~~~
6868

69-
PDF and postscript support embedded fonts in the output files allowing the
69+
The PDF and PostScript formats support embedding fonts in files allowing the
7070
display program to correctly render the text, independent of what fonts are
71-
installed on the viewer's computer, without the need to pre-rasterize the text.
71+
installed on the viewer's computer and without the need to pre-rasterize the text.
7272
This ensures that if the output is zoomed or resized the text does not become
7373
pixelated. However, embedding full fonts in the file can lead to large output
7474
files, particularly with fonts with many glyphs such as those that support CJK
@@ -87,7 +87,7 @@ Currently Type 3, Type 42, and TrueType fonts are subseted. Type 1 fonts are no
8787
Core Fonts
8888
~~~~~~~~~~
8989

90-
In addition to the ability to embed fonts, as part of the `postscript
90+
In addition to the ability to embed fonts, as part of the `PostScript
9191
<https://en.wikipedia.org/wiki/PostScript_fonts#Core_Font_Set>`_ and `PDF
9292
specification
9393
<https://docs.oracle.com/cd/E96927_01/TSG/FAQ/What%20are%20the%2014%20base%20fonts%20distributed%20with%20Acroba.html>`_
@@ -113,8 +113,7 @@ This is especially helpful to generate *really lightweight* documents.::
113113
Fonts in SVG
114114
------------
115115

116-
Text can output to SVG in two ways controlled by the :rc:`svg.fonttype`
117-
rcparam:
116+
Text can output to SVG in two ways controlled by :rc:`svg.fonttype`:
118117

119118
- as a path (``'path'``) in the SVG
120119
- as string in the SVG with font styling on the element (``'none'``)
@@ -131,8 +130,8 @@ based on the SVG viewer and what fonts are available.
131130
Fonts in Agg
132131
------------
133132

134-
To output text to raster formats via Agg Matplotlib relies on `FreeType
135-
<https://www.freetype.org/>`_. Because the exactly rendering of the glyphs
133+
To output text to raster formats via Agg, Matplotlib relies on `FreeType
134+
<https://www.freetype.org/>`_. Because the exact rendering of the glyphs
136135
changes between FreeType versions we pin to a specific version for our image
137136
comparison tests.
138137

@@ -144,7 +143,7 @@ Internally using a Font in Matplotlib is a three step process:
144143

145144
1. a `.FontProperties` object is created (explicitly or implicitly)
146145
2. based on the `.FontProperties` object the methods on `.FontManager` are used
147-
to select the closest the "best" font Matplotlib is aware of (except for
146+
to select the closest "best" font Matplotlib is aware of (except for
148147
``'none'`` mode of SVG).
149148
3. the Python proxy for the font object is used by the backend code to render
150149
the text -- the exact details depend on the backend via `.font_manager.get_font`.
@@ -160,13 +159,13 @@ mapped to any one of a set of fonts.
160159

161160
Currently the public API for doing step 2 is `.FontManager.findfont` (and that
162161
method on the global `.FontManager` instance is aliased at the module level as
163-
`.font_manager.findfont`) will only find a single font and return the absolute
162+
`.font_manager.findfont`), which will only find a single font and return the absolute
164163
path to the font on the filesystem.
165164

166165
Font Fallback
167166
-------------
168167

169-
There is no font that covers the unicode space thus it is possible for the
168+
There is no font that covers the entire Unicode space thus it is possible for the
170169
users to require a mix of glyphs that can not be satisfied from a single font.
171170
While it has been possible to use multiple fonts within a Figure, on distinct
172171
`.Text` instances, it was not previous possible to use multiple fonts in the
@@ -188,9 +187,9 @@ SVG, PDF, and PS backends will "fallback" through multiple fonts in a single
188187

189188

190189
Internally this is implemented by setting The "font family" on
191-
`.FontProperties` objects to a list of font families. Using a (currently)
192-
private API extract a list of paths to all of the fonts found and then
193-
construct a single `.ft2font.FT2Font` object that is aware of all of the fonts.
190+
`.FontProperties` objects to a list of font families. A (currently)
191+
private API extracts a list of paths to all of the fonts found and then
192+
constructs a single `.ft2font.FT2Font` object that is aware of all of the fonts.
194193
Each glyph of the string is rendered using the first font in the list that
195194
contains that glyph.
196195

0 commit comments

Comments
 (0)