From 7c6530ad4b9150e7598b479c16975f2a56fe8395 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Tue, 7 May 2019 14:55:44 -0700 Subject: [PATCH] Backport PR #14156: Fix glyph loading in textpath. --- lib/matplotlib/textpath.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/textpath.py b/lib/matplotlib/textpath.py index ae289f35f8f6..257e214da000 100644 --- a/lib/matplotlib/textpath.py +++ b/lib/matplotlib/textpath.py @@ -312,18 +312,10 @@ def get_glyphs_tex(self, prop, s, glyph_map=None, font.set_size(self.FONT_SCALE, self.DPI) # See comments in _get_ps_font_and_encoding. if enc is not None: - if glyph not in enc: - _log.warning( - "The glyph %d of font %s cannot be converted with " - "the encoding; glyph may be wrong.", - glyph, font.fname) - font.load_char(glyph, flags=LOAD_TARGET_LIGHT) - else: - index = font.get_name_index(enc[glyph]) - font.load_glyph(index, flags=LOAD_TARGET_LIGHT) + index = font.get_name_index(enc[glyph]) + font.load_glyph(index, flags=LOAD_TARGET_LIGHT) else: - index = glyph - font.load_char(index, flags=LOAD_TARGET_LIGHT) + font.load_char(glyph, flags=LOAD_TARGET_LIGHT) glyph_map_new[char_id] = font.get_path() glyph_ids.append(char_id)