-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getBbox is incorrect in node.js #1267
Comments
Usually if you register your own font properly it should use that one to measure the dimensions. I would need the font file to test that issue |
@testerez @jameshowe @twilson90 In order to investigate this I need the font files. |
@Fuzzyma the custom font in the example is https://fonts.google.com/specimen/Mansalva (regular), but you can see it happens even with Arial fonts too. |
@jameshowe do you have an example for me with Arial? I guess thats easiest to replicate |
This was a while ago, I'm not sure I have the code anymore (presume that's what you are after). I'll have a look around. |
Ok so thankfully manage to find it, I've tried to strip it back to the smallest possible demonstrable PoC - I am able to replicate the same issue using Arial font with the following code:
For the packages:
|
Thanks will look into it once I find some time |
I'm trying to calculate the size of an SVG in node but I'm getting incorrect results.
Here is the SVG:
And the node.js code:
Result:
When calculating the bbox the same way in the browser, I'm getting the expected result:
(
width
andheight
are correct here)I've put together an example to compare node and browser results here: https://stackblitz.com/edit/nextjs-ct2xan?file=svgString.js
The text was updated successfully, but these errors were encountered: