Skip to content

Commit 38ef911

Browse files
committed
DOC: Add what's new entry for font alternative family name registration
1 parent f428011 commit 38ef911

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Fonts addressable by all their SFNT family names
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Fonts can now be selected by any of the family names they advertise in
5+
the OpenType name table, not just the one FreeType reports as the primary
6+
family name.
7+
8+
Some fonts store different family names on different platforms or in
9+
different name-table entries. For example, Ubuntu Light stores
10+
``"Ubuntu"`` in the Macintosh-platform Name ID 1 slot (which FreeType
11+
uses as the primary name) and ``"Ubuntu Light"`` in the Microsoft-platform
12+
Name ID 1 slot. Previously only the FreeType-derived name was registered,
13+
requiring an obscure weight-based workaround::
14+
15+
# Previously required
16+
matplotlib.rcParams['font.family'] = 'Ubuntu'
17+
matplotlib.rcParams['font.weight'] = 300
18+
19+
All name-table entries that describe a family — Name ID 1 on both
20+
platforms, the Typographic Family (Name ID 16), and the WWS Family
21+
(Name ID 21) — are now registered as separate entries in the
22+
`~matplotlib.font_manager.FontManager`, so any of those names can be
23+
used directly::
24+
25+
matplotlib.rcParams['font.family'] = 'Ubuntu Light'

0 commit comments

Comments
 (0)