Reputation: 1184
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:
Upvotes: 4
Views: 14385
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