Skip to content

Commit 5e5ce02

Browse files
jkseppanQuLogic
andauthored
Remove ttconv and implement Type-42 embedding using fontTools (matplotlib#20866)
* Type-42 fonts using fontTools Split _backend_pdf_ps.get_glyphs_subset into two functions: get_glyphs_subset returns the font object (which needs to be closed after using) and font_as_file serializes this object into a BytesIO file-like object. * Remove ttconv Move the test in lib/matplotlib/tests/test_ttconv.py to lib/matplotlib/tests/test_backend_pdf.py. Actually it has not been a test of ttconv for a while, since type-3 conversion has not been using ttconv. * Add several more droppable tables Fonttools cannot subset these and drops them; avoid the warning. * Don't crash if the loca table is missing Also don't end up in an infinite loop if there is a larger gap between breakpoints than we would like. * Don't crash if glyph bounds cannot be found * Log the name of unsupported fonts FT2Font throws RuntimeError for some fonts * Get names from the original font Not the subsetted one, since in some cases fontTools.subset does not produce a good name table. * Document ttconv removal * Apply fixes from code review * Clean up some ttconv replacements De-wrap a few lines now that we allow longer lines. --------- Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent 25a05f2 commit 5e5ce02

File tree

17 files changed

+276
-2562
lines changed

17 files changed

+276
-2562
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ttconv removed
2+
~~~~~~~~~~~~~~
3+
4+
The ``matplotlib._ttconv`` extension has been removed. Most of its
5+
functionaliy was already replaced by other code, and the only thing left
6+
was embedding TTF fonts in PostScript in Type 42 format. This is now
7+
done in the PS backend using the FontTools library.

extern/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Bundled code.
22
subdir('agg24-svn')
3-
subdir('ttconv')
43

54
# External code.
65

extern/ttconv/meson.build

-14
This file was deleted.

extern/ttconv/pprdrv.h

-102
This file was deleted.

0 commit comments

Comments
 (0)