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
I don't think this is possible for all icon packs because there is icon packs that the icons does not follow the same scale, for example one could be 32x32 and another 32x48 or so.
Using FA icons:
Using Jetpack Compose built-in Icons:
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: