From 2e520286ef118fc66f9eb08bddafebd41d285f0c Mon Sep 17 00:00:00 2001 From: Sohel Date: Mon, 18 Nov 2024 13:31:07 +0100 Subject: [PATCH] added hershey font test --- plotter-app/test_hershey.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plotter-app/test_hershey.py diff --git a/plotter-app/test_hershey.py b/plotter-app/test_hershey.py new file mode 100644 index 0000000..96a5bfb --- /dev/null +++ b/plotter-app/test_hershey.py @@ -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()