The pictures are circled in the center of the screen.

1 picture does not display the phone Xiaomi Redmi 4a

enter image description here

On 2 pictures, everything is good phone Xiaomi Redmi Note 5

enter image description here

On the 3 pictures, too, everything is good Honor 9 lite

enter image description here

<Chronometer android:id="@+id/cmTimer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" android:fontFamily="@font/digital7momo" android:textColor="@color/colorRed" android:textSize="40sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> 

OS versions

  1. Xiaomi Redmi 4a - Android 7.1, MIUI 10.2
  2. Xiaomi Redmi Note 5 - Android 8.1, MIUI 10.2
  3. Honor 9 Lite - Android 8.0, EMUI LLD-L31 8.0.0.144 (C10)

What could be the problem?

  • You can see by eye that in the picture below the font size is larger, it doesn’t fit therefore "sinks down." - Style-7
  • @ Style-7 The point is not that, but the fact that the font on 1 picture does not coincide with the others - Kzz xD
  • and I'm not saying that it does not match, I compare the lower and middle picture, the size is different (attempt number 2) - Style-7
  • and how do you load your font? - Andrey Mihalev
  • @AndreyMihalev in xml file via android: fontFamily - Kzz xD

1 answer 1

Made the font change programmatically, everything works

 Typeface typeface = ResourcesCompat.getFont(getContext(), R.font.digital7momo); cmTimer.setTypeface(typeface); 
  • Also noticed such that, android: fontFamily = "@ font / digital7momo" does not always work. And why? - DuosDuo pm
  • @DuosDuo I don’t know why so - Kzz xD