Replies: 2 comments 1 reply
-
The short answer is no. Given that the Viewbox isn't helpful to you, it seems you're wanting the dimensions (bounds) of each individual display element. And that's not readily accessible because each element has different attributes that define or at least affect their bounds (eg 'd' attribute in path elements, 'r' attribute in circle elements, and of course all the complications of assessing dimensions of text elements with seemingly endless font attributes); and don't forget to consider the complications of stroke widths, and various affine transformations that may be applied to individual elements or groups of elements. |
Beta Was this translation helpful? Give feedback.
-
Yep, I could have added clip paths to my list above. |
Beta Was this translation helpful? Give feedback.
-
I'm developing a font editor for pasting colored SVGs with offset and size adjustments.
Using another SVG rendering library, I encountered an error in determining the real size and image offset on some files (with masks and cut-off area) - instead of ~3 digits I get ~7 digits...
I need not viewBox and width / height, but the corners of a real image (paths, rectangles, bitmaps).
Does your library have the ability to get the minimum-maximum coordinates of the entire SVG image or individual named elements?
Current version with font samples
Beta Was this translation helpful? Give feedback.
All reactions