2016-01-27 21 views
6

Android uygulamasında çalışıyorum ve ayah sembolünün (۝) arapça sonu içinde arapça sayıyı textview içine yazmaya çalışıyorum. Bir ayah sembolünün sonuna, arapça numarasına hiç boşluk bırakmaya çalıştım ama işe yaramadı. Uthmani yazı tipini kullanıyorum.ayah end arapça unicode sembolü içinde sayıyı yaz

bu resimdeki gibi göstermek istiyorum:

Bu kod

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

parçasıdır "\ u06DD" java (۝) şifreleme olduğunu.

sonuçta aşağıdaki gibi oldu:

+1

Salem ayah sembolü ile arka plan olarak ayah sembolü. –

cevap

0

Sen aya numarası bu nasıl yaptığımı olan örneğin

oluşturulma biçimini değiştirmek için ReplacementSpan kullanabilirsiniz

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)); 
    } 

} 
1

me_quran adlı bu fontu unicodes ile kullanabilirsiniz kullanım U + FD3E + numara + 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 from here

Örnek: Quran Verse end with numbers inside

1

# xFD3E & benziyor bu ﴾١٩٦﴿ gibi bir şey deneyin; 196 & # xFD3F;