Hazem Taha
Hazem Taha

Reputation: 1184

How to change numbers type from arabic to english for a font?

I'm supposed to add some modifications to a PHP web site which uses a font with Arabic style numbers. I'm asked to convert the numbers style (language) to the English style (language) using the same font, is that achievable ?

Arabic(red) & English (green) numbering:

enter image description here

Upvotes: 4

Views: 14385

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201528

In principle, it is possible to create a font that has alternate glyphs for Arabic digits, selectable with OpenType font features and looking like common (European) digits. However, I do not know any such font, and such an approach would be odd on several accounts. The Arabic digits have been encoded as separate characters, and treating the difference between them and common digits as merely a glyph difference would deviate from normal reasonable practices.

Thus, the change, if desired, should be made at the character level. The details depend on the context, but the principle is simple: common digits are U+0030...U+0039 and Arabic digits are U+0660...U+0669, both in numeric order, so at the character code level it is simply a matter of adding or subtracting a constant.

Upvotes: 2

Related Questions