Search code examples
androidstringfontstextviewarabic

Arabic font is not displayed correctly in TextView


trying to add Arabic text to my project, but two problems arise:

  • the glyph for the letters ل and ا is not matched (لا)
  • the vowels aren't spaced correctly

It looks like: enter image description here

This is not a problem with the font, because in other programs it works as it should? textDirection="anyRtl" doesn't help

TextView:

<TextView
    android:id="@+id/text_ayah_text"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:fontFamily="@font/uthman_taha_naskh_regular"
    android:textSize="34sp"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toEndOf="@id/barrier"
    app:layout_constraintTop_toTopOf="parent"
    tools:text="اللَّهُ لا إِلٰهَ إِلّا هُوَ الحَيُّ القَيّومُ" />

Solution

  • The problem was with the letterSpacing for TextView in the themes. Removed it and everything works fine