Write a number inside ayah arabic unicode character

I am working on an android application and I am trying to write an Arabic number inside the ayah (() Arabic character in a textview. I tried to write the end of the character ay and then the arabic number without any space, but that did not work. I use the font uthmani.

I want to display it as shown in the image:

This is part of the code.

NumberFormat nf = NumberFormat.getInstance(Locale.forLanguageTag("AR")); temp+=" "+"\u06DD"+String.valueOf(nf.format(count))+" "; 

"\ u06DD" is the encoding (۝) in java.

The result was as follows:

+6
source share
3 answers

You can use a font called me_quran with these unicode U + FD3E + numbers + U + FD3F

 ﴿ ORNATE RIGHT PARENTHESIS Unicode: U+FD3F, UTF-8: EF B4 BF ﴾ ORNATE LEFT PARENTHESIS Unicode: U+FD3E, UTF-8: EF B4 BE 

You can download the font file here.

Usage example: Quran verse ends with numbers inside.

+1
source

Try something like this ﴾١٩٦﴿ which looks like & # xFD3E; 196 & # xFD3F;

+1
source

You can use ResplacementSpan to change the way aya is displayed

for example, so I did it

 public class EndOfAyaSpan extends ReplacementSpan { public RoundedBackgroundSpan(Context context) { super(); } @Override public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint) { float textSize = paint.getTextSize(); canvas.drawText("\u06dd ", 0, 1, x - textSize / 5, (float) y, paint); paint.setTextSize(textSize - textSize / 3); canvas.drawText(text, start, end, x, y - textSize / 5, paint); paint.setTextSize(textSize); } @Override public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) { return Math.round(paint.measureText(text, start, end)); } } 
0
source

All Articles