gameface-arabic-rtl2

0.1.4 • Public • Published

gameface-arabic-rtl2

This is a helper function for Arabic language support in Coherent Gameface. Since it does not support Arabic out of the box at the moment.

Installation

npm i gameface-arabic-rtl2

Example

Without gameface-arabic-rtl

Without gameface-arabic-rtl

With gameface-arabic-rtl

With gameface-arabic-rtl

Dependencies

I use Abdulla Saeed's code. But had to manually rewrite it for ES5 due to the fact that on some platforms for the babel-loader, conversion to ES5 for node_modules is disabled.

Usage

gameface-arabic-rtl is declared as a Universal Module (UMD), meaning it can be used with all conventional Javascript module systems:

ES6
import { process } from 'gameface-arabic-rtl';

const text = 'مرحبا بالعالم';
const translateNumbers = true;
const convertedText = process(text, translateNumbers);
CommonJS
const GamefaceArabicRtl = require('gameface-arabic-rtl/dist/gameface-arabic-rtl.min.js');

const text = 'مرحبا بالعالم';
const translateNumbers = true;
const convertedText = process(text, translateNumbers);
RequireJS
require(['GamefaceArabicRtl'], (GamefaceArabicRtl) => {
    const text = 'مرحبا بالعالم';
    const translateNumbers = true;
    const convertedText = process(text, translateNumbers);
});
HTML5 <script> tag
<script src="gameface-arabic-rtl.min.js"></script>
<script>
    const text = 'مرحبا بالعالم';
    const translateNumbers = true;
    const convertedText = process(text, translateNumbers);
</script>

Known issues

Since Coherent Gameface does not support OpenType GSUB Table lookup, the required glyphs must be present in the font. For example:

'ﺖ'.codePointAt(0); // must NOT return undefined

Script was tested on Tahoma font.

Package Sidebar

Install

npm i gameface-arabic-rtl2

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

25.6 kB

Total Files

8

Last publish

Collaborators

  • strange0