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
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="اللَّهُ لا إِلٰهَ إِلّا هُوَ الحَيُّ القَيّومُ" />
CodePudding user response:
//Add this code in java file
textview.setTextDirection(View.TEXT_DIRECTION_ANY_RTL).
//And in textview
android:textDirection="anyRtl"
CodePudding user response:
The problem was with the letterSpacing for TextView in the themes. Removed it and everything works fine