A simple tiny library for Arabic, Hebrew, Farsi, Urdu and etc. for modern CXX standards.
RTLScript is a fork of FarsiType: https://github.com/AmyrAhmady/FarsiType
Tested with Clang CXX standard 23 need to also work with CXX 20 Just a logo that i made for fun i Love to make a logos for my projects (:
Screenshots (using ImGui for rendering through ExtremeEngine)
Hi, i needed RTL text in my project and i found a beautiful repository named FarsiType(https://github.com/AmyrAhmady/FarsiType) and i decided to improve it for my needs.
- RTLScript have a full support for Arabic, Hebrew, Farsi and Urdu.
- Supports extra symbols like: لا, لأ, لآ, لإ, الله.
- Supports Arabic tashkil(diacritic) for example: َ ً ُ ٌ ِ ٍ ْ and some other.
- Very easy to work with it.
- Support RTL and LTR text in the same line.
- Uses RAII and regular standart headers.
RTLScript is very easy to use:
#define RTL_SCRIPT_RAII_ENABLE_HEBREW // To enable Hebrew feature.
#define RTL_SCRIPT_RAII_ENABLE_FARSI // To enable Farsi feature.
// No need to enable Arabic feature, it's enabled by default.
#include <RTLScript/RTLScript-RAII.hpp> // Recommended to use the RAII header, but it's not necessary.
void main()
{
const RTLScript::Raii::Instance instance; // No need to manually clean up anything, the RAII instance will handle it.
// No need manually set glyph ranges if you are using the RAII header, it's already set for Arabic, Farsi, and Hebrew. only if you need special glyph ranges
// instance.SetGlyphRanges({ RTLScript::Arabic::GLYPH_RANGE, RTLScript::Hebrew::GLYPH_RANGE, RTLScript::GlyphRange(6u, 7u) });
// instance.SetFlags(RTLScript::ConvertToFixedFlagBits::EnableJointLaamAlefForm); // can set custom flags if needed.
const RTLScript::UString text = L"أنا أحب الأناناس"; // Need to pass a wide string.
const auto fixedText = instance.ConvertToFixed(text); // Convert to fixed text.
// Now do with the result what you want!
}
First, if it's not working make sure that your project setted to MultiByte or Unicode and not ASCII.
Second, check that you are using /utf-8.
Third, check if your project files saved in utf-8.
Fourth, choose a font that supports that RTL language that you want to use.


