when I want to use Font with variable font weight (wght
tag) - specifically Public Sans - and the font is registered in XML file like this (with fontVariationSettings
):
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:fontStyle="normal"
android:fontWeight="100"
android:font="@font/public_sans_variable_font_wght"
android:fontVariationSettings="'wght' 100" />
<!-- ... all weights up to 900 -->
</font-family>
it looks like the weight is not properly reflected in Android Studio Design pane for old kind XML layouts and not even for the font XML. However during application runtime, text is properly rendered.
(Design left, runtime right)
With Jetpack Compose, it's consistent - in both, Design (using @Preview
) and during runtime it's correct.
With static fonts (separate bold
, regular
files, etc., this was not an issue.)
Is this known issue of Android Studio (I am running on latest stable AS: Android Studio Bumblebee | 2021.1.1
), or is something not properly setup in that XML?
Thanks for any help.