4 ms·
M (MoveTo) and Q (Quadratic Bézier Curve) are part of the svg spec. They’re drawing commands. I’d agree that pn seems a little obtuse, but I guess I can see wh
by aidos 4y ago
M (MoveTo) and Q (Quadratic Bézier Curve) are part of the svg spec. They’re drawing commands.
I’d agree that pn seems a little obtuse, but I guess I can see what it’s doing.
Having worked with svg a lot (we build something sort of in the cad space) I can definitely see the desire for something less terse when you’re defining svgs. We end up generating svg fragments using react, for the most part, which works fairly well.
- throwaway4good 4y agoYes. Those codes are from the SVG spec as is the space vs. comma syntax. But it is really good way to program? Or is something that is done as a compromise between being able to program by hand, and have a format for drawing programs to save their files in without them being silly big.
- aidos 4y agoWell, like it or not that stuff is a) here to stay and b) familiar for people working with this tooling. Personally I find that graphics part pretty easy to read. For comparison here's a sample of a graphics stream from a PDF: Q 9469 1441 m 9549 1433 l 9549 1433 9549 1483 9469 1441 c S q In this context Q means push/save the graphics state and q is pop, but again, it's all very similar.
- throwaway4good 4y agoSure. But if you are designing something new it is fair to question whether to continue the style. An alternative is to have two representations; a binary format to be used by computers and a textual format for humans (programmers) designed for readability, maintainabilty etc.
- josefx 4y ago> In this context Q means push/save the graphics state and q is pop, but again, it's all very similar. is there a point in saving one or two letters on each command? Shld w ll g bck t th gd ld dys f C nd drp rndm lttrs?
- throwaway4good 4y agoYou will save space and make the language suitable as a format for computer programs to work directly with (saving in, sending to printer etc.). However compared to a binary version, this format probably uses 3 times as much space.
- scythe 4y agoI would imagine that any syntax transformation can't be much better (if at all) than a simple text compression algorithm, so I don't think disk size should be a design endpoint. But the amount of information that fits on one screen without scrolling is also part of readability, because understanding why something is there can be as important as understanding its literal meaning.
- samatman 4y agoBy analogy, what you're asking for is the ability to type `delete3words` instead of `d3w` in Vim. You might think you want that, what you actually want is to take an index card and write the SVG path abbreviations next to their long names, and put it by your keyboard while you work. Won't need it for long.