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 4833962

Browse filesBrowse files
committed
Fix glyph loading in textpath.
I missed the fact that `enc` is now a list, not a mapping anymore (and `glyph` is still an index), so the `glyph in enc` check does not make sense anymore. This fixes test_backend_svg::test_unicode_won, which previously failed *if run by itself* but curiously would not fail when run with the rest of the test suite.
1 parent 348ae44 commit 4833962
Copy full SHA for 4833962

File tree

Expand file treeCollapse file tree

1 file changed

+3
-11
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-11
lines changed

‎lib/matplotlib/textpath.py

Copy file name to clipboardExpand all lines: lib/matplotlib/textpath.py
+3-11Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,10 @@ def get_glyphs_tex(self, prop, s, glyph_map=None,
312312
font.set_size(self.FONT_SCALE, self.DPI)
313313
# See comments in _get_ps_font_and_encoding.
314314
if enc is not None:
315-
if glyph not in enc:
316-
_log.warning(
317-
"The glyph %d of font %s cannot be converted with "
318-
"the encoding; glyph may be wrong.",
319-
glyph, font.fname)
320-
font.load_char(glyph, flags=LOAD_TARGET_LIGHT)
321-
else:
322-
index = font.get_name_index(enc[glyph])
323-
font.load_glyph(index, flags=LOAD_TARGET_LIGHT)
315+
index = font.get_name_index(enc[glyph])
316+
font.load_glyph(index, flags=LOAD_TARGET_LIGHT)
324317
else:
325-
index = glyph
326-
font.load_char(index, flags=LOAD_TARGET_LIGHT)
318+
font.load_char(glyph, flags=LOAD_TARGET_LIGHT)
327319
glyph_map_new[char_id] = font.get_path()
328320

329321
glyph_ids.append(char_id)

0 commit comments

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