Skip to content

Commit 63bbce1

Browse files
committed
Add emoji to multi-font text
These characters are outside the BMP and should test subset splitting for type 42 output in PDF.
1 parent a101730 commit 63bbce1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/matplotlib/testing/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,13 @@ def _gen_multi_font_text():
276276
latin1_supplement = [chr(x) for x in range(start, 0xFF+1)]
277277
latin_extended_A = [chr(x) for x in range(0x100, 0x17F+1)]
278278
latin_extended_B = [chr(x) for x in range(0x180, 0x24F+1)]
279+
non_basic_multilingual_plane = [chr(x) for x in range(0x1F600, 0x1F610)]
279280
count = itertools.count(start - 0xA0)
280281
non_basic_characters = '\n'.join(
281282
''.join(line)
282283
for _, line in itertools.groupby( # Replace with itertools.batched for Py3.12+.
283-
[*latin1_supplement, *latin_extended_A, *latin_extended_B],
284+
[*latin1_supplement, *latin_extended_A, *latin_extended_B,
285+
*non_basic_multilingual_plane],
284286
key=lambda x: next(count) // 32) # 32 characters per line.
285287
)
286288
test_str = f"""There are basic characters

lib/matplotlib/tests/test_backend_svg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def test_svg_metadata():
526526

527527

528528
@image_comparison(["multi_font_aspath.svg"])
529-
def test_multi_font_type3():
529+
def test_multi_font_aspath():
530530
fonts, test_str = _gen_multi_font_text()
531531
plt.rc('font', family=fonts, size=16)
532532
plt.rc('svg', fonttype='path')
@@ -537,7 +537,7 @@ def test_multi_font_type3():
537537

538538

539539
@image_comparison(["multi_font_astext.svg"])
540-
def test_multi_font_type42():
540+
def test_multi_font_astext():
541541
fonts, test_str = _gen_multi_font_text()
542542
plt.rc('font', family=fonts, size=16)
543543
plt.rc('svg', fonttype='none')

0 commit comments

Comments
 (0)