We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8ce760 commit c784919Copy full SHA for c784919
lib/matplotlib/tests/test_backend_ps.py
@@ -207,3 +207,18 @@ def test_type42_font_without_prep():
207
mpl.rcParams["mathtext.fontset"] = "stix"
208
209
plt.figtext(0.5, 0.5, "Mass $m$")
210
+
211
212
+@pytest.mark.parametrize('fonttype', ["3", "42"])
213
+def test_fonttype(fonttype):
214
+ mpl.rcParams["ps.fonttype"] = fonttype
215
+ fig, ax = plt.subplots()
216
217
+ ax.text(0.25, 0.5, "Forty-two is the answer to everything!")
218
219
+ buf = io.BytesIO()
220
+ fig.savefig(buf, format="ps")
221
222
+ test = b'/FontType ' + bytes(f"{fonttype}", encoding='utf-8') + b' def'
223
224
+ assert re.search(test, buf.getvalue(), re.MULTILINE)
0 commit comments