在Ayah End Arabic Unicode符号中写一个数字

发布于 2025-02-10 11:33:41 字数 513 浏览 2 评论 0 原文

我正在研究Android应用程序,并且正在尝试将Ayah符号(۝)阿拉伯语末端中的阿拉伯语编写到TextView中。 我试图编写Ayah符号的结尾,然后写阿拉伯数字,没有任何空间,但没有用。我正在使用Uthmani字体。

我想像此图片一样显示它:

“”

这是代码

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

“ \ u06dd”的一部分,是(۝)的编码在爪哇。

结果变得如此:

“”

I'm working on android application and I'm trying to write arabic number inside arabic end of ayah symbol (۝) into textview.
I've tried to write the end of ayah symbol then the arabic number without any space but it didn't work. I'm using uthmani font.

I want to display it like this picture:

This is part of the code

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

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

The result became like this:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

维持三分热 2025-02-17 11:33:41

您可以使用这些UNICODES U + FD3E +数字 + u + u + fd3f

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

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

您可以从此处从此处下载font文件

usage usage euseage exame
”中的数字

You can use font named me_quran with these unicodes 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 from here

Example of usage:
Quran Verse end with numbers inside

冷清清 2025-02-17 11:33:41

尝试这样的东西﴾ ١٩٦﴿ 看起来像﴾١٩٦﴿

Try something like this ﴾١٩٦﴿ which looks like ﴾١٩٦﴿

空袭的梦i 2025-02-17 11:33:41

在Flutter中,您可以使用 quran 软件包。 getVerseendSymbol(int versenumber)函数将返回带有给定的经文号码的Aya End符号。

示例:

Text(
      quran.getVerse(18, index + 1) + getVerseEndSymbol(index + 1),
      textAlign: TextAlign.right,
),

这将返回带有给定经文号码的符号。

In Flutter, you can use quran package. getVerseEndSymbol(int verseNumber) function will return aya end symbol with the given verse number.

Example:

Text(
      quran.getVerse(18, index + 1) + getVerseEndSymbol(index + 1),
      textAlign: TextAlign.right,
),

This will return the symbol with the given verse number.

enter image description here

囍笑 2025-02-17 11:33:41

我刚刚扭转了格式,它起作用

NumberFormat nf = NumberFormat.getInstance(Locale.forLanguageTag("AR"));
textView.setText(String.valueOf(nf.format(285))+"\u06DD");

(字体是Roboto)

I just reversed the format and it worked

NumberFormat nf = NumberFormat.getInstance(Locale.forLanguageTag("AR"));
textView.setText(String.valueOf(nf.format(285))+"\u06DD");

(font was roboto)

‖放下 2025-02-17 11:33:41

If you are using uthmanic font "KFGQPC Uthmanic Script HAFS Regular", you just enter a number in arabic like this "٤٤" and it will be rendered as end verse symbol with the number:
just typed the arabic number

不交电费瞎发啥光 2025-02-17 11:33:41

为了迅速使用此代码,用于古兰经AYA结束代码的加法:

let arabicAyaStyle = "\u{FD3F}" + "\(getArabicDigitFor(value:verseObj.verseId))" + "\u{FD3E}"

附加ArabicaySustyle以结束任何AYA文本。

func getArabicDigitFor(value:Int) -> String
    {
        let numberToConvert = NSNumber(value: value)

        let formatter = NumberFormatter()

        let arLocale = Locale(identifier: "ar")
        formatter.locale = arLocale

        return formatter.string(from: numberToConvert)!

    }

for swift use this code for quran aya ending code addition:

let arabicAyaStyle = "\u{FD3F}" + "\(getArabicDigitFor(value:verseObj.verseId))" + "\u{FD3E}"

append arabicAyaStyle to end of any aya text.

func getArabicDigitFor(value:Int) -> String
    {
        let numberToConvert = NSNumber(value: value)

        let formatter = NumberFormatter()

        let arLocale = Locale(identifier: "ar")
        formatter.locale = arLocale

        return formatter.string(from: numberToConvert)!

    }
如果没结果 2025-02-17 11:33:41

您可以使用替换pan来更改如何渲染AYA数字的

方式

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

}

You can use ReplacementSpan to alter how the aya number is rendered

for example this is how 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));
    }

}
〃安静 2025-02-17 11:33:41

如果您使用的是Uthmani字体,例如来自 quran.com ,您可以使用阿拉伯数字来自 u +0660 to u+0669 在符号中呈现一个编号。没有其他字体或Unicode字符范围可行。例如,如果数字为 (23),则您将创建字符串“ \ u0662 \ u0663”

在Flutter中,您可以使用 quran package 在符号内获得数字,但仅适用于该数字Flutter提供的默认字体。如果您使用任何其他字体,包括Uthmani,则该数字不会在符号中呈现。

Chand提出了一个很好的替代方法,但是由于该数字将在阿拉伯文本中呈现,这是正确的,因此您必须翻转括号:“ \ ufd3f< Arabic> \ ufd3e中的数字”

If you are using the Uthmani font, such as from quran.com or from here, you can use the Arabic numerals from U+0660 to U+0669 to get a numbered rendered within the symbol. No other font or unicode character range works. For example, if the number is ٢٣ (23), you would create string "\u0662\u0663".

In Flutter you can use the quran package to get a number inside the symbol, but it only works for the default font provided by Flutter. If you use any other font, including Uthmani, the number will not be rendered in the symbol.

Chand presents a good alternative, but since the number will be rendered within Arabic text, which is right to left, you must flip the parentheses: "\ufd3f<number in arabic>\ufd3e".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文