| ▲ | Theodores 2 hours ago | |
DRY applies, even in SVG. Draw one horizontal line and then reuse it for the other horizontal lines. Same for the vertical lines. The advantage of this technique is that you can clone the master lines without having to repeat yourself with the stroke-width and other attributes. You can also specify just the x or just the y of the cloned line, thereby needing to specify x1, x2, y1 and y2 just once per master line, with x (or y) in the use elements being just the offset. Why bother? DRY. That is it. If you put the master lines in a 'defs' as symbols, then they can inherit some attributes from a 'g' (group), therefore enabling you to specify stroke-width just once. Non-scaling stroke widths can also be specified, meaning that you can scale up an A4 to an A0 without having fat lines. Since you want to make graph paper accessible to all, you can put a few words together in the 'desc' for that, and give the paper a 'title' specifying what it is, e.g. A4, 5mm spacing, with your URL. Nobody will ever care for these small changes, however, if you branch out into making paper for composers or other specialist use cases, these techniques might come in hand. | ||