Why is fontStyle hardcoded to Italic in the jetpac...
# compose-android
d
Why is fontStyle hardcoded to Italic in the jetpack compose framework implementation?
Copy code
private fun buildStyledTypeface(fontWeight: FontWeight, fontStyle: FontStyle) =
        if (Build.VERSION.SDK_INT < 28) {
            Typeface.create(
                nativeTypeface,
                getAndroidTypefaceStyle(fontWeight, fontStyle)
            )
        } else {
            TypefaceHelperMethodsApi28.create(
                nativeTypeface,
                fontWeight.weight,
                fontStyle == FontStyle.Italic
            )
        }
s
fontStyle == FontStyle.Italic
looks like a check if it’s italic, rather than a hardcoding of it? Where does this code exist?
d
ah - you're right - thank you
i misread it
the code is correct
i don't often see that kind of syntax in codebases so it threw me off