Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7fcde53

Browse files
committed
MNT: move font fallback handling into CharacterTracker
1 parent 8a26ff9 commit 7fcde53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/backends/_backend_pdf_ps.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def __init__(self):
6565

6666
def track(self, font, s):
6767
"""Record that string *s* is being typeset using font *font*."""
68-
self.used.setdefault(font.fname, set()).update(map(ord, s))
68+
char_to_font = font._get_fontmap(s)
69+
for _c, _f in char_to_font.items():
70+
self.used.setdefault(_f.fname, set()).add(ord(_c))
6971

7072
def track_glyph(self, font, glyph):
7173
"""Record that codepoint *glyph* is being typeset using font *font*."""

0 commit comments

Comments
 (0)