From cb1c72e1cd3e263ae09d7dfe92c95a2021112ee1 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 13 Mar 2017 16:19:55 -0400 Subject: [PATCH] ENH: try to use unicode charmap before ADOBE_STANDARD in textpath This will allow a wider range of glyphs to be exported. Closes #8280 --- lib/matplotlib/textpath.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/textpath.py b/lib/matplotlib/textpath.py index f845a9051443..63eb9499e455 100644 --- a/lib/matplotlib/textpath.py +++ b/lib/matplotlib/textpath.py @@ -343,7 +343,13 @@ def get_glyphs_tex(self, prop, s, glyph_map=None, font = get_font(font_bunch.filename) - for charmap_name, charmap_code in [("ADOBE_CUSTOM", + # The chmap codes are defined in freetype.h L603-786 + # in freetype 2.6.1 + # def FT_ENC_TAG(a, b, c, d): + # a, b, c, d = [ord(_) for _ in (a, b, c, d)] + # return (a << 24) | (b << 16) | (c << 8) | d + for charmap_name, charmap_code in [('unic', 1970170211), + ("ADOBE_CUSTOM", 1094992451), ("ADOBE_STANDARD", 1094995778)]: