Using another space width for arabic in latin+arabic font

Salam and hi,

I want to use space-ar instead of space only when it falls between arabic letters or words in the same font that has latin and latin space (i need space to be narrower in arabic), how do i script this?

Sounds like it fits into the Contextual Alternats(calt) feature:

Haven’t tested it but I think this should work: sub [a b c] space' [a b c] by space-ar;
Change a b c to your arabic glyphs. Probably better to make a class out of them though.

That can be handled in the locl feature:

script arab;
sub space by space-ar;

Would it not replace the space between the latin glyhps as well, if local context is set to arab?

It might, but in my tests this sort of thing also depends on what script the adjacent characters belong to.

(I’ve been testing similar questions with localised versions of punctuation for different scripts in the same font. My findings so far indicate that punctuation is substituted a) when script tags apply to the substitution lookups (either universally or contextually when adjacent to a character of the relevant script) b) when the target document explicitly tags the language of the text c) unpredictably depending on adjacent script runs…separators and punctuation are not attributed to a specific script, so they inherit such characteristics from adjacent characters [which of course can be different on the left and right].)

Might it be a better solution to implement a kern or dist feature to globally negatively kern Arabic letters into the default wordspace.

1 Like

@GeorgSeifert @tderkert @Bendy
Thanks guys, @GeorgSeifert solution is working fine now, but i didn’t test everywhere yet :slight_smile:

this option does’nt work in adobe Apps, why?

script latn;
language ENG;
sub space by space.loclENG;

It works half way. In InDesign, the space glyph is substituted but the width is not adjusted.

I do not think it makes sense to have an English space, though. Perhaps a Latin space.

It’s a pity that this option only works on indesign!, In this case, the problem will not be the spacing between the words only, but the symbols and punctuation will appear inverted with Latin fonts! You can see disappointment here.

I’ve found a solution to the space problem by adding space.loclENG to the stylistic set, space.ss01

1 Like

how it work with “generate feature automatically” ?
it`s delete the code after i enable it again