From 62872d3da73dfb69c6ec84d419f66cd8ae90bc11 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 18 Apr 2024 23:34:37 +0800 Subject: [PATCH] Add a test for typesetting quotation marks (#3179) --- .../baseline/test_text_quotation_marks.png.dvc | 5 +++++ pygmt/tests/test_text.py | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pygmt/tests/baseline/test_text_quotation_marks.png.dvc diff --git a/pygmt/tests/baseline/test_text_quotation_marks.png.dvc b/pygmt/tests/baseline/test_text_quotation_marks.png.dvc new file mode 100644 index 00000000000..2a1cf6296d3 --- /dev/null +++ b/pygmt/tests/baseline/test_text_quotation_marks.png.dvc @@ -0,0 +1,5 @@ +outs: +- md5: 90d08c5a11c606abed51b84eafcdea04 + size: 1662 + hash: md5 + path: test_text_quotation_marks.png diff --git a/pygmt/tests/test_text.py b/pygmt/tests/test_text.py index 1ef6a19bc11..9d52f2629af 100644 --- a/pygmt/tests/test_text.py +++ b/pygmt/tests/test_text.py @@ -419,3 +419,16 @@ def test_text_nonascii(): fig.text(x=1, y=1, text="xytext:°α") # noqa: RUF001 fig.text(x=[5, 5], y=[3, 5], text=["xytext1:αζΔ❡", "xytext2:∑π∇✉"]) return fig + + +@pytest.mark.mpl_image_compare +def test_text_quotation_marks(): + """ + Test typesetting quotation marks. + + See https://github.com/GenericMappingTools/pygmt/issues/3104. + """ + fig = Figure() + fig.basemap(projection="X4c/2c", region=[0, 4, 0, 2], frame=0) + fig.text(x=2, y=1, text="\\234 \\140 ' \" \\216 \\217", font="20p") + return fig