Skip to content

Commit 853358b

Browse files
committed
Privatize ttconv module.
It's an internal detail, much like `_qhull`, and not exposed externally.
1 parent a3d7a42 commit 853358b

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

doc/api/api_changes_3.3/deprecations.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,3 +589,7 @@ implementers).
589589
Passing ``ismath="TeX!"`` to `.RendererAgg.get_text_width_height_descent` is
590590
deprecated. Pass ``ismath="TeX"`` instead, consistently with other low-level
591591
APIs which support the values True, False, and "TeX" for ``ismath``.
592+
593+
``matplotlib.ttconv``
594+
~~~~~~~~~~~~~~~~~~~~~
595+
This module is deprecated.

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from matplotlib.path import Path
4242
from matplotlib.dates import UTC
4343
from matplotlib import _path
44-
from matplotlib import ttconv
44+
from matplotlib import _ttconv
4545
from . import _backend_pdf_ps
4646

4747
_log = logging.getLogger(__name__)
@@ -996,7 +996,7 @@ def get_char_width(charcode):
996996
# Make the charprocs array (using ttconv to generate the
997997
# actual outlines)
998998
try:
999-
rawcharprocs = ttconv.get_pdf_charprocs(
999+
rawcharprocs = _ttconv.get_pdf_charprocs(
10001000
os.fsencode(filename), glyph_ids)
10011001
except RuntimeError:
10021002
_log.warning("The PDF backend does not currently support the "

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from matplotlib.cbook import is_writable_file_like, file_requires_unicode
2727
from matplotlib.font_manager import is_opentype_cff_font, get_font
2828
from matplotlib.ft2font import LOAD_NO_HINTING
29-
from matplotlib.ttconv import convert_ttf_to_ps
29+
from matplotlib._ttconv import convert_ttf_to_ps
3030
from matplotlib.mathtext import MathTextParser
3131
from matplotlib._mathtext_data import uni2type1
3232
from matplotlib.path import Path

lib/matplotlib/ttconv.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""
2+
Converting and subsetting TrueType fonts to PS types 3 and 42, and PDF type 3.
3+
"""
4+
5+
from . import cbook
6+
from ._ttconv import convert_ttf_to_ps, get_pdf_charprocs # noqa
7+
8+
9+
cbook.warn_deprecated('3.3', name=__name__, obj_type='module')

setupext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def get_extensions(self):
413413
yield ext
414414
# ttconv
415415
ext = Extension(
416-
"matplotlib.ttconv", [
416+
"matplotlib._ttconv", [
417417
"src/_ttconv.cpp",
418418
"extern/ttconv/pprdrv_tt.cpp",
419419
"extern/ttconv/pprdrv_tt2.cpp",

src/_ttconv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static PyModuleDef ttconv_module = {
279279
#pragma GCC visibility push(default)
280280

281281
PyMODINIT_FUNC
282-
PyInit_ttconv(void)
282+
PyInit__ttconv(void)
283283
{
284284
PyObject* m;
285285

0 commit comments

Comments
 (0)