Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-letter Kashida #317

Open
avidseeker opened this issue Oct 14, 2024 · 2 comments
Open

Single-letter Kashida #317

avidseeker opened this issue Oct 14, 2024 · 2 comments

Comments

@avidseeker
Copy link

Currently, applying Kashida is by adding "ـ" U+0640 ARABIC TATWEEL between letters. However, a more elegant way is by stretching a specific letter within the word. This method is popular with old scriptures, calligraphy, and handwritten messages.

Here is a rough estimate of the algorithm for the improved Kashida.

  • Start with the last word in a line, and apply stretching to the final letter in that word.
  • However, if the letter is not "stretch-able" (e.g: Arabic Meem م), then look for middle-form Kaaf (ك) and stretch that
  • If there is no Kaaf, apply the fallback Kashida by adding TATWEEL between letters.
  • TATWEEL is usually added to the last two connected letters. These letters are not necessarily the last letters of the word since they could be in isolated form (e.g: "الماء" --> "المـــاء") Notice that "اء" are isolated (they cannot connect).
  • Stretch-able letter forms are: كـ, ـن, ن, ت, ـت, س, ـس, ص, ـص, ـى, ى, ف, ـف (where س and ت also their dotted variants e.g: ش and ث). Also have a look on https://en.wikipedia.org/wiki/Arabic_alphabet#Table_of_basic_letters for reference.

Examples: (Taken from KFGQPC print of Quran).

kaaf-alif-maqsura-kashida

Single-letter Kashida applied to initial form "كـ" and final "ـى"

kaaf-baa-kashida

Applied to "ـكـ" and "ـب" in "الكتب"

kaaf-faa-kashida

Applied to "كـ" and "ـف" in "كيف"

kaf-kashida

Applied to "ـكـ"

regular-kashida

Applied to last two connected letters in "الناس" (notice that س and ا are not connected) and last two connected letters in "عظيم".

image

Here is an example for a line. The algorithm works by

  1. Choose the last word in the line (الذين). Apply stretching to the last letter "ن".
  2. Next, to fill more space, look for a initial form "كـ" or medial form "ـكـ", which is in this case "شاكر" then stretch it.
  3. Next, to fill more space, look in the list for stretch-able letters, and stretch "ن" in "فإن".
  4. Done. Notice how the priority goes for single-letters rather than filling in between letters. This is a more beautiful usage of Arabic calligraphy.
@jbezos
Copy link
Contributor

jbezos commented Oct 14, 2024

Thank you for the detailed explanation. It’s in my todo list, and I my first idea was to base the solution in some kind of transform, but now I’m not sure it’s feasible. I have to investigate a bit further the exact implementation (I mean, the code).

@avidseeker
Copy link
Author

Referencing Tex SE discussion: https://tex.stackexchange.com/questions/595220/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants