javascript - Does path.getTotalLength work for text svg? - Stack Overflow
I'm trying to get the path length for the stroke of a SVG text element and I'm getting a path.getTotalLength is not a function
error in my console. When I look up getTotalLength
, I see that it's been depreciated? It looks like it has something to do with the shift from SVG1 to SVG2? Is this correct?
I'm trying to get the path length for the stroke of a SVG text element and I'm getting a path.getTotalLength is not a function
error in my console. When I look up getTotalLength
, I see that it's been depreciated? It looks like it has something to do with the shift from SVG1 to SVG2? Is this correct?
- I don't think it never did have this method... – Kaiido Commented Apr 4, 2017 at 6:01
- What do you think the total length of text is? How would you calculate it? – Robert Longson Commented Apr 4, 2017 at 7:13
1 Answer
Reset to default 5It has not been deprecated. In SVG 1.1, getTotalLength()
is only available on the <path>
element.
In SVG 2, which browsers are still in the process of implementing (so you can't rely on it yet), getTotalLength()
is available on all shape elements, but not including text elements.
- Python Selenium Error - Sandbox cannot access executable - Stack Overflow
- python - Html in the inspect element is different that the one displayed on screen - Stack Overflow
- swift - Content inside .sheet() being infinitely called - Stack Overflow
- reactjs - Why getting error 'Objects are not valid as a React child' in turborepo ui tests? - Stack Overflow
- maven - How can I get the dependencies about the master code of mule? - Stack Overflow
- uart - MH-z19b stop working after 999999 millis (NodeMCU v3 ESP8266 12F) - Stack Overflow
- java - I have an issue with tmcbeans, I can not run projects - Stack Overflow
- google colaboratory - Load a Kaggle dataset into Colab notebook without extracting it - Stack Overflow
- javascript - Unable to create a framebuffer with an RGBA32F texture - Stack Overflow
- sharepoint - How to copy site page from one site to another site using Power Automate? - Stack Overflow
- python - How to display only the tags translated into the corresponding language on a multilingual site? - Stack Overflow
- c# - How to add image as an input to a ChatMessage with Microsoft.Extensions.AI - Stack Overflow
- python - Tkinter: custom frame widget overrides columnconfigure - Stack Overflow
- javascript - React Leaflet custom marker with NextJS window undefined - Stack Overflow
- Composing dependent functions in Lean - Stack Overflow
- epub - When extracting Kobo bookmarks frm KoboReader.sqlite, how do I determine pageslocations - Stack Overflow
- python - Newton raphson fails to approximate beyond two decimal points - Stack Overflow