Skip to content

Commit cb1c72e

Browse files
committed
ENH: try to use unicode charmap before ADOBE_STANDARD in textpath
This will allow a wider range of glyphs to be exported. Closes #8280
1 parent beeba66 commit cb1c72e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/textpath.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,13 @@ def get_glyphs_tex(self, prop, s, glyph_map=None,
343343

344344
font = get_font(font_bunch.filename)
345345

346-
for charmap_name, charmap_code in [("ADOBE_CUSTOM",
346+
# The chmap codes are defined in freetype.h L603-786
347+
# in freetype 2.6.1
348+
# def FT_ENC_TAG(a, b, c, d):
349+
# a, b, c, d = [ord(_) for _ in (a, b, c, d)]
350+
# return (a << 24) | (b << 16) | (c << 8) | d
351+
for charmap_name, charmap_code in [('unic', 1970170211),
352+
("ADOBE_CUSTOM",
347353
1094992451),
348354
("ADOBE_STANDARD",
349355
1094995778)]:

0 commit comments

Comments
 (0)