[SOLVED] Does SVG Loader support text?

svg

#1

I have tried to load a very basic svg file which contains text, and it never displays the text, is this not supported?

For example I saved the svg found here…

and replaced the tiger svg in the exampes (https://threejs.org/examples/?q=svg#webgl_loader_svg) with that but it wont display. Am i missing something?


#2

You probably are missing something, but we can’t help you if you don’t show us your code! Could you upload a minimal example to http://jsfiddle.net/ ?


#3

Hi!
Have a look at the source code of THREE.SVGLoader()


The loader simply doesn’t parse that text node.
If to trust this article, SVG processes the rendering of text internally:
Each glyph consists of some sort of identifier (in some cases a string, in other cases a number) along with drawing instructions for rendering that particular glyph.

In your case, may be you can combine/extend this loader with THREE.FontLoader() and THREE.Font() somehow, getting something like that of the text from svg:
https://threejs.org/examples/?q=text#webgl_geometry_text_shapes


#4

Thanks alot for the response and confirming what I thought.


#5

You’re welcome :slight_smile: