3 ms·
For anyone who is a web hacker rather than a designer, I highly suggest trying out SVG here and there in your web projects. SVG is a fantastic bridge for anyone
by _nato_ 10y ago
For anyone who is a web hacker rather than a designer, I highly suggest trying out SVG here and there in your web projects. SVG is a fantastic bridge for anyone who wants to put some graphics (dynamic or otherwise) in place, is used to just having copy as content, and/or is a bit afraid of opening PS/Gimp.
- kevin_thibedeau 10y agoI'll second that. I converted a script that rendered images with Tk's canvas over to Cairo. Cairo's SVG output converts text to curves which makes embedded hyperlinks impractical. I added direct conversion to SVG and got nice results in short order. The big problem when doing layouts for SVG outside of a browser is determining the bounding box for text. The best I can do is get a box from Pango and hope browsers render text close to the same way.
- aidos 10y agoAh ha haaaa...I've spent a lot of time on this this week. I currently render the text inside phantom (headless chrome) so I can correct the positions. Do you have an example of using pango? (Ps, I now know the murky details of exactly how Firefox, chrome and Inkscape calculate their bounding box and clientBoundingRect, which is sort of sad but just the life of a coder I guess)