I need to create SVG (with PHP and / or Javascript), where some SVG elements are icons from FontAwesome , but: without external dependencies (for example: importing a css file, etc.).
I found this stackoverflow question, which is similar to the topic, but not suitable for my problem, because there are external dependencies, such as adding FontAwesome (CSS files) to the web page that shows svg.
Another thing is that I need an All-in-one SVG, where all the necessary FontAwesome definition is part of svg, because the user must be able to download the generated SVG in order to continue working on it using the svg viewer or editor.
Is there a way to put the definition (for example) of one "Font Awesome" icon in one svg?
I found this (possibly) svg info list. So it looks like icon paths are available as SVG code. So who can I use this in svg?
// Update: I found the following example, but I donโt know how to enable the FontAwesome definition and how to access the icon: - (
<?xml version="1.0" standalone="yes"?> <svg width="100%" height="100%" version="1.1" xmlns = 'http://www.w3.org/2000/svg'> <defs> <font id="Font2" horiz-adv-x="1000"> <font-face font-family="Super Sans" font-weight="normal" font-style="italic" units-per-em="1000" cap-height="600" x-height="400" ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500"> <font-face-src> <font-face-name name="Super Sans Italic"/> </font-face-src> </font-face> <missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph> <glyph unicode="!" horiz-adv-x="300"></glyph> <glyph unicode="@"></glyph> </font> </defs> </svg>
css include svg icons font-awesome
The Bndr Aug 14 '13 at 7:46 a.m. 2013-08-14 07:46 a.m.
source share