What surprises me about the omission of dashed lines is that every graphics API I'm familiar with (Xlib, PostScript, Java 2D) supports dashed lines. Unless there is some important platform out there that does not support them in the underlying graphics library, it seems to me that it would have been trivial to add dashed lines to the API.

And, I can't think of any simple or efficient way to simulate dashed lines without having them in the API. And while dashed lines may not be a high-use feature, I wouldn't say they're infrequently used. For example: when drawing a line chart with multiple lines which is intended to be printed on a black-and-white laser printer.

        David Flanagan

Ian Hickson wrote:
On Fri, 17 Jun 2005, David Flanagan wrote:

Does the <canvas> tag really have no way to draw dashed and dotted lines? It seems to have everything else. Is this an oversight in the spec?


Correct, it doesn't have stroke styles other than gradients, patterns, and solid colours. It was an intentional omission since it was not considered a high-use feature. (Similarly, text is not available in Canvas; you have to overlay HTML if you want to mix text with the graphics.)


Reply via email to