Posts

Showing posts with the label svg

Rails : How to put I18N into SVG file

Rails : How to put I18N into SVG file I want to internationalize several SVG files but I have no idea how I could do that. Here's my SVG file : <text font-family="OpenSans-Semibold, Open Sans" font-size="22" font-weight="500" fill="#FFFFFF"> <tspan x="39" y="157">Accessoires</tspan> </text> Should I do something like : <text font-family="OpenSans-Semibold, Open Sans" font-size="22" font-weight="500" fill="#FFFFFF"> <tspan x="39" y="157"><%= t('accessoires') %></tspan> </text> Or is there an other way to do it ? Thanks for your answers. @RobertLongson what kind of joke is that ? – Enner31 Jul 2 at 13:07 1 Answer ...

How to interpolate SVG path into a pixel coordinates (not simply raster) in Python

Image
How to interpolate SVG path into a pixel coordinates (not simply raster) in Python I need to convert an SVG description of a path, ie. something like: M400 597 C235 599 478 607 85 554 C310 675 2 494 399 718 C124 547 569 828 68 400 C-108 317 304 703 96 218 L47 215 L400 290 C602 -146 465 467 550 99 L548 35 L706 400 L580 686 C546 614 591 672 529 629 L400 597 Z M400 597 C235 599 478 607 85 554 C310 675 2 494 399 718 C124 547 569 828 68 400 C-108 317 304 703 96 218 L47 215 L400 290 C602 -146 465 467 550 99 L548 35 L706 400 L580 686 C546 614 591 672 529 629 L400 597 Z into a list of all the pixels that would fall along that path (assuming the canvas is the size of the monitor. As you can see, the paths I need to work with amount to scribbles and are quite complex. Ideally, I'd like to generate such a path and then convert the entire thing to a pixel-by-pixel description, ie. p= [(403, 808), (403, 807), (403, 805), (403, 802), (403, 801), (403, 800), (403, 799), (403, 797), (403, 794), (4...