2

I have some textview, which i show using RecyclerView, and i store the string which the text is Arabic. But I wanna change the type of font, into another Style of arabic.

If you know the kind of app, Quran App. Thats it. The default font style i retrieve is not that good. So I want to change it style with using another Font style. How i do that ? thanks.

Before I try the

this is the simple code xml of textview. And i wanna change that fontstyle of the text

<TextView
    android:id="@+id/theText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="صِرَاطَ الَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ الْمَغْضُوبِ عَلَيْهِمْ وَلَا الضَّالِّينَ"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:textSize="20sp"
    />

this is what a i tried

 textView = findViewById(R.id.theText);
    Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/QCF_P187");
    textView.setTypeface(typeface);

It doesn't work.

I'm not an arabic. I just try change the font of the string that i receive which is arabic. And I want to change the style of it to another TTF file

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0