Open risalfajar opened 2 years ago
I think sizing with modifiers works just fine.
Icon(
FontAwesomeIcons.Brands.Github,
modifier = Modifier.size(24.dp)
)
@BreimerR well that can be a temporary workaround. For long term it will add more boilerplate to our code, remembering icon size each time we use icons is a hassle too.
The project when generating use the same svg size values when generating. You could easily create a custom Composable to sets your preferred font size and use it. This is actually the only way possible to do this. If I would be doing on Compose-Icons side, would be the same thing, a custom composable for that.
CompositionLocals is not an option in this case because the fonts code does not use @Composable.
I will close this because this is not something that I would change to be honest. Unless everyone thinks that compose-icons
should provide a custom Icon
Composable with the size
set by default.
what about changing the value of defaultWidth
, defaultHeight
, viewportHeight
, and viewportWidth
to match the Compose standard? I found this in androidx.compose.material.icons
Using FA icons:![image](https://user-images.githubusercontent.com/28381124/144738616-cd717af3-288d-42e0-92f2-0cbd917287d1.png)
Using Jetpack Compose built-in Icons:![image](https://user-images.githubusercontent.com/28381124/144738642-28acdf7a-f3bf-47c2-8625-4f30cfa9f3ca.png)
I am just using
IconButton
andIcon
normally. I think there is something wrong with FA icons vectors, looking at the code from any icons from FA, it have its own viewport width and height: