latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
124 stars 34 forks source link

Support using the Swash Kaf character for Arabic justification #222

Closed amarakon closed 1 year ago

amarakon commented 1 year ago

In Arabic, I use kashida justification which inserts the Tatweel character (U+0640) between letters at the correct length to justify the text. Of course, I can change the factor of kashida to space by setting Babel.arabic.justify_factor to any value between 0 and 1. I think it would be great if there was a justification feature to automatically replace instances of the regular Kaf character (U+0643) with the Swash Kaf character (U+06AA), which is slightly wider. Then, as a fallback if the line still isn't justified, it should fall back to regular justification (kashida or space). If the Swash Kaf is too wide to justify the line, or if there are no longer any Kafs on the line, regular justification should be used. I don't know how difficult it is to implement this. Please let me know if this is possible or planned for the future.

jbezos commented 1 year ago

It’s certainly planned, by I originally thought of it as part of the elongated justification mode (with the JALT OpenType table). I would make sense to provide it as a separate feature with kashida. There is another planned mode, based on the breaking of ligatures, but sadly I’ve found no time the develop them and furthermore information about the JALT table is scarce.

amarakon commented 1 year ago

I don't notice a difference from justification = kashida to justification = elongated. elongated is supposed to use elongated glyphs right? For me it looks the same. Is it font dependent or will it change in the future?

jbezos commented 1 year ago

Most fonts don’t support elongated glyphs. See Arabic fonts with justification alternatives.

amarakon commented 1 year ago

Okay. Could the swash kaf idea I proposed still work on a font that doesn't support elongated glyphs?

jbezos commented 1 year ago

Yes, it should, because every font for Arabic (or most of them) contain the swash kaf (it‘s encoded as a separate character because it’s a letter on its own in Sindhi). I'll reconsider my priorities, because, unlike the JALT variants, I think it can be done more or less straightforwardly (or so I hope).

jbezos commented 1 year ago

I‘m closing this issue because it’s now listed in Enhancements requests. This doesn’t mean it’s rejected, just moved to a specific page for enhancements.