Page 1 of 1

caractères arabes

Posted: Sat Oct 01, 2022 11:25 am
by boussairi
bonjour
j'ai deux ligatures arabes
première ligature composée de deux caractères
-premier caractère : caractère init
-deuxième caractère : caractère médi
par exemple (كت)
deuxième ligature composée aussi de deux caractères
-premier caractère : caractère médi (identique au deuxième caractère de la première ligature)
-deuxième caractère : caractère finale
par exemple (تا)
et je veux lorsque j'écris le mot(كتا) le programme garde seulement le premier caractère de la première ligature et l'ajoute au deuxième ligature
et merci

English Translation
Hello
I have two Arab ligatures
first ligature composed of two characters
-first character: init character
-second character: medium character
for example (كت)
second ligature also composed of two characters
-first character: medium character (identical to the second character of the first ligature)
-second character: final character
for example (تا)
and I want when I write the word (كتا) the program only keeps the first character of the first ligature and adds it to the second ligature
and thank you

Re: caractères arabes

Posted: Mon Oct 03, 2022 4:07 pm
by Erwin Denissen
It can be done with help of a contextual substitution lookup. See this sample feature code:

Code: Select all

languagesystem arab dflt; # Arabic default

lookup Ligature1 { # GSUB lookup type Ligature
    sub kaf-arab.init teh-arab.medi by kafteh-arab.init;
} Ligature1;

feature init { # Initial Forms
    sub kaf-arab by kaf-arab.init;
} init;

feature medi { # Medial Forms
    sub teh-arab by teh-arab.medi;
} medi;

feature fina { # Terminal Forms
    sub alef-arab by alef-arab.fina;
    sub teh-arab by teh-arab.fina;
} fina;

feature clig { # Contextual Ligatures
    ignore sub kaf-arab.init' teh-arab.medi' alef-arab.fina;
    sub kaf-arab.init' lookup Ligature1 teh-arab.medi';
} clig;

feature liga { # Standard Ligatures
    sub teh-arab.medi alef-arab.fina by tehalef-arab.fina;
} liga;

Re: caractères arabes

Posted: Tue Oct 04, 2022 3:24 pm
by boussairi
Thanks Erwin Denissen it works perfectly.