Is there any way to get a material symbol as an Im...
# compose
e
Is there any way to get a material symbol as an ImageVector that has the same dimensions as a regular material icon? e.g. https://fonts.google.com/icons?icon.query=diagnosis
a
Copy the SVG into https://www.composables.com/svgtocompose. Or import it into Android Studio, and use the SVG to Compose plugin.
e
I did that, and I copied the composable version from composables.com but the size is still bigger than a standard icon
a
Bigger how? It should still be 24dp, but perhaps symbols don't have additional padding around the icon itself (inset).
Perhaps a screenshot comparison would help
e
image.png
a
Double check what default size is. Should be 24dp unless you used some other tool.
I've seen some that default to 40dp for example
e
cc @Alex Styl
a
e
Getting the SVG from here and getting compose code for it from https://www.composables.com/svgtocompose or the SVG to Compose plugin result in an
ImageVector
that doesn't render
Was able to get it how I wanted it by scaling the path operations to match the scaling of the viewport from 40 to 24
a
@eygraber sorry just saw your message. thanks for sharing the svg, will have a look asap. For future reference there is also https://www.composables.com/icons where you can find the material symbols already converted to compose. haven't tested the specific icon, but it is worth checking out
e
@Alex Styl I had the same issue getting the symbol from composables.com; looks like it's using 40dp instead of 24dp and the viewport is all wacky. It's happening for other symbols/icons as well
a
was worth a shot 😄 this might be a combination of things such as the icons from google having an issue with the sizing (there was a case like this a while ago, hopefully this is fixed now and I need to update them on my end) or something is up with the converter. im cooking something new for composables (out in a few days) and as soon as that is done ill have a proper look into the icons
thank you color 1
y
You can also create your icon pack using plugin https://github.com/ComposeGears/Valkyrie
a
@Yahor is that compose running <inside> intellij??
y
Yes, plugin written using Compose Multiplatform
🤯 1
a
really cool
❤️ 1