Skip to content

Commit af2f321

Browse files
committed
modified text generation for higher resolution output
1 parent f24c4f3 commit af2f321

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stl_tools/text2png.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import matplotlib.pyplot as plt
55

66

7-
def text2png(text, fn=None, fontsize=100):
7+
def text2png(text, fn=None, fontsize=100, dpi=100):
88
"""
99
Renders inputted text to a png image using matplotlib.
1010
@@ -26,10 +26,10 @@ def text2png(text, fn=None, fontsize=100):
2626
transform=ax.transAxes,
2727
fontsize=fontsize)
2828
ax.set_axis_off()
29-
ax.autoscale_view(True, True, True)
29+
#f.set_size_inches(18.5,10.5)
3030
if not fn:
3131
fn = ''.join(e for e in text if e.isalnum())
32-
f.savefig(fn + '.png', bbox_inches='tight')
32+
f.savefig(fn + '.png', bbox_inches='tight', dpi=dpi)
3333
plt.close()
3434

3535

0 commit comments

Comments
 (0)