Check out this JsFiddle demo:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="material-icons">add add add add</div>
<svg width="100%" height="100%" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="MyPath" d="M 100 200
C 200 100 300 0 400 100
C 500 200 600 300 700 200
C 800 100 900 100 900 100" />
</defs>
<use xlink:href="#MyPath" fill="none" stroke="red" />
<text class="material-icons">
<textPath xlink:href="#MyPath">add add add add</textPath>
</text>
<!-- Show outline of the viewport using 'rect' element -->
<rect x="1" y="1" width="998" height="298" fill="none" stroke="black" stroke-width="2" />
</svg>
In the demonstration above, I utilized the 'Material Icons' font to create a unique character for the letter combination "add". This is achieved through ligatures.
To apply the 'Material Icons' font to text within a <div>
, I used the class attribute class="material-icons"
. However, when attempting to do the same within a <text>
node inside an <svg>
, the characters are not displayed.
If the class="material-icons"
attribute is removed from the <text>
node, the text appears without the desired font styling:
Does anyone have any suggestions or solutions for this issue?