GithubHelp home page GithubHelp logo

shpkng / arabic-support-unity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from konash/arabic-support-unity

0.0 0.0 0.0 117 KB

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

License: MIT License

C# 100.00%

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

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.