added hershey font test
This commit is contained in:
16
plotter-app/test_hershey.py
Normal file
16
plotter-app/test_hershey.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Minimalistic code for easy start
|
||||
from HersheyFonts import HersheyFonts
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
|
||||
def draw_line(x1, y1, x2, y2):
|
||||
plt.plot([x1,x2],[y1,y2])
|
||||
|
||||
thefont = HersheyFonts()
|
||||
thefont.load_default_font()
|
||||
thefont.normalize_rendering(100)
|
||||
for (x1, y1), (x2, y2) in thefont.lines_for_text('Wallter is a wall plotter'):
|
||||
draw_line(x1, y1 ,x2 ,y2)
|
||||
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user