Skip to content

Question: how do I specify dimensions and sizes in cm or mm? #85

Answered by cduck
danaki asked this question in Q&A
Discussion options

You must be logged in to vote

drawSvg does not officially support units but SVGs do, sort of. I recommend using Drawing.setPixelSize() to scale your drawing so a 1 in your drawing corresponds to 1mm. You have to decide how big a standard "pixel" is. This depends on how you view the SVG.

For questions like this that apply to SVGs in general, try Googling "SVG how do I specify dimensions and sizes in cm or mm?".
Here's one result: https://jenkov.com/tutorials/svg/svg-viewport-view-box.html

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by danaki
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #84 on January 16, 2023 22:17.