8000 Move _text_layout to _text_helpers. · akiomik/matplotlib@6f7f72a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f7f72a

Browse files
committed
Move _text_layout to _text_helpers.
1 parent 319f24f commit 6f7f72a

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

lib/matplotlib/_text_layout.py renamed to lib/matplotlib/_text_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Text layouting utilities.
2+
Low-level text helper utilities.
33
"""
44

55
import dataclasses

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from PIL import Image
2525

2626
import matplotlib as mpl
27-
from matplotlib import _api, _text_layout, cbook
27+
from matplotlib import _api, _text_helpers, cbook
2828
from matplotlib._pylab_helpers import Gcf
2929
from matplotlib.backend_bases import (
3030
_Backend, _check_savefig_extra_args, FigureCanvasBase, FigureManagerBase,
@@ -2296,7 +2296,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
22962296
# List of (start_x, glyph_index).
22972297
multibyte_glyphs = []
22982298
prev_was_multibyte = True
2299-
for item in _text_layout.layout(
2299+
for item in _text_helpers.layout(
23002300
s, font, kern_mode=KERNING_UNFITTED):
23012301
if ord(item.char) <= 255:
23022302
if prev_was_multibyte:

lib/matplotlib/backends/backend_ps.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
import numpy as np
1919

2020
import matplotlib as mpl
21-
from matplotlib import _api, cbook, _path
22-
from matplotlib import _text_layout
21+
from matplotlib import _api, cbook, _path, _text_helpers
2322
from matplotlib.afm import AFM
2423
from matplotlib.backend_bases import (
2524
_Backend, _check_savefig_extra_args, FigureCanvasBase, FigureManagerBase,
@@ -613,7 +612,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
613612
font.set_text(s, 0, flags=LOAD_NO_HINTING)
614613
self._character_tracker.track(font, s)
615614
xs_names = [(item.x, font.get_glyph_name(item.glyph_idx))
616-
for item in _text_layout.layout(s, font)]
615+
for item in _text_helpers.layout(s, font)]
617616

618617
self.set_color(*gc.get_rgb())
619618
ps_name = (font.postscript_name

lib/matplotlib/textpath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77

8-
from matplotlib import _text_layout, dviread, font_manager, rcParams
8+
from matplotlib import _text_helpers, dviread, font_manager, rcParams
99
from matplotlib.font_manager import FontProperties, get_font
1010
from matplotlib.ft2font import LOAD_NO_HINTING, LOAD_TARGET_LIGHT
1111
from matplotlib.mathtext import MathTextParser
@@ -149,7 +149,7 @@ def get_glyphs_with_font(self, font, s, glyph_map=None,
149149

150150
xpositions = []
151151
glyph_ids = []
152-
for item in _text_layout.layout(s, font):
152+
for item in _text_helpers.layout(s, font):
153153
char_id = self._get_char_id(font, ord(item.char))
154154
glyph_ids.append(char_id)
155155
xpositions.append(item.x)

0 commit comments

Comments
 (0)
0