Is there a D3.js method for converting a text element into a path element?
So when I understand the generated SVG, then I can keep my texts shapes.
To access vector path information about the size of individual characters in system or web fonts There is no way in javascript (D3 or other device). This is a requested feature for SVG2, but there is no solid offer for how it will work.
The Rafael method uses a font object that has already been converted to JavaScript, by using it. Unfortunately, Cufon was created for SGG, not the old IE VML language, so that you have to add an additional conversion (or use of Raphael) to convert to SVG path data.
To work with SVG, using the normal font-converter tool to convert to SVG fonts can be easy, then remove glyph data and change it to the correct size and flip y Do-Axis). Alternatively, if you are working on a server, you can use a lower-level graphic library such as Cairo that can route paths by text Unfortunately, the SVG font support in the browser is so bad that you do it directly Font can not use it to embed data (even assuming you had the right to distribute the font, but for other reasons webfone Was not used).
Update: Remind me of the inkcache in the comments reminded me. You may be able to use it in the server workflow; One of the text-to-path export options is that you must understand one of the ways to set it up so that the InkSpap program has full access to the font on your server, and then shortlists the SVG through the D3 routine through the options of the inkscape Can be created together:
inkscape TEMP.FILENAME --export-plain-svg = FILENAME - Export-Text-To-Path
In DOM The text-to-image option is the HTML canvas only; You can write on canvas and then get image data. But it will be a PNG image, not a vector.
However, I urge you to consider whether you really need exact figures of letters in specific fonts, and if it is worth to lose functionality, access and SEO benefits Text as Text
Comments
Post a Comment