2 ms·
I'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 hype
by kevin_thibedeau 10y ago
I'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)