diff --git a/TODO.md b/TODO.md index 618a828..4878b8b 100644 --- a/TODO.md +++ b/TODO.md @@ -19,8 +19,6 @@ the library and/or command line (we just use 9600 baud). SIGINT has stopped a plot. * Make 'plotcancel()' work properly. Install a signal handler in 'plotbegin()' to call it if/when we get a signal. -* Add support for line styles. We could use dotted and dashed lines -for some of the plots, e.g. fold lines, centre lines. * Add support for read-back commands when the interface allows them. E.g. 'OS', 'OA' and 'OI'. * Add support for automatic paper feed on HP 7550 and any other plotters @@ -97,6 +95,7 @@ command-line arguments and low-level driver code. * Add new drawings! Especially colouring-in drawings, all-over patterns, 3D perspective drawings, maps and even slow-to-draw drawings! * Add colour (pen changes) to drawings. +* Add line styles (dotted, dashed) to drawings. * Add drawings that can be folded like Origami. * Add drawings that can be cut out and assembled, e.g. geodesic dome, packaging such as cake boxes, decorations such as snowflakes. diff --git a/hpgllib.c b/hpgllib.c index c0cacb7..e81d3e1 100644 --- a/hpgllib.c +++ b/hpgllib.c @@ -881,6 +881,17 @@ void pencolr(int c) } +/** + * @brief Set the line type + * + * @param t The line type to be set + */ +void linetype(const int t) +{ + fprintf(Plt, "LT%d;\n", t); +} + + /** * @brief Draw a text label vertically * diff --git a/hpgllib.h b/hpgllib.h index 87115ba..515346c 100644 --- a/hpgllib.h +++ b/hpgllib.h @@ -76,6 +76,7 @@ void arc(const double x, const double y, const double a); void ellipse(const double x0, const double y0, const double a, const double b, const double theta); void roundrect(const double x1, const double y1, const double x2, const double y2, const double radius); void pencolr(int c); +void linetype(const int t); void vlabel(const double x, const double y, const double siz, const char *const str); void hlabel(const double x, const double y, const double siz, const char *const str); int writedisplay(const char *const str);