I have some Arabic content that is justified according to western conventions.
I justified it because it is justified in ancient sources:
However, the way Arabic text justification works is by stretching the cursive words, instead of the whitespace.
So what I would like to do is go into the font source, convert it to SVG, and pick out the individual glyphs. It is straightforward for (i.e.) Hebrew, but now I start getting lost for Arabic.
Every Arabic letter can have multiple forms (i.e., isolated, initial, medial, final, some with all, some with a few). I am ignoring the diacritics for now as the early Quran from these images above didn't use them.
What I've noticed in Arabic font rendering (and I don't know much about Arabic), is that the cursive letters change shape significantly when used in different places in a word. Maybe that's all defined by the initial/medial/final business. I'm not sure.
When I look at an Arabic font, I see individual glyphs in their isolated form. How do I see them in the initial/medial/final forms within the font? Precisely when I turn the font to SVG?
If all it is is that each letter can have 2-4 forms, and I am ignoring the diacritics, and there are let's say 28 characters in the alphabet (even less if you remove all diacritics), then in SVG I should see 2-4 * 28 glyphs, correct?
Then for the rules of the layout. If I draw an SVG path per glyph, is there anything special I need to do to connect the edges of the glyphs, so it forms continuous cursive? Do I need to test every combination of letters? Or is it somehow constructed, so I work on each letter variant on its own, and somehow because of the positioning of the strokes, everything will "connect"?
It is why I would like a brief overview of how the font rendering engine renders Arabic text. What is going on under the hood that would help me better understand how to do this project? How is it making the seamless connections between letters? How is it picking the variant (is it simply, "if it's in the middle, use medial, otherwise at the end, use final, otherwise at the beginning use initial, otherwise use isolated" type thing?)