Change font direction of latin letters

Hello there, I really do hope that I am not repeating a closed case but I could not find anything similar. I am using the Schehrazade New font and replaced the glyphs of the latin letters with their arabic equivalent - as in when you type an “A” on the keyboard an arabic “ا” appears for “B” → “ب” and so on.

The originally latin letters which are now arabic do appear from left to right though, which is the issue I am trying to change. The original code line which I think dictates the direction of the letters is the following:

Lookup: 1 8 0 "'rtlm' Rechts nach links gespiegelte Formen Nachschlagetabelle 0" { "'rtlm' Rechts nach links gespiegelte Formen Nachschlagetabelle 0 Subtabelle" } ['rtlm' ('arab' <'KIR ' 'KUR ' 'RHG ' 'SND ' 'URD ' 'WLF ' 'dflt' > 'latn' <'dflt' > ) ]

I tried to change it several times to for example:

Lookup: 1 8 0 "'rtlm' Rechts nach links gespiegelte Formen Nachschlagetabelle 0" { "'rtlm' Rechts nach links gespiegelte Formen Nachschlagetabelle 0 Subtabelle" } ['rtlm' ('arab' <'KIR ' 'KUR ' 'RHG ' 'SND ' 'URD ' 'WLF ' 'dflt' 'latn' > ) ]

Or:

Lookup: 1 8 0 "'rtlm' Rechts nach links gespiegelte Formen Nachschlagetabelle 0" { "'rtlm' Rechts nach links gespiegelte Formen Nachschlagetabelle 0 Subtabelle" } ['rtlm' ('arab' 'dflt' 'latn' <'KIR ' 'KUR ' 'RHG ' 'SND ' 'URD ' 'WLF ' > ) ]

but unfortunately nothing seems to be working. I would appreciate your help on this very much!

Hello Mohamed, and welcome to the community. It sounds like what you need is to create a keyboard which outputs the correct Arabic script characters when you type the corresponding keys on the keyboard, and NOT to change the font by replacing glyphs. If you just replace glyphs in the font, then the programs that you use (Word, etc.) will think that the “A” character that you typed is LTR, even though the glyph it now displays is “ا” (Alif). The better route is to create a keyboard that when you type an “A”, it outputs the real Unicode “ا” (Alif), which is code U+0627. When your programs see that character, they know that it is an RTL character, so it will be displayed properly (if you have a decent font, have set the paragraph direction, etc.).

I’m impressed that you were able to replace glyphs in a font, so I will assume that you are quite competent technically, and will just give you a couple of links for you to do more research. The main information source you need is here: http://help.keyman.com/. You will need to use Keyman Developer to create a keyboard which has all of the characters mapped the way you want them. There is a tutorial here: Keyboard Tutorial. If you just want a one-to-one mapping of keys to output characters, you may be able to use the simple visual keyboard mapping. Otherwise you might need to write some “code” to specify what is output for each key combination. There are many open source keyboards that you can get ideas from here: GitHub - keymanapp/keyboards: Open Source Keyman keyboards.

With a well-designed keyboard created and installed, you should be able to type BAB and get “بلب”, with all the characters properly linked.

Hopefully that responds to your question, and gets you moving in the right direction.
Jeff

Keyman does have a repository of existing keyboards that are publicly available for download. You can go to keyman.com and search for Arabic. If you do that, you’ll see the keyboards listed for “Arabic”: Keyboard Search

If you click on one of these keyboards, for example, “Arabic Phonetic (SIL)” (Arabic Phonetic (SIL) keyboard), you’ll see a description of the keyboard. In that information, there should be a “Documentation” heading with a “Keyboard help” link. If you click on that link, it should show you the documentation, which usually includes a keyboard layout.

If you find a keyboard that suits your needs, you can download and use it with Keyman. If none fits your needs, you might still be able to find one that is close that you could use as a starting point for developing the keyboard you want.