I am trying to find out how to have Kashida justification in Luatex (in TexLive) for bidi text.
Background:
- I can see by searching that support might appear in
babelhere but nothing implemented yet. - In Xetex (
bidiorxeperisan?), Kashida justification is implemented by\XetexInterCharToks, using \hrule but not the glyph ( which was visually problematic in letter joints). - Using (stretching) the Kashida glyph directly or applying the new variable fonts feature are the two alternatives.
- I also noticed that
\XetexInterCharTokscan be implemented in Luatex in someway here. - Previously, I asked about finding the width of glue space between chars here.
- No idea, if
harfbuzzimplementation (any support for Kashida ?) can be related. Harfbuzz can be used throughluahbtexhere
Edit (About Kashida):
Kashida (from keshideh which means "stretched" in Persian) is a dash-like justification that can be added between (actually to the end of the first letter) some letters in Arabic/Persian/Urdu scripts (and probably Hebrew see here). Its Unicode character is (U+0640), also known as Arabic Tatweel.
It has two functionalities:
- aesthetically: more beautiful typesetting and a replacement for white-space justification
- It can be used in stressing some words, as a replacement for capital letters or small-caps which do not exist in those scripts.
One can add manually the default character ((U+0640)) as many time as it seems appropriate:
کشیده
vs
کشیـــــــده
However, (1) any use of Kashida letter might create problem when searching for a word, and (2), the right amount of width of Keshida is not a proper multiple of the default width of it in a font. Therefore, a right solution might be to use variable fonts technology. This also can fix another problem that Kashida is not always a stretchable dash but it can be/should be a stretchable curve part of a glyph.
\XetexInterCharToksin LuaTeX like this anymore because thetoken_filtercallback is gone. – Henri Menke Dec 11 '19 at 06:35babel, but my first experiments were quite unsatisfactory (in particular, the\hrulehack), and I haven't investigated any further. – Javier Bezos Dec 11 '19 at 14:21\hrulehack creates unsatisfactory results (I remember that once I have tried to stretch the kashida glyph itself, but do not remember if it created different result, probably not). Any plan for further investigation in future? – Shahryar Dec 11 '19 at 15:00luatexvery soon. I have my doubts that withxetexwe can go much further than, eg,texnegar. See an example here: https://twitter.com/javier_bezos/status/1387742677731524609 . – Javier Bezos May 03 '21 at 07:38https://github.com/rastikerdar/vazir-font
https://fontiran.com/%d9%81%d9%88%d9%86%d8%aa-%d8%af%d8%a7%d9%86%d8%a7-%d8%ad%d8%b1%d9%81%d9%87%e2%80%8c%d8%a7%db%8c/
However, I could not see Tex implementations based on that. Solutions such as TexNegar do not utilize this feature but rely some older work-around which is limited to specific fonts, with serious problems.
Similarly, I think Luatex is the one to invest in.
– Shahryar May 03 '21 at 21:24jaltalternatives and the insertion of kashida. – Javier Bezos May 04 '21 at 05:51I provided two links, one seems missing in the above:
https://fontiran.com/%d9%81%d9%88%d9%86%d8%aa-%d8%af%d8%a7%d9%86%d8%a7-%d8%ad%d8%b1%d9%81%d9%87%e2%80%8c%d8%a7%db%8c/
– Shahryar May 04 '21 at 07:29