Skip to content

Commit

Permalink
Use rlig feature instead of calt
Browse files Browse the repository at this point in the history
This should’ve been the tag used all along since these replacement are
required for the proper rendering of the font, and some Adobe apps
disable calt by default.
  • Loading branch information
khaledhosny committed Mar 12, 2024
1 parent 735b390 commit 6e2ea14
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 107 deletions.
Binary file modified fonts/Amiri-Bold.ttf
Binary file not shown.
Binary file modified fonts/Amiri-BoldItalic.ttf
Binary file not shown.
Binary file modified fonts/Amiri-Italic.ttf
Binary file not shown.
Binary file modified fonts/Amiri-Regular.ttf
Binary file not shown.
Binary file modified fonts/AmiriQuran.ttf
Binary file not shown.
Binary file modified fonts/AmiriQuranColored.ttf
Binary file not shown.
180 changes: 90 additions & 90 deletions sources/contextuals.fea

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sources/enclosing.fea
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lookup Sign4 {

# first we replace any sequence of digits (up to two, three or four places)
# following a subtending sign by smaller alternates
feature calt {
feature rlig {
sub [endofayah-ar] @Digits' lookup digit2small @Digits' lookup digit2small @Digits' lookup digit2small;
sub [endofayah-ar footnotemarker-ar] @Digits' lookup digit2small @Digits' lookup digit2small;
sub [endofayah-ar footnotemarker-ar] @Digits' lookup digit2small;
Expand All @@ -30,7 +30,7 @@ feature calt {
sub [number-ar year-ar pagenumber-ar samvat-ar]' lookup Sign3 @Digits' lookup digit2medi @Digits' lookup digit2medi @Digits' lookup digit2medi;
sub [number-ar year-ar pagenumber-ar samvat-ar] @Digits' lookup digit2medi @Digits' lookup digit2medi;
sub [number-ar year-ar pagenumber-ar samvat-ar] @Digits' lookup digit2medi;
} calt;
} rlig;

# Then we contextually kern the sign with the digits so that they get enclosed by it
#
Expand Down
18 changes: 9 additions & 9 deletions sources/lellah.fea
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# including Tashkil marks that can't but be the name of Allah and ignore the
# special form for any other occurrences, but this is far from being simple.
#
# The first calt substitutes any [<Alef>]<Lam><Lam><Heh> preceded by a letter
# The first feature substitutes any [<Alef>]<Lam><Lam><Heh> preceded by a letter
# that is known not to be part of any of the allowed words by a regular non
# special form. The next block will then substitute the allowed context, given
# it meets a certain criteria.
Expand Down Expand Up @@ -40,13 +40,13 @@ lookup LamMediLellah {
# This a stripped down version of the above for use in Amiri Quran,
# because here we can safely assume the [<Faa>]<Lam><Lam><Heh> sequence always
# mean the name of Allah.
feature calt {
feature rlig {
lookupflag IgnoreMarks;
# لله
sub lam-ar.init' lookup LamInitLellah lam-ar.medi' lookup LamMediLellah @Hf' lookup HehFinaLellah;
# فلله
sub [feh-ar.init]' lam-ar.medi' lookup LamMediFaLellah lam-ar.medi' lookup LamMediLellah @Hf' lookup HehFinaLellah;
} calt;
} rlig;

#else
lookup LamLamInitX {
Expand All @@ -58,7 +58,7 @@ lookup LamLamInitX {
@aBaa_init = [beh-ar.init teh-ar.init];
@aBaa_medi = [beh-ar.medi teh-ar.medi];
@Ignore = [@aAyn.fina @aAyn.isol @aAlf.isol @aAlf.fina @aBaa.fina @aBaa.isol @aDal.fina @aDal.isol @aFaa.fina @aFaa.isol @aHaa.fina @aHaa.isol @aHeh.fina @aHeh.isol @aKaf.fina @aKaf.isol @aLam.fina @aLam.isol @aMem.fina @aMem.isol @aNon.fina @aNon.isol @aQaf.fina @aQaf.isol @aRaa.fina @aRaa.isol @aSad.fina @aSad.isol @aSen.fina @aSen.isol @aTaa.fina @aTaa.isol @aWaw.fina @aWaw.isol @aYaa.fina @aYaa.isol];
feature calt {
feature rlig {
lookupflag IgnoreMarks;
# Allow الله/ولله/ـالله
ignore sub [@Ai @Af waw-ar] lam-ar.init' lam-ar.medi' @Hf;
Expand All @@ -76,9 +76,9 @@ feature calt {
ignore sub [@aBaa_init kaf-ar.init feh-ar.init] @Af' lam-ar.init' lam-ar.medi' @Hf;
# Supress any remaining *ـالله
sub @Af' lam-ar.init' lookup LamLamInitX lam-ar.medi' lookup LamLamInitX @Hf;
} calt;
} rlig;

feature calt {
feature rlig {
# لله
sub lam-ar.init' lookup LamInitLellah lam-ar.medi' lookup LamMediLellah @Hf' lookup HehFinaLellah;
sub lam-ar.init' lookup LamInitLellah lam-ar.medi' lookup LamMediLellah shadda-ar' @Hf' lookup HehFinaLellah;
Expand Down Expand Up @@ -117,12 +117,12 @@ feature calt {
sub feh-ar.init' fatha-ar' lam-ar.medi' lookup LamMediFaLellah kasra-ar' lam-ar.medi' lookup LamMediLellah @Hf' lookup HehFinaLellah;
sub feh-ar.init' fatha-ar' lam-ar.medi' lookup LamMediFaLellah kasra-ar' lam-ar.medi' lookup LamMediLellah shadda-ar' @Hf' lookup HehFinaLellah;
sub feh-ar.init' fatha-ar' lam-ar.medi' lookup LamMediFaLellah kasra-ar' lam-ar.medi' lookup LamMediLellah shadda-ar' @xF' @Hf' lookup HehFinaLellah;
} calt;
} rlig;

# Now put shadda+dagger alef above the medial lam if there are no marks on it.
feature calt {
feature rlig {
sub lam-ar.medi.Lellah' heh-ar.fina.Lellah by lam-ar.medi.Lellah2;
} calt;
} rlig;

# This stylistic set removes them.
feature ss06 {
Expand Down
12 changes: 6 additions & 6 deletions sources/quran.fea
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ lookup LamAlefFina {
sub alef-ar by alef-ar.fina.LamAlfFina;
} LamAlefFina;

feature calt {
feature rlig {
lookupflag IgnoreMarks;
# hamza between lam and alef needs special treatment as it should not have
# a connecting stroke to avoid breaking lam-alef.
sub lam-ar' lookup LamAlefIsol hamza-ar' lookup FloatingHamza alef-ar' lookup LamAlefIsol;
sub lam-ar.fina' lookup LamAlefFina hamza-ar' lookup FloatingHamza alef-ar' lookup LamAlefFina;
# Medial hamza.
sub @before' lookup Before hamza-ar' lookup MedialHamza @after' lookup After;
} calt;
} rlig;

# This is the Unicode-sanctioned way of lam-alef with medial hamza.
feature ccmp {
Expand All @@ -106,18 +106,18 @@ lookup hamzakasra {
sub wawHamzaabove-ar by waw-ar hamzabelow-ar;
} hamzakasra;

feature calt {
feature rlig {
# lookupflag IgnoreMarks;
sub [yehHamzaabove-ar yehHamzaabove-ar.init yehHamzaabove-ar.medi yehHamzaabove-ar.fina wawHamzaabove-ar wawHamzaabove-ar.fina]' lookup hamzakasra [kasra-ar kasratan-ar openkasratan-ar];
} calt;
} rlig;

#endif
# small waw after isolated/final heh is lower than usual, so we use an
# alternate glyph for that
feature calt {
feature rlig {
lookupflag IgnoreMarks;
sub [@aHeh.isol @aHeh.fina] [wawSmall-ar]' by [wawSmall-ar.low];
} calt;
} rlig;

# some glyphs need more room to accommodate madda mark, so we change the advance
# width on fly.
Expand Down

0 comments on commit 6e2ea14

Please sign in to comment.