Giter Club home page Giter Club logo

arabic-support-unity's Introduction

Arabic Letters Support For Unity

This plugin allows you to use accurate and correct Arabic text in your game or 3D application. Supports Tashkeel and Hindu numbers. Supports 4 Persian Characters.

You can find it in the Unity Asset Store here: https://www.assetstore.unity3d.com/en/#!/content/2674

Also, check out UPersian. It uses this plugin to create these GUI items:

  1. RTL Text
  2. RTL Input field
  3. RTL Buton
  4. RTL Checkbox

Assalamu Alaikum! (Peace upon you all!) This asset will enable you to use Arabic Words in your game. There are two main problems to address here:

  1. Arabic Letters orders. It's like reading "Hello" as "olleH". السلام is displayed as: م ا ل س ل ا
  2. Arabic Letters connectivity. As seen here: “السلام is displayed as: م ا ل س ل ا” the letters are no disconnected.

Building The Project

You only need to use ArabicSupport.cs file in your project. So there is no real need for building. The rest of the files there are just for demonstration in a Unity Project in expectation of developers wanting to demo the extra features they add to the plugin.

The project should work on most unity versions for now until we start adding features that are available only in later unity versions.

Testing The Project

Usually the project is updated once a flaw is discovered, or something new needs to be added. In the scenes folder there is "Test Cases.unity" file that includes all previous tested words.

Follow the following steps:

  1. Make changes.
  2. Go and see the test case scene and check if something broke. (Sadly you'll have to know basic Arabic writing to know this)
  3. Add new words to the scene that you found that broke so others can also test it.

You can add your own test cases scene if it makes sense to you.

Notes

  1. You'll need to use a font that got Arabic letters in it.
  2. You'll need to modify the text attribute through script. This does not fix the problem if you write directly in a text field.
  3. The script is written in C#.
  4. The code is a little messy so please excuse me.

Steps

  1. To use the Unity Arabic Support asset inside a script, use: "using ArabicSupport;"
  2. After using the using statement, use the following method (returns a string): ArabicFixer.Fix(textToBeFixed);
  3. And you're done! You can use the alternative: ArabicFixer(string, tashkeel, hindoNumbers) for more customization options.

Extras

  1. You can now show Harakat such as ًٌٍَُِ~ّْ using the plugin. Also, you have option to remove the Harakat realtime by setting the plugin to ignore the Harakat by using the ShowHarakat() HideHarakat() Methods. Please note that not all fonts support the Harakat well. Arial font and Arabic Typesetting font were tested and words well. The default is to show the Harakat.
  2. You can now use hindu numbers instead of the default of the font if needed. (٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩) Use the UseHinduNumbers() and UseDeafultNumbers() method to switch your settings. The default value is not to use hindu numbers.
  3. 4 Persian characters have been added (3.0): چژ گپ
  4. Multiple lines are supported. However, you have to supply the breaklines to the Fix method yourself.

Issues

The text is not showing on your build?

  1. Click on the font you are using in the project field.
  2. In the inspector, find the "Character" field.
  3. Change it from dynamic to unicode.

I hope you'll find this asset useful and enjoy using it!

Contact

If you need any help with the asset, please contact me at: [email protected] or https://twitter.com/Konash

I'll be very happy if you showed me the game you used the plugin with! I don't mind a free copy of it either!

Abdullah Konash

arabic-support-unity's People

Contributors

albrrt avatar idbrii avatar konash avatar mohanadhamed avatar mohheader avatar obahareth avatar saarg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arabic-support-unity's Issues

Some Persian letters are not correctly connected

Take this word:
گرافیک

I put that into ArabicGUITextExample and got this:

ArabicGUITextExample

However, it should look like this:

correct

I don't read Persian. I had this report from a user. I don't understand how I could go about fixing this. How do you determine what character to map to?

Looks like the problematic character is:

U+06CC | ی | Arabic Letter Farsi Yeh

ArabicFixer messes with angle brackets and quotes around {0} format placeholders

I have text that contains {0} to allow translations to position words within the translated phrase.

ArabicFixer messes with angle brackets and quotes around my {0} which breaks the formatting. (Causing a FormatException.)

  • It converts <color=#{0}>{1} to {#>color=0}<{1}>/color<
  • It converts <color=#0033ffee>ARABIC to >/colorcolor=#0033ffee<
  • It converts '{0}' to '}{'0
  • It converts "{0}" to " {"0}
  • It converts /{0}/ to }{/0/
  • It converts /"{0}"/ to /}{0 /

It looks like the IsPunctuation checks should prevent this, but maybe those are only to prevent character replacement of punctuation and not to prevent right-to-left conversion?

My workaround is to strip out some of these brackets and quotes. Here's my tests and my FixArabic function.


public static class Localization
{
#if UNITY_EDITOR
    [UnityEditor.MenuItem("Localization/Test FixupRightToLeft")]
#endif
    static void Menu_Test_FixupRightToLeft()
    {
        var tests = new string[] {
            // "Replace\n<color=#{0}>{1}</color>"
            "استبدال \n<color=#{0}>{1}</color>", // fails because it strips the color tag, but I'll accept it

                // "\"{0}\" - Found!"
                "/\"{0}/\" - تم العثور عليه!",

                // "Complete world \"{0}\""
                "أتمم العالم /{0}/",

                // "Found Star {0} of {1}"
                "تم العثور على نجمة {0} من {1}",

                // "Failed to load world: \"{0}\"\n\nVerify the integrity of your game files before trying again."
                "فشل تحميل العالم: \"{0}\"\n\nتأكد من سلامة ملفات لعبتك قبل تكرار المحاولة.",

                // "Please restart the game to apply settings:\n\n{0}"
                "يُرجى إعادة بدء اللعبة  لتطبيق الإعدادات:\n{0}",

                // "Press '{0}' to Clear"
                "اضغط '{0}' للمسح",

                // "Unlock {0}"
                "فتح {0}",
        };
        string marker = "{0}";
        foreach (var msgstr in tests)
        {
            var rtl = FixupRightToLeft(msgstr);
            Debug.Log(msgstr);
            Debug.Log(rtl);
            Debug.Assert(rtl.Contains(marker) == msgstr.Contains(marker));
        }
    }

    public static string FixArabic(string text)
    {
        // ArabicFixer messes with angle brackets and quotes:
        // * It converts <color=#{0}>{1}</color> to {#>color=0}<{1}>/color<
        // * It converts <color=#0033ffee>ARABIC</color> to >/color<ARABIC>color=#0033ffee<
        // * It converts '{0}' to '}{'0
        // * It converts \"{0}\" to " {"0}
        // * It converts /{0}/ to }{/0/
        // * It converts /"{0}"/ to /}{0 /
        text = Regex.Replace(text, @"<[^>]+>", "", RegexOptions.None); // remove color. I don't know how else to fix.
        text = Regex.Replace(text, @"/({\d})/", "$1", RegexOptions.None);
        text = Regex.Replace(text, "/\"({\\d})/\"", "$1", RegexOptions.None);
        text = Regex.Replace(text, "['\"]", " ", RegexOptions.None);
        // Since we're passing {0} for formatting, we can't use hindu numbers.
        return ArabicSupport.ArabicFixer.Fix(text, showTashkeel: false, useHinduNumbers: false);
    }
}

proper multi line formating

I already sent you the code (via assetstore.unity.com) of small component which formats text in correct multi line and also does that in Editor to speed up the execution time. However, it also supports formatting from code. I did it with regular Text component but I believe there will be no big difference for TextMashPro

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ArabicSupport;
using System.Linq;

[RequireComponent(typeof(Text))]
[ExecuteInEditMode]
public class ArabicLineFixer : MonoBehaviour {
  [TextArea]
  public string ArabicText;

  public void SetArabicText(string text) {
    this.ArabicText = text;
    StartCoroutine(FixLineOrderCoroutine());
  }

  void OnValidate() {
    StartCoroutine(FixLineOrderCoroutine());
  }

  IEnumerator FixLineOrderCoroutine() {
    Text textComponent = this.GetComponent<Text>();
    List<string> resultText = new List<string>();
    RectTransform rt = textComponent.GetComponent<RectTransform>();
    List<string> paragraphList = ArabicText.Split('\n').ToList();

    foreach (string paragraph in paragraphList) {
      textComponent.text = ArabicFixer.Fix(paragraph, false, false);
      TextGenerationSettings tgs = textComponent.GetGenerationSettings(rt.rect.size);

      if (textComponent.text.IndexOf(' ') < 0) {
        resultText.Add(textComponent.text);

      } else {
        List<string> lineList = new List<string>();
        List<string> wordList = textComponent.text.Split(' ').ToList();
        string singleLine = "";

        while (wordList.Count > 0) {
          string singleWord = wordList[wordList.Count - 1];
          wordList.RemoveAt(wordList.Count - 1);

          if (textComponent.cachedTextGenerator.GetPreferredWidth(singleWord + ' ' + singleLine, tgs) > rt.rect.width) {
            lineList.Add(singleLine);
            singleLine = singleWord;
          } else {
            singleLine = (singleLine != "") ? singleWord + ' ' + singleLine : singleWord;
          }
        }

        if (singleLine.Length > 0)
          lineList.Add(singleLine);

        resultText.Add(String.Join(Environment.NewLine, lineList.ToArray()));
      }

      if (!Application.isEditor)
        yield return new WaitForEndOfFrame();
    }

    textComponent.text = String.Join(Environment.NewLine, resultText.ToArray());
  }
}

Is Wrap not supported?

I don't know if this is known or not, but if it isn't then I'm surprised that it is no one use this Wrap mode before.
You can see in the screenshot that the text' horizontal overflow is set to Wrap and it is then flowing from bottom to top.
I'm currently working on simple project to make digitized version of text book (e-book), and it certainly contain lots of texts that it has to be in Wrap mode. So if this Wrap mode is not supported, do I have to write every single line as seperated gameobjects? I think this is important feature to support.

wraptruncate flowing bottom to top

"!" wasn't putted on the end line

Hello, this is Stefan who sent the email yesterday.
I did the test as your recommend that is using last version.

test text :
البحث عن تحديات أكبر في دوريات أعلى!

test

copy output text and paste to NGUI label

test1

Sorry, I "totally" don't know Arabic at all, so I could not check whether result is correct or not
But even i don't know, but i think "!" should be putted on the final sentence, am i correct ?

Order is wrong in mixed-language text

I just downloaded the latest version of the asset for Unity 2021.1 and unfortunately there's a big problem with the order.

Example text (copied from google translate):

This is a test. هذا اختبار. Another test!
(it's the wrong order in my actual text, apparently copying it/github changes it!)

Using ArabicFixer.Fix() on it results in this (doesn't matter if it's a 3D TMP text or a regular canvas/UI TMP one):

Another test! .هذا اختبار This is a test.

As you can see, the English text is also swapped and with different test texts it even happens mid-sentence (wherever the Arabic part is).

Any idea how this can be fixed?

Rich Text formatting work around

I had to write a script in order to get around the fixer trashing rich text formatting.

Consider the following input:

<size=82%><color=#1FBEFF>أنقاض</color></size>

public static string FormatArabic(string input)
{
    bool inside = true;
    string inner = "";
    string output = "";
    for(int i = 0; i < input.Length; i++)
    {
        var c = input[i];
        switch(c)
        {
            case '<':
                inside = false;
                output += ArabicSupport.ArabicFixer.Fix(inner, false, false);
                inner = "";
                goto default;
            case '>':
                inside = true;
                output += c;
                break;
            default:
                if(inside == false)
                    output += c;
                else
                    inner += c;
                break;
        }
    }
    return output;
}

This appears to solve my problem. Whilst this is trivial to write, a lot of StackOverflow posts would recommend Regex instead.

It would be nice if the fixer supported this by default in some way.

It doesn't work with NGUI's BBCode.

I just want to use coloring text on NGUI's Label like "[FF0000]Red[-] Text", but it shows me like "Text [-][]FF0000Red".

Is there another way to use BBCode on NGUI?

Letter issue

The TaaMarbouta is converted to Taa in the end of the word after a lettre that have e little space after her like Daal and Raa.
image

a lettler is display error

One character displays an error in a custom nested font,eg.غلى .The last letter is displayed as the default font in the system font.i see code 64509 is right,but display is error

a couple of issues when English and Arabic are used in a sentence

Hi, I am making an app in Arabic language, and was encountered to a couple of problems regarding texts around line breaks and symbols when Arabic and English words are used at the same time in a sentence. Here goes...

  1. problem with line breaks
    image

When an English word exists in the middle of Arabic sentence and there is a line break because of the length of the sentence, there is a problem where the Arabic part that goes before the English word would get switched places with the part that goes after the English word. (Please check the screenshot I attached above)
What should I do to fix this problem? I tried to look for previous similar issues reported in your github to no avail.

  1. problem with symbol ')' and '('
    In the screenshot above, there are parentheses at both ends of the English words, Smart Sense and PAS. They are supposed to appear to be "(Smart Sense)" and "(PAS)", respectively, but, after I apply "LocalizationText.SetText() to them, the parentheses get reversed like in the screenshot.
    I had to make some revision to ArabicSupport.cs to make it work as it should,
    image
    but, I still feel that there should be the right way to fix this.

Is this project still active?

Hi all,

With Unity 2019.4.1f1, there is a compilation error that

GameObject doesn't contain a definition of guiText

Which seemed to have been removed in version 5.3.6.

Can we have an updated plugin please?

Numbers and punctuation order changed

Hi,

I have the following string: زيادة كل الضرر بنسبة $X1% (+$X2%)
arabic

$X1 and $X2 are variables to be replaced by the code with numbers.

The result is a very strange ordering of the punctuation. In addition it is placed at the end for some reason.

HTML tags support

First I would like to thank for this great add-on, I always use it in my arabic projects.

Currently I was working on integrating fungus with Arabic support :
http://fungusgames.com/forum/#!/support-questions:right-to-left-writing-say

I got an issue when I try to Fix( arabic string )
Fungus, use html tags to show & hide letters
So instead of showing the text by adding letters one by one

ا
اس
اسم

they do it something like this :

<color=#FFFFFF00>سم</color>ا
<color=#FFFFFF00>م</color>اس
اسم

in this case, the html tag in the fix process got interrupted.

I am trying to fix it, but I believe I may be doing something wrong

Thanks,

AlefMaksora is set to Yeh - causing Yeh to be used instead of AlefMaksora after running the Fix

When we received our translation we had the character AlefMaksora 0x0649 in our characters.
This was then converted into isolated form through the mapping :
mapList.Add(new ArabicMapping((int)GeneralArabicLetters.AlefMagsora, (int)IsolatedArabicLetters.AlefMaksora));
but the isolated AlefMaksora was set to
AlefMaksora = 0xFBFC,
Which is the same as the
PersianYeh = 0xFBFC,
shouldn't it be set to
AlefMaksora = 0xFEEF,
instead?

The result for us, was that our localization changed from AlefMaksora to Yeh and our font did not contain the perisan yeh-variants.
I am unsure what should be the correct behaviour here because I do not speak the language.

Thank you for the arabic support code, it is working very well, except this one issue we are having - best regards.

How to use with TMPro RTL enabled?

Hello @Konash, Thanks for making and maintaining the project!

I'm developer of Naninovel visual novel engine and trying to add Arabic languages support. We're using a TMPro text component to display the text. It already has RTL languages support and performs characters rearrangement, but our users mentioned, that the letters are disconnected. Here is the result we have when using only TMPro RTL option:

I've tried using this project to fix the disconnection issue like following:

// Second (rtl) argument is false, as TMPro handles RTL modification
text = ArabicSupport.ArabicFixer.Fix(text, false);

Given the following input (initial text value):
مهمانسرای عباسی یا هتل شاه عباس یکی از هتل‌های بزرگ ایران و شهر اصفهان است که به دلیل معماری آن، که از معماری دوران صفوی الگو گرفته است، و نیز واقع شدن آن در میان بافت تاریخی اصفهان دارای اهمیت فراوان است. سی‌ان‌ان در گزارشی در مارس ۲۰۱۷ هتل عباسی را به عنوان زیباترین ه

I'm getting this result (don't mind the "OKUY" part):

Unfortunately, I'm not familiar with any Arabic languages, hence it's problematic for me to comprehend what's going on there. I'd really appreciate any hints on how to solve the issue.

Regards,
Artyom.

string parameters

Hi,

On some of our translations, we use parameters for the strings, for example:
رونش ! صديقي العزيز ! لازلنا أصدقاء لمدة تتجاوز {0} سنة

But the filter is removing them.
Is there a way to leave the parameter intact but also use the filter?

Thanks a lot

Wrong brackets formatting

Hi!

There is a problem with brackets formatting. Script reverses them when this is not needed.

(سربازخانه (0/18

Multibyte languages are erroneously judged.

In multibyte languages (Japanese, Hangul, etc.), it is often LtR, but it is judged as RtL.

Expect

日本語は左から右に読む

Actual

む読に右らか左は語本日

Can I fix it?

TextMeshPro multiline problems

I have an application with full TextMeshPro with two languages french and english i want to add arabic, when i use this library Everything works fine except when i have multiline , lines are not ont the good order

For example with arabic caracters :

i will eat apple this morning

is showen like this :

this morning i will eat apple

I use Unity version 2020.1.12f1 on Mac

How can i resolve this problem please ? any help will be apprecied

small issue with combine Tashkeel.

Another Edit ( 4 Feb 2019 )

Edit ( 19Dec2018 )
Function is updated to fix some bugs.

Hi :)

I found a bug in my code submitted later,, if we have a word that contains شدة & the previous letter has a tashkeel, then the Shada will be assigned to the previous letter instead of the correct one.

I have to fix it

but if someone is searching for a fix until a Merge request is created

Just replace the RemoveTaskeel method

internal static string RemoveTashkeel(string str, out List<TashkeelLocation> tashkeelLocation)
    {
        tashkeelLocation = new List<TashkeelLocation>();
        char[] letters = str.ToCharArray();

        int index = 0;
        bool lastWasLetter = true;
        int combined = 0;
        for (int i = 0; i < letters.Length; i++)
        {
            bool currentIsLetter = false;
            if (letters[i] == (char)0x064B)
            { // Tanween Fatha
                tashkeelLocation.Add(new TashkeelLocation((char)0x064B, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x064C)
            { // Tanween Damma
                if (index > 0 && combineTashkeel && lastWasLetter == false)
                {
                    if (tashkeelLocation[index - 1].tashkeel == (char)0x0651) // Shadda
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC5E, i - 1 - combined); // Shadda With Tanween Damma
                        combined++;
                        continue;
                    }
                }
                tashkeelLocation.Add(new TashkeelLocation((char)0x064C, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x064D)
            { // Tanween Kasra
                if (index > 0 && combineTashkeel && lastWasLetter == false)
                {
                    if (tashkeelLocation[index - 1].tashkeel == (char)0x0651) // Shadda
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC5F, i - 1 - combined); // Shadda With Tanween Kasra
                        combined++;
                        continue;
                    }
                }
                tashkeelLocation.Add(new TashkeelLocation((char)0x064D, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x064E)
            { // Fatha
                if (index > 0 && combineTashkeel && lastWasLetter == false)
                {
                    if (tashkeelLocation[index - 1].tashkeel == (char)0x0651) // Shadda
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC60, i - 1 - combined); // Shadda With Fatha
                        combined++;
                        continue;
                    }
                }

                tashkeelLocation.Add(new TashkeelLocation((char)0x064E, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x064F)
            { // DAMMA
                if (index > 0 && combineTashkeel && lastWasLetter == false)
                {
                    if (tashkeelLocation[index - 1].tashkeel == (char)0x0651)
                    { // SHADDA
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC61, i - 1 - combined); // Shadda With DAMMA
                        combined++;
                        continue;
                    }
                }
                tashkeelLocation.Add(new TashkeelLocation((char)0x064F, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x0650)
            { // KASRA
                if (index > 0 && combineTashkeel && lastWasLetter == false)
                {
                    if (tashkeelLocation[index - 1].tashkeel == (char)0x0651)
                    { // SHADDA
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC62, i - 1 - combined); // Shadda With KASRA
                        combined++;
                        continue;
                    }
                }
                tashkeelLocation.Add(new TashkeelLocation((char)0x0650, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x0651)
            { // SHADDA
                if (index > 0 && combineTashkeel && lastWasLetter == false)
                {
                    if (tashkeelLocation[index - 1].tashkeel == (char)0x064E) // FATHA
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC60, i - 1 - combined); // Shadda With Fatha
                        combined++;
                        continue;
                    }

                    if (tashkeelLocation[index - 1].tashkeel == (char)0x064F) // DAMMA
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC61, i - 1 - combined); // Shadda With DAMMA
                        combined++;
                        continue;
                    }

                    if (tashkeelLocation[index - 1].tashkeel == (char)0x0650) // KASRA
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC62, i - 1 - combined); // Shadda With KASRA
                        combined++;
                        continue;
                    }

                    if (tashkeelLocation[index - 1].tashkeel == (char)0x064D) // Tanween Kasra
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC5F, i - 1 - combined); // Shadda With Tanween Kasra
                        combined++;
                        continue;
                    }

                    if (tashkeelLocation[index - 1].tashkeel == (char)0x064C) // Tanween Damma
                    {
                        tashkeelLocation[index - 1] = new TashkeelLocation((char)0xFC5E, i - 1 - combined); // Shadda With Tanween Damma
                        combined++;
                        continue;
                    }
                }

                tashkeelLocation.Add(new TashkeelLocation((char)0x0651, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x0652)
            { // SUKUN
                tashkeelLocation.Add(new TashkeelLocation((char)0x0652, i - combined));
                index++;
            }
            else if (letters[i] == (char)0x0653)
            { // MADDAH ABOVE
                tashkeelLocation.Add(new TashkeelLocation((char)0x0653, i - combined));
                index++;
            }
            else if (letters[i] == (char)0xFC62)
            {
                tashkeelLocation.Add(new TashkeelLocation((char)0xFC62, i - combined));
                index++;
            }
            else if (letters[i] == (char)0xFC61)
            {
                tashkeelLocation.Add(new TashkeelLocation((char)0xFC61, i - combined));
                index++;
            }
            else if (letters[i] == (char)0xFC60)
            {
                tashkeelLocation.Add(new TashkeelLocation((char)0xFC60, i - combined));
                index++;
            }
            else
                currentIsLetter = true;

            lastWasLetter = currentIsLetter;
        }

        string[] split = str.Split(new char[]{(char)0x064B,(char)0x064C,(char)0x064D,
            (char)0x064E,(char)0x064F,(char)0x0650,
            (char)0x0651,(char)0x0652,(char)0x0653,(char)0xFC60,(char)0xFC61,(char)0xFC62});
        str = "";

        foreach (string s in split)
        {
            str += s;
        }
        return str;
    }

GUI Text is obselete

using UnityEngine.UI;

gameObject.GetComponent().text = "This sentence (wrong display):\n" + text +
"\n\nWill appear correctly as:\n" + ArabicFixer.Fix(text, false, false);

Great effort @Konash Chapeau ⭐

Make combined Tashkeel cases optional

I'm using a font that does not support combined Tashkeel, only individual Tashkeel. Any chance we can make this optional?

My font renders combined Tashkeel fine in all programs, so most programs must be rendering each Tashkeel individually, so I need to replicate that in my applications...

In س°, Seen gets converted to 'end' type

Sorry I know this is annoying but we are totally misunderstanding each other I think.

I just downloaded the latest from here, opened a brand new project and it doesn't work still, are you testing the correct text?

from https://en.wikipedia.org/wiki/Modern_Arabic_mathematical_notation

degree Celsius | °C

image

image

In your response here:
degree

You have the degree symbol the wrong side of the Seen, it should be after (before in rtl) the Seen after it is fixed

Just to be clear I am trying to display the standard degrees symbol 0x00b0, Sokoon is not what I need to display.

Wrong character

Hi
I writing (Settings)تنظیمات but result تﺎﻤیﻈﻨﺗ

IndexOutOfBounds Error

IndexOutOfRangeException: Index was outside the bounds of the array.
ArabicSupport.ArabicFixer.Fix (System.String str, System.Boolean rtl) (at Assets/ArabicSupport/ArabicSupport.cs:77)

I'm not quite sure what character is causing this. Are there known characters that won't work ?

Wrong character sequence

Hi!

I have a problem with ArabicFixer. This is an original text:

.لطفا با من بشمارید 1 – 2 – 3 – 4 – 5 – 6 – 7 – 8- 9 -10 آفرین! همه چیز صحیح است

This is what we got after Fix:

ﺖﺳا ﺢیﺤﺻ ﺰیﭼ ﻪﻤﻫ !ﻦیﺮﻓآ -10 9 8- – 7 – 6 – 5 – 4 – 3 – 2 – 1 ﺪیرﺎﻤﺸﺑ ﻦﻣ ﺎﺑ ﺎﻔﻄﻟ.

Something is wrong with dashes between 7 and 10. Could you please check?

I have no knowledge of Arabic, but this looks like a bug.

Andrew.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.