Skip to content

Commit

Permalink
[ABS-1567, ABS-1593] Added a couple special cases to positioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharoncorrell committed Jul 16, 2018
1 parent 9cc467d commit 12e65bb
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 61 deletions.
94 changes: 47 additions & 47 deletions source/autogen/awami_autogen.gdl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Glyph information for font Awami Dev at Fri Jun 22 17:18:31 2018
Glyph information for font Awami Nastaliq Dev at Mon Jul 16 14:13:08 2018
*/

table(glyph) {MUnits = 2048};
Expand Down Expand Up @@ -407,7 +407,7 @@ gDotlessBeh = glyphid(400) {honorificS = point(1224m, 884m); mLowerS = point(124
gBehIni = glyphid(401) {exit = point(0m, 836m); n1LowerS = point(159m, -246m); n23LowerS = point(166m, -252m); nUpperS = point(304m, 1011m); ringS = point(201m, 67m); tahUpperS = point(353m, 1002m)};
gBehIniAi = glyphid(402) {exit = point(1m, 1016m); n1LowerS = point(573m, 800m); n23LowerS = point(621m, 715m); nUpperS = point(597m, 2364m); ringS = point(236m, 894m); tahUpperS = point(651m, 2376m)};
gBehIniBe = glyphid(403) {exit = point(0m, 933m); n1LowerS = point(222m, 440m); n23LowerS = point(228m, 434m); nLowerTightS = point(400m, 440m); nUpperS = point(133m, 1271m); ringS = point(143m, 698m); tahUpperS = point(186m, 1294m)};
gBehIniBeM1 = glyphid(404) {exit = point(0m, 798m); n1LowerS = point(259m, 302m); n23LowerS = point(278m, 302m); nUpperS = point(346m, 1670m); ringS = point(221m, 589m); tahUpperS = point(430m, 1713m)};
gBehIniBeM1 = glyphid(404) {exit = point(0m, 798m); n1LowerS = point(259m, 302m); n23LowerS = point(278m, 302m); nUpperS = point(500m, 1500m); ringS = point(221m, 589m); tahUpperS = point(510m, 1510m)};
gBehIniBeM2 = glyphid(405) {exit = point(0m, 630m); n1LowerS = point(275m, 200m); n23LowerS = point(284m, 192m); nUpperS = point(314m, 1229m); ringS = point(289m, 505m); tahUpperS = point(368m, 1228m)};
gBehIniBeNn = glyphid(406) {exit = point(0m, 1573m); n1LowerS = point(140m, 381m); n23LowerS = point(143m, 378m); nUpperS = point(346m, 1640m); ringS = point(135m, 684m); tahUpperS = point(397m, 1616m)};
gBehIniBeRe = glyphid(407) {exit = point(0m, 718m); n1LowerS = point(146m, 120m); n23LowerS = point(294m, 117m); nUpperS = point(172m, 1103m); ringS = point(16m, 353m); tahUpperS = point(146m, 1147m)};
Expand All @@ -419,7 +419,7 @@ gBehIniHdR = glyphid(412) {exit = point(0m, 491m); n1LowerS = point(503m, -10m);
gBehIniHgF = glyphid(413) {exit = point(0m, 418m); n1LowerS = point(141m, -293m); n23LowerS = point(176m, -331m); nUpperS = point(252m, 683m); ringS = point(118m, 14m); tahUpperS = point(268m, 710m)};
gBehIniHgM = glyphid(414) {exit = point(0m, 203m); n1LowerS = point(270m, -22m); n23LowerS = point(275m, -29m); nUpperS = point(293m, 1343m); ringS = point(235m, 641m); tahUpperS = point(286m, 1351m)};
gBehIniJm = glyphid(415) {exit = point(-22m, 925m); n1LowerS = point(899m, 1244m); n23LowerS = point(1076m, 1241m); nUpperS = point(428m, 1926m); ringS = point(706m, 1480m); tahUpperS = point(396m, 1908m)};
gBehIniMm = glyphid(416) {exit = point(0m, 1028m); n1LowerS = point(774m, 1255m); n23LowerS = point(971m, 1255m); nUpperS = point(353m, 1864m); ringS = point(641m, 1492m); tahUpperS = point(374m, 1888m)};
gBehIniMm = glyphid(416) {exit = point(0m, 1028m); n1LowerS = point(774m, 1255m); n23LowerS = point(971m, 1255m); nUpperS = point(530m, 1925m); ringS = point(641m, 1492m); tahUpperS = point(540m, 1935m)};
gBehIniMmX = glyphid(417) {exit = point(0m, 608m); n1LowerS = point(638m, 744m); n23LowerS = point(859m, 744m); nUpperS = point(208m, 1236m); ringS = point(465m, 905m); tahUpperS = point(250m, 1236m)};
gBehIniNn = glyphid(418) {exit = point(0m, 1259m); n1LowerS = point(312m, 825m); n23LowerS = point(427m, 820m); nUpperS = point(432m, 1738m); ringS = point(397m, 1147m); tahUpperS = point(440m, 1748m)};
gBehIniQf = glyphid(419) {exit = point(-2m, 562m); n1LowerS = point(401m, 381m); n23LowerS = point(535m, 305m); nUpperS = point(304m, 2046m); ringS = point(332m, 951m); tahUpperS = point(311m, 2053m)};
Expand Down Expand Up @@ -1076,7 +1076,7 @@ gMeemMedJm = glyphid(1069) {entrance = point(523m, 2001m); exit = point(0m, 1265
gMeemMedMm = glyphid(1070) {entrance = point(322m, 1622m); exit = point(-1m, 1146m); n1LowerS = point(736m, 1132m); nUpperS = point(558m, 2155m)};
gMeemMedMmX = glyphid(1071) {entrance = point(248m, 1004m); exit = point(0m, 522m); n1LowerS = point(548m, 504m); nUpperS = point(484m, 1537m)};
gMeemMedNn = glyphid(1072) {entrance = point(531m, 1661m); exit = point(0m, 1259m); n1LowerS = point(708m, 1056m); nUpperS = point(767m, 2194m)};
gMeemMedQf = glyphid(1073) {entrance = point(383m, 1259m); exit = point(20m, 550m); n1LowerS = point(636m, 640m); nUpperS = point(619m, 1792m)};
gMeemMedQf = glyphid(1073) {entrance = point(383m, 1259m); exit = point(20m, 550m); n1LowerS = point(636m, 640m); nUpperS = point(580m, 1792m)};
gMeemMedRe = glyphid(1074) {entrance = point(306m, 802m); exit = point(0m, 517m); n1LowerS = point(457m, 163m); nUpperS = point(542m, 1335m)};
gMeemMedSd = glyphid(1075) {entrance = point(1020m, 1847m); exit = point(0m, 920m); n1LowerS = point(1175m, 1304m); nUpperS = point(1256m, 2380m)};
gMeemMedSn = glyphid(1076) {entrance = point(255m, 1736m); exit = point(0m, 1324m); n1LowerS = point(436m, 1148m); nUpperS = point(491m, 2263m)};
Expand Down Expand Up @@ -1572,49 +1572,49 @@ g_wordRaziAllah = glyphid(1565);
g_wordSepeo = glyphid(1566);
g_wordSubuctey = glyphid(1567);
g_wordTakta = glyphid(1568);
g_Ttfautohint = glyphid(1569);
gArabic_ = glyphid(1570);
gArabic__1 = glyphid(1571);
gArabic__2 = glyphid(1572);
gArabic__3 = glyphid(1573);
gArabic__4 = glyphid(1574);
gArabic__5 = glyphid(1575);
gArabic__6 = glyphid(1576);
gArabic__7 = glyphid(1577);
gArabic__8 = glyphid(1578);
gArabic__9 = glyphid(1579);
gArabic__10 = glyphid(1580);
gArabic__11 = glyphid(1581);
gArabic__12 = glyphid(1582);
gArabic__13 = glyphid(1583);
gArabic__14 = glyphid(1584);
gArabic__15 = glyphid(1585);
gArabic__16 = glyphid(1586);
gArabic__17 = glyphid(1587);
gArabic__18 = glyphid(1588);
gArabic__19 = glyphid(1589);
gArabic__20 = glyphid(1590);
gArabic__21 = glyphid(1591);
gArabic__22 = glyphid(1592);
gArabic__23 = glyphid(1593);
gArabic__24 = glyphid(1594);
gArabic__25 = glyphid(1595);
gArabic__26 = glyphid(1596);
gArabic__27 = glyphid(1597);
gArabic__28 = glyphid(1598);
gArabic__29 = glyphid(1599);
gArabic__30 = glyphid(1600);
gArabic__31 = glyphid(1601);
gArabic__32 = glyphid(1602);
gArabic__33 = glyphid(1603);
gArabic__34 = glyphid(1604);
gArabic__35 = glyphid(1605);
gArabic__36 = glyphid(1606);
gArabic__37 = glyphid(1607);
gArabic__38 = glyphid(1608);
gArabic__39 = glyphid(1609);
gArabic__40 = glyphid(1610);
gArabic__41 = glyphid(1611);
gArabic_ = glyphid(1569);
gArabic__1 = glyphid(1570);
gArabic__2 = glyphid(1571);
gArabic__3 = glyphid(1572);
gArabic__4 = glyphid(1573);
gArabic__5 = glyphid(1574);
gArabic__6 = glyphid(1575);
gArabic__7 = glyphid(1576);
gArabic__8 = glyphid(1577);
gArabic__9 = glyphid(1578);
gArabic__10 = glyphid(1579);
gArabic__11 = glyphid(1580);
gArabic__12 = glyphid(1581);
gArabic__13 = glyphid(1582);
gArabic__14 = glyphid(1583);
gArabic__15 = glyphid(1584);
gArabic__16 = glyphid(1585);
gArabic__17 = glyphid(1586);
gArabic__18 = glyphid(1587);
gArabic__19 = glyphid(1588);
gArabic__20 = glyphid(1589);
gArabic__21 = glyphid(1590);
gArabic__22 = glyphid(1591);
gArabic__23 = glyphid(1592);
gArabic__24 = glyphid(1593);
gArabic__25 = glyphid(1594);
gArabic__26 = glyphid(1595);
gArabic__27 = glyphid(1596);
gArabic__28 = glyphid(1597);
gArabic__29 = glyphid(1598);
gArabic__30 = glyphid(1599);
gArabic__31 = glyphid(1600);
gArabic__32 = glyphid(1601);
gArabic__33 = glyphid(1602);
gArabic__34 = glyphid(1603);
gArabic__35 = glyphid(1604);
gArabic__36 = glyphid(1605);
gArabic__37 = glyphid(1606);
gArabic__38 = glyphid(1607);
gArabic__39 = glyphid(1608);
gArabic__40 = glyphid(1609);
gArabic__41 = glyphid(1610);
gArabic__42 = glyphid(1611);


/*----- Classes -----*/
Expand Down
2 changes: 1 addition & 1 deletion source/graphite/nastaliq_classes.gdh
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ cRehIso = (gReh, gZain, gRreh, gJeh, gRehDotBelow, gRehDotBelowDotAbove,
gRehTwoDotsAbove, gRehRing, gRehFourDotsAbove, gRehTwoVertAbove, gRehHamzaAbove, gRehSmallTahTwoDots);
cZainIso = (gZain, gRreh, gJeh, gRehDotBelowDotAbove,
gRehTwoDotsAbove, gRehFourDotsAbove, gRehTwoVertAbove, gRehHamzaAbove, gRehSmallTahTwoDots);
cRehFin = (gRehFin, gRehFin_jkl, gRehFin_sshg, gRehFin_hgM) ;
cRehFin = (gRehFin, gRehFin_jkl, gRehFin_hgM) ; // gRehFin_sshg -- obsolete

cWawIso = (gWaw, gWawHamzaAbove, gWawRing, gArabicU, gOe, gKirghizOe, gKirghizYu, gWawTwoAbove, gWawThreeAbove);
cWawFin = (gWawFin, gWawFin_stfh);
Expand Down
23 changes: 21 additions & 2 deletions source/graphite/nastaliq_positioning.gdh
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,8 @@ table(glyph) { AttributeOverride = 1 }
// alef, dal, reh, reh-sshg, reh-jkl, reh-???, waw, heh-goal, noon

cKernable { kernPreAlef = 0m; kernPreDal = 0m; kernPreReh = 0m; kernPreZain = 0m; kernPreWaw = 0m;
kernPreLamAlef = 0m; kernPreKafNoSp = 0m; kernPreShort = 0m; // kernPreInitial = 0m;
kernPreJeemAinIso = -130m; kernPreLamAlef = 0m; kernPreKafNoSp = 0m; kernPreShort = 0m;
// kernPreInitial = 0m;
kernPreExclam = 0m;
minKernDelta = 0m };

Expand All @@ -1644,7 +1645,7 @@ gDalFin { kernPreAlef = -90m; kernPreDal = -30m; kernPreReh = -30m; kernPreWaw
cRehIso { kernPreAlef = -90m; kernPreDal = -30m; kernPreReh = -30m; kernPreWaw = -30m; kernPreLamAlef = -30m;
// Before a two-letter sequence:
kernPreShort = 80m };
gRehFin_jkl { kernPreAlef = -70m };
gRehFin_jkl { kernPreAlef = -70m; kernPreJeemAinIso = -150 };
gWaw { kernPreAlef = -80m; kernPreReh = 40m };

gRehFin { minKernDelta = -400m };
Expand Down Expand Up @@ -1737,6 +1738,10 @@ g_parenleftArab { pairKern = -200m } / _ cQuoteLeftArab;
////cQuoteLeftArab { kern.x = -100m }
//// / g_parenleftArab _;

// Special case: yeh + beh + yeh - spread nuqtas out
g__dot2l { shift { x = -130m; y = -170m; } }
g__dot1l { shift { x = 50m; y = -220m } }
/ gBehMedBe _=N2 gBehMedCh _=N1;


// Set up kerning pairs.
Expand All @@ -1746,6 +1751,7 @@ cKernable { pairKern = kernPreDal } / _ ^ MARKS cKernIgnore? cDalIso;
cKernable { pairKern = kernPreZain } / _ ^ MARKS cKernIgnore? cZainIso;
cKernable { pairKern = kernPreReh } / _ ^ MARKS cKernIgnore? cRehIso;
cKernable { pairKern = kernPreWaw } / _ ^ MARKS cKernIgnore? cWawIso;
cKernable { pairKern = kernPreJeemAinIso } / _ ^ MARKS cKernIgnore? (cJeemIso cAinIso);
cKernable { pairKern = kernPreLamAlef} / _ ^ MARKS cKernIgnore? gLamIniAl; // gLafAlef - no longer used
cKernable { pairKern = kernPreExclam } / _ ^ MARKS cKernIgnore? g_exclamArab;

Expand Down Expand Up @@ -1948,6 +1954,19 @@ cDiacriticUpper {
// don't bother with sequence attributes
} } / (cMed cIso) _ (cKafNoIso cKafIso);

// Special case: keep pesh under follow kaf; nuqta on noon pushes it up too far.
// In fact, might as well apply this to tehs and other diacs as well.
cNuqtaUpperSmall { shift { x = -150m; y = -200m };
collision { min.x = -50m; max.y = 50m } } // keep it from moving back
cDiacriticUpper { shift { x = -200m; y = -100m } }
/ gBehIni _=N ^ _=D csKafIM_base;

cNuqtaUpper { shift.y = -100m }
cDiacriticUpper { shift { x = -150m; y = -150m };
collision { min.x = -50m; max.y = 50m } } // keep it from moving back
/ gSeenIni _=N ^ _=D csKafIM_base;


gNameMarker { collision {
flags = CLEAR_IGNORE(collision.flags);
flags = SET_FIX(collision.flags);
Expand Down
37 changes: 26 additions & 11 deletions tests/awami_tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<testgroup label="main">
<test background="#ffff7f" class="fset30" label="analyze" rtl="True">
<comment>This test is mainly for figuring out what characters are in the data.</comment>
<string>بے حد بےحد بس حد </string>
<string>نُمُو نُمو </string>
</test>
<test label="kafI &amp; seenM" rtl="True">
<string>کسس</string>
Expand Down Expand Up @@ -822,6 +822,12 @@
<test class="fset36" label="reh-dot-dot bug" rtl="True">
<string>ږازاراڔاڑاژا ږلزلرلڔلڑلژل ږوزوروڔوڑوژو </string>
</test>
<test background="#55aaff" class="fset36" label="POST V1 FEEDBACK" rtl="True">
<string/>
</test>
<test class="fset36" label="reh + isolate jeem/ain" rtl="True">
<string>چرچ چرع رج</string>
</test>
<test background="#55aaff" class="fset36" label="PUNCTUATION" rtl="True">
<string/>
</test>
Expand Down Expand Up @@ -1350,7 +1356,7 @@
<test class="fset9" label="kaf yeh teh yeh" rtl="True">
<string>کیتی</string>
</test>
<test class="fset9" label="gaf heh-do yeh-hamza noon" rtl="True">
<test class="fset30" label="gaf heh-do yeh-hamza noon" rtl="True">
<string>ڱھئن</string>
</test>
<test class="fset9" label="kaf noon/yeh waw noon-gunna" rtl="True">
Expand Down Expand Up @@ -1413,8 +1419,8 @@
<test class="fset30" label="seq 2" rtl="True">
<string>کھلی المُنکر گرفتار ارفَکشَد گرفتار سرائِیکی</string>
</test>
<test class="fset30" label="tall example from Dieter" rtl="True">
<string>کنگھجو</string>
<test class="fset30" label="tall examples from Dieter" rtl="True">
<string>کنگھجو برانگیختگی</string>
</test>
<test background="#55aaff" class="fset14" label="COLLISIONS" rtl="True">
<string/>
Expand Down Expand Up @@ -1569,7 +1575,7 @@
<test class="fset24" label="kaf meem ..." rtl="True">
<string>کمنی</string>
</test>
<test class="fset24" label="kaf-ring + meem" rtl="True">
<test class="fset40" label="kaf-ring + meem" rtl="True">
<string>ګمنی</string>
</test>
<test class="fset24" label="gaf + diac + kaf/gaf" rtl="True">
Expand All @@ -1587,7 +1593,7 @@
<test class="fset41" label="ykhty" rtl="True">
<string>یکھتے</string>
</test>
<test class="fset41" label="ktys" rtl="True">
<test class="fset30" label="ktys" rtl="True">
<string>اِکتِیس</string>
</test>
<test class="fset30" label="long - kaf &amp; final" rtl="True">
Expand Down Expand Up @@ -2017,10 +2023,10 @@
</testgroup>
<testgroup label="Features">
<test class="fset36" label="hamza - default" rtl="True">
<string>ٔ أ ؤ ئ ۂ ۓ ٵ ݬ ځ</string>
<string>ٔ أ أ ؤ ؤ ئ ۂ ۓ ٵ ݬ ځ</string>
</test>
<test class="fset22" label="alt hamza - isolate" rtl="True">
<string>ٔ أ ؤ ئ ۂ ۓ ٵ ݬ ځ</string>
<string>ٔ أ أ ؤ ؤ ئ ۂ ۓ ٵ ݬ ځ</string>
</test>
<test class="fset22" label="alt hamza - right-connecting" rtl="True">
<string>سأ صؤ مۂ بۓ جٵ قݬ</string>
Expand Down Expand Up @@ -2806,7 +2812,7 @@ Is absBehIni.hd too thick at right edge?</comment>
<test class="fset36" label="short lam" rtl="True">
<string>لګس للگک</string>
</test>
<test background="#55aaff" class="fset36" label="PASS 6" rtl="True">
<test background="#55aaff" class="fset36" label="PASS 6 - alternate glyphs" rtl="True">
<string/>
</test>
<test class="fset36" label="noon+small-V + gaf" rtl="True">
Expand Down Expand Up @@ -2839,7 +2845,7 @@ Is absBehIni.hd too thick at right edge?</comment>
<comment>obsolete case</comment>
<string>ګٽه ګبہ</string>
</test>
<test background="#55aaff" class="fset36" label="PASS 9" rtl="True">
<test background="#55aaff" class="fset36" label="PASS 9 - attach nuqtas" rtl="True">
<string/>
</test>
<test class="fset36" label="beh + yeh + jeem" rtl="True">
Expand All @@ -2856,7 +2862,7 @@ Is absBehIni.hd too thick at right edge?</comment>
<test class="fset36" label="jeem + yeh + jeem" rtl="True">
<string>کہیجیخ</string>
</test>
<test background="#55aaff" class="fset19" label="PASS 10 (pos pass 3)" rtl="True">
<test background="#55aaff" class="fset19" label="PASS 10 (pos pass 3) - collision settings" rtl="True">
<string/>
</test>
<test class="fset36" label="beh + kaf/lam + heh-doachashmee [rule 21-23]" rtl="True">
Expand Down Expand Up @@ -2949,6 +2955,9 @@ Is absBehIni.hd too thick at right edge?</comment>
<test class="fset36" label="reh/hehgoal + Arabic hamza" rtl="True">
<string>رء بہء</string>
</test>
<test class="fset36" label="yeh + beh + yeh" rtl="True">
<string>بیبی</string>
</test>
<test background="#55aaff" class="fset24" label="PASSES 16 &amp; 17" rtl="True">
<string/>
</test>
Expand All @@ -2975,6 +2984,9 @@ Is absBehIni.hd too thick at right edge?</comment>
<test class="fset36" label="alef + zabar-two-dots + kaf/gaf" rtl="True">
<string>آٞک داٞگ بھاٞگ</string>
</test>
<test class="fset36" label="noon/teh + pesh + kaf" rtl="True">
<string>نُکّڑ تَگف شُکر</string>
</test>
<test background="#55aaff" class="fset36" label="PASS 18 (pos pass11)" rtl="True">
<string/>
</test>
Expand Down Expand Up @@ -3035,6 +3047,9 @@ Is absBehIni.hd too thick at right edge?</comment>
<test class="fset36" label="lots of lower nutqas (reversed)" rtl="True">
<string>کہیجیخ</string>
</test>
<test class="fset36" label="noon + teh + yeh" rtl="True">
<string>نتیس</string>
</test>
</testgroup>
<testgroup label="Punctuation">
<test class="fset37" label="exclamation mark, colon, parens - Latin">
Expand Down

0 comments on commit 12e65bb

Please sign in to comment.