Arabic kerning beyond basic

Options
Toshi Omagari
Toshi Omagari Posts: 18
edited March 2018 in Type Business
I have been looking at various kerning in Arabic fonts, and I have noticed that pairs between letter/punctuation or numeral/punctuation are very uncommon. Neo Sans Arabic seems to be one of very few exceptions that do have such pairs. Is there a good reason not to do it, or a reason why it hasn't been the case in the past (e.g. it's been hard to do)?

I can't help but want to test and kern pairs like these, for example:

ء؟ ا؟ أ؟ إ؟ آ؟ ٱ؟ ب؟ پ؟ ت؟ ث؟ ٹ؟ ج؟ چ؟ ح؟ خ؟ 
د؟ ذ؟ ڈ؟ ر؟ ز؟ ڑ؟ ژ؟ س؟ ش؟ ص؟ ض؟ ط؟ ظ؟ ع؟ غ؟ 
ف؟ ڤ؟ ق؟ ك؟ ک؟ گ؟ ل؟ م؟ ن؟ ه؟ ؟ ہ؟ ۂ؟ ھ؟ ة؟ 
و؟ ؤ؟ ى؟ ي؟ ئ؟ ی؟ ے؟ ۓ؟ ـے؟ ـۓ؟ ە؟ لا؟ لأ؟ لإ؟ لآ؟ 

”ء“ ”ا“ ”أ“ ”إ“ ”آ“ ”ٱ“ ”ب“ ”پ“ ”ت“ ”ث“ ”ٹ“ ”ج“ ”چ“ ”ح“ ”خ“ 
”د“ ”ذ“ ”ڈ“ ”ر“ ”ز“ ”ڑ“ ”ژ“ ”س“ ”ش“ ”ص“ ”ض“ ”ط“ ”ظ“ ”ع“ ”غ“ 
”ف“ ”ڤ“ ”ق“ ”ك“ ”ک“ ”گ“ ”ل“ ”م“ ”ن“ ”ه“ ”ہ“ ”ۂ“ ”ھ“ ”ة“ 
”و“ ”ؤ“ ”ى“ ”ي“ ”ئ“ ”ی“ ”ے“ ”ۓ“  ـے“   ـۓ“ ”ە“ ”لا“ ”لأ“ ”لإ“ ”لآ“ 

٫٠٫١٫٢٫٣٫٤٫٥٫٦٫٧٫٨٫٩٫۰٫۱٫۲٫۳٫۴٫۵٫۶٫۷٫۸٫۹٫
٬٠٬١٬٢٬٣٬٤٬٥٬٦٬٧٬٨٬٩٬۰٬۱٬۲٬۳٬۴٬۵٬۶٬۷٬۸٬۹٬
,٠,١,٢,٣,٤,٥,٦,٧,٨,٩,۰,۱,۲,۳,۴,۵,۶,۷,۸,۹,
.٠.١.٢.٣.٤.٥.٦.٧.٨.٩.۰.۱.۲.۳.۴.۵.۶.۷.۸.۹.
"٠"١"٢"٣"٤"٥"٦"٧"٨"٩"۰"۱"۲"۳"۴"۵"۶"۷"۸"۹"
“٠” “١” “٢” “٣” “٤” “٥” “٦” “٧” “٨” “٩”
?٠?١?٢?٣?٤?٥?٦?٧?٨?٩?۰?۱?۲?۳?۴?۵?۶?۷?۸?۹?
؟٠؟١؟٢؟٣؟٤؟٥؟٦؟٧؟٨؟٩؟۰؟۱؟۲؟۳؟۴؟۵؟۶؟۷؟۸؟۹؟

[edit:] Sorry, wrong category to post. I wanted to delete or move it but apparently I can't.
Tagged:

Comments

  • Georg Seifert
    Options
    Pairs between different categories of glyphs don’t work very often because of the change in context/text direction.  
  • Toshi Omagari
    Options
    Thanks, that might have been the historical reason. It is working perfectly fine today though, in InDesign and various browsers.
  • Bahman Eslami
    Options
    Probably because layout engines didn't render it consistently. I know situations that RTL-LTR kerning pairs don't work as expected at the current time (Harfbuzz). Not sure how shaping engines handle punctuations, are they considered neutral or LTR?
  • Toshi Omagari
    Options
    I see some weird lack of kerning in what is supposed to be a class kerning, like ain+quotedbl works but ghain+quotedbl doesn't (they are in the same groups). I am testing with Glyphs + InDesign, Safari, Chrome, and Pages, and this behaviour is universal. Otherwise it works just as intended.
  • AzizMostafa AzizAli
    AzizMostafa AzizAli Posts: 103
    edited March 2018
    Options
    Why not define different styles for different letter/punctuations and numeral/punctuations, condensed when condensed and normal when normal, as I have done with different numbers in this attached file?!
  • Ori Ben-Dor
    Ori Ben-Dor Posts: 383
    edited March 2018
    Options
    Pairs between different categories of glyphs don’t work very often because of the change in context/text direction.  
    What do you mean by different categories? Are layout engines aware of those categories?

    What's the difference, in this context, between two letters and a letter followed by a punctuation mark? If there's a RTL/LTR problem, isn't it supposed to affect two letters just as well?
  • André G. Isaak
    Options
    The categories involved here are RTL vs. Bidirectional.
  • Ori Ben-Dor
    Ori Ben-Dor Posts: 383
    edited March 2018
    Options
    Oh, I think I get it. So a letter followed by a punctuation mark actually wouldn't cause a problem, as punctuation marks are also RTL, but a letter followed by a numeral could cause a problem, right?
  • John Hudson
    John Hudson Posts: 3,043
    Options
    OpenType Layout begins with script itemisation and run segmentation, with the latter based on a number of factors including script and directionality. Punctuation glyphs have script=Common property and weak directionality. What this means is that punctuation should be rolled into runs of adjacent script- and direction-specific glyphs, in which case kerning should be applied between letters and punctuation. But there's no standard specification or algorithm for how this should be done, so you can't assume that the way it works in one app is the same as how it works in another.

    cf. Beyond Shaping
  • Ori Ben-Dor
    Ori Ben-Dor Posts: 383
    Options
    Thanks for the explanation!
  • Khaled Hosny
    Options
    I personally try to avoid kerning Arabic altogether, unless it is a case of two glyphs bumping into other in an unpleasant way. I don’t think the Latin spacing rules and the black and white distribution (or whatever it is called, I’m completely ignorant here) are really that relevant to Arabic, so there is no need to set the text as tightly as possible, some extra space or lack of space here and there does not harm.

    Actually most old Arabic fonts had zero kerning pairs, and the problematic right-joining letters that would need kerning (like ر and و) were kerned metal type-style by having negative left side bearing. After some tinkering with kerning, I ended up adopting the same, with only few contextual positioning rule for really problematic combinations.