islamic-network / api.alquran.cloud

The AlQuran.Cloud API - https://alquran.cloud/api
GNU General Public License v3.0
226 stars 41 forks source link

How to render Tajweed text that I get from api #20

Closed MahmoudMabrok closed 5 years ago

MahmoudMabrok commented 5 years ago

here for example http://api.alquran.cloud/v1/surah/114/quran-tajweed i got
ٱلَّذِى يُوَسْوِسُ فِى صُدُورِ [h:14688[ٱ][l[ل][g[نّ][p[َا]سِ how to render it into text to use it in TextView

meezaan commented 5 years ago

Al Salaamu Alaykum. See https://alquran.cloud/tajweed-guide.

MahmoudMabrok commented 5 years ago

is there a way to render in java to be used in android?

meezaan commented 5 years ago

I have not written one and am not aware of one.

haroonkhankhattak commented 2 years ago

is there a way to render in java to be used in android?

yeah just change each css tajweed tag to with CNTRL + R and class name tag to some color i.e. #894955 parse it in textview like this it works for me

binding.text.setText(HtmlCompat.fromHtml( "۞ ٱللَّهُ نُورُ ٱلسَّمَـٰوَٲتِ وَٱلْأَرْضِ‌ۚ مَثَلُ نُورِهِۦ كَمِشْكَوٲةٍ فِيهَا مِصْبَاحٌ‌ۖ ٱلْمِصْبَاحُ فِى زُجَاجَةٍ‌ۖ ٱلزُّجَاجَةُ كَأَنَّهَا كَوْكَبٌ دُرِّىٌّ يُوقَدُ مِن شَجَرَةٍ مُّبَـٰرَكَةٍ زَيْتُونَةٍ لَّا شَرْقِيَّةٍ وَلَا غَرْبِيَّةٍ يَكَادُ زَيْتُهَا يُضِىٓءُ وَلَوْ لَمْ تَمْسَسْهُ نَارٌ‌ۚ نُّورٌ عَلَىٰ نُورٍ‌ۗ يَهْدِى ٱللَّهُ لِنُورِهِۦ مَن يَشَآءُ‌ۚ وَيَضْرِبُ ٱللَّهُ ٱلْأَمْثَـٰلَ لِلنَّاسِ‌ۗ وَٱللَّهُ بِكُلِّ شَىْءٍ عَلِيمٌ ٣٥" ,HtmlCompat.FROM_HTML_MODE_LEGACY))