[smc-discuss] [Git][smc/raghumalayalamsans][master] Update build system
Santhosh Thottingal
gitlab at mg.gitlab.com
Sat Apr 2 21:38:40 PDT 2016
Santhosh Thottingal pushed to branch master at SMC / RaghuMalayalamSans
Commits:
8d235f36 by Santhosh Thottingal at 2016-04-03T10:07:33+05:30
Update build system
- - - - -
10 changed files:
- Makefile
- README
- RaghuMalayalamSans.sfd → RaghuMalayalamSans-Regular.sfd
- + features/features.fea
- + features/kerning.fea
- + features/lookups.fea
- + features/tables.fea
- + tests/tests.txt
- + tools/build.py
- + tools/requirements.txt
Changes:
=====================================
Makefile
=====================================
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,34 @@
#!/usr/bin/make -f
fontpath=/usr/share/fonts/truetype/malayalam
-font=RaghuMalayalamSans
-
+fonts=RaghuMalayalamSans-Regular
+feature=features/features.fea
+PY=python2.7
+buildscript=tools/build.py
+version=1.2
default: compile
-all: compile webfonts
-
-compile:
- @echo "Generating ${font}.ttf"
- @fontforge -lang=ff -c "Open('${font}.sfd'); Generate('${font}.ttf')";
+all: compile
-webfonts:compile
- @echo "Generating webfonts";
- @sfntly -w ${font}.ttf ${font}.woff;
- @sfntly -e -x ${font}.ttf ${font}.eot;
- @[ -x `which woff2_compress` ] && woff2_compress ${font}.ttf;
+compile: clean
+ @for font in `echo ${fonts}`;do \
+ echo "Generating $$font.ttf";\
+ $(PY) $(buildscript) $$font.sfd $(feature) $(version);\
+ done;
install: compile
- @install -D -m 0644 ${font}.ttf ${DESTDIR}/${fontpath}/${font}.ttf;
+ @for font in `echo ${fonts}`;do \
+ install -D -m 0644 $${font}.ttf ${DESTDIR}/${fontpath}/$${font}.ttf;\
+ done;
+
+test: compile
+# Test the fonts
+ @for font in `echo ${fonts}`; do \
+ echo "Testing font $${font}";\
+ hb-view $${font}.ttf --text-file tests/tests.txt --output-file tests/$${font}.pdf;\
+ done;
+dist:
+ @for font in `echo ${fonts}`;do \
+ cp $${font}.ttf ttf/$${font}.ttf;\
+ done;
+clean:
+ @rm -rf *.ttf *.sfd-* *.woff* *.eot
\ No newline at end of file
=====================================
README
=====================================
--- a/README
+++ b/README
@@ -5,3 +5,15 @@ This first Version called RaghuMalayalam font Original Version 1.00 (2005) is a
RaghuMalayalam font Original Version 1.00 (2005) has been designed and developed, by Prof. R. K. Joshi (TypeFont Design Director, Visiting Design Specialist at C-DAC Mumbai) in association with Mr. Rajith Kumar K. M. (TypeFont Designer), assisted by Mr. Nirmal Biswas, Ms. Jui Mhatre and Ms. Supriya Kharkar at C-DAC Mumbai (formerly NCST).
In 2008, developers from swathanthra Malayalam Computing started maintaining the font as a tribute to him. Suresh P modified opentype tables and added more glyphs to make it compatible with modern rendering systems.
+
+Building from source
+--------------------
+1. Install fontforge and python-fontforge
+2. Install the python libraries required for build script:
+ ```
+ pip install -r tools/requirements.txt
+ ```
+3. Build the ttf, woff, woff2 files:
+ ```
+ make
+ ```
\ No newline at end of file
=====================================
RaghuMalayalamSans.sfd → RaghuMalayalamSans-Regular.sfd
=====================================
=====================================
features/features.fea
=====================================
--- /dev/null
+++ b/features/features.fea
@@ -0,0 +1,90 @@
+languagesystem mlm2 dflt;
+languagesystem mlym dflt;
+
+include (tables.fea)
+include (lookups.fea)
+
+feature akhn {
+
+ script mlm2;
+ language dflt ;
+ lookup akhnAkhandinMalaylam2lookup0;
+
+ script mlym;
+ language dflt ;
+ lookup akhnAkhandinMalaylamlookup0;
+} akhn;
+
+feature pref {
+
+ script mlm2;
+ language dflt ;
+ lookup prefPreBaseFormsinMalaylam2lookup1;
+} pref;
+
+feature blwf {
+
+ script mlm2;
+ language dflt ;
+ lookup blwfBelowBaseFormsinMalaylam2lookup2;
+
+ script mlym;
+ language dflt ;
+ lookup blwfBelowBaseFormsinMalaylamlookup2;
+} blwf;
+
+feature pstf {
+
+ script mlm2;
+ language dflt ;
+ lookup pstfPostBaseFormsinMalaylam2lookup3;
+
+ script mlym;
+ language dflt ;
+ lookup pstfPostBaseFormsinMalaylamlookup3;
+} pstf;
+
+feature blws {
+
+ script mlm2;
+ language dflt ;
+ lookup blwsBelowBaseSubstitutionsinMalaylamMalaylam2lookup4;
+
+ script mlym;
+ language dflt ;
+ lookup blwsBelowBaseSubstitutionsinMalaylamMalaylam2lookup4;
+} blws;
+
+feature half {
+
+ script mlym;
+ language dflt ;
+ lookup halfHalfFormsinMalaylamlookup5;
+} half;
+
+feature haln {
+
+ script mlym;
+ language dflt ;
+ lookup halnHalantFormsinMalaylamlookup6;
+} haln;
+
+feature pres {
+
+ script mlm2;
+ language dflt ;
+ lookup presPreBaseSubstitutionsinMalaylam2lookup7;
+
+ script mlym;
+ language dflt ;
+ lookup presPreBaseSubstitutionsinMalaylamlookup7;
+} pres;
+
+feature psts {
+
+ script mlym;
+ language dflt ;
+ lookup pstsPostBaseSubstitutionsinMalaylamlookup8;
+} psts;
+
+
=====================================
features/kerning.fea
=====================================
--- /dev/null
+++ b/features/kerning.fea
@@ -0,0 +1,36 @@
+
+# GPOS
+
+
+lookup kernHorizontalKerninglookup0 {
+ lookupflag 0;
+ pos xx quotesingle 200;
+ pos xx quotedbl 200;
+ pos xx quoteleft 200;
+ pos xx quoteright 200;
+ pos n1rh i1 200;
+ pos n1rh i2 200;
+} kernHorizontalKerninglookup0;
+
+feature kern {
+
+ script DFLT;
+ language dflt ;
+ lookup kernHorizontalKerninglookup0;
+
+ script latn;
+ language dflt ;
+ lookup kernHorizontalKerninglookup0;
+
+ script mlm2;
+ language dflt ;
+ lookup kernHorizontalKerninglookup0;
+
+ script mlym;
+ language dflt ;
+ lookup kernHorizontalKerninglookup0;
+} kern;
+#Mark attachment classes (defined in GDEF, used in lookupflags)
+ at nomark = [ ];
+
+
=====================================
features/lookups.fea
=====================================
--- /dev/null
+++ b/features/lookups.fea
@@ -0,0 +1,440 @@
+
+
+# GSUB
+
+
+lookup akhnAkhandinMalaylamlookup0 {
+ lookupflag 0;
+ sub k1 xx ZWJ by k1.cil;
+ sub nh xx ZWJ by nh.cil;
+ sub n1 xx ZWJ by n1.cil;
+ sub r3 xx ZWJ by r3.cil;
+ sub l3 xx ZWJ by l3.cil;
+ sub lh xx ZWJ by lh.cil;
+ sub k1 xx sh by glyph142;
+ sub ch3 xx nj by ch3nj;
+ sub k1 xx k1 by k1k1;
+ sub ng xx k1 by ngk1;
+ sub t1 xx t1 by t1t1;
+ sub th3 xx th3 by th3th3;
+ sub ng xx ng by ngng;
+ sub nj xx nj by njnj;
+ sub nj xx ch1 by njch1;
+ sub nj xx ch2 by njch2;
+ sub nh xx t3 by nht3;
+ sub nh xx t1 by nht1;
+ sub th1 xx th1 by th1th1;
+ sub th1 xx s1 by th1s1;
+ sub th1 xx th2 by th1th2;
+ sub th1 xx m1 by th1m1;
+ sub th1 xx p4 by th1p4;
+ sub th1 xx n1 by th1n1;
+ sub th3 xx th4 by th3th4;
+ sub n1 xx n1 by n1n1;
+ sub n1 xx th3 by n1th3;
+ sub n1 xx th1 by n1th1;
+ sub n1 xx th4 by n1th4;
+ sub n1 xx m1 by n1m1;
+ sub n1 xx th2 by n1th2;
+ sub m1 xx m1 by m1m1;
+ sub m1 xx p1 by m1p1;
+ sub z1 xx ch1 by z1ch1;
+ sub s1 xx th2 by s1th2;
+ sub h1 xx n1 by h1n1;
+ sub h1 xx m1 by h1m1;
+ sub lh xx lh by lh_lh;
+ sub k4 xx n1 by k4_n1;
+ sub k3 xx k3 by k3_k3;
+ sub k1 xx sh xx m1 by k1shm1;
+ sub ch1 xx ch1 by ch1_glyph133;
+ sub ch1 xx ch2 by ch1_ch2;
+ sub t3 xx t3 by t3_t3;
+ sub t3 xx t4 by t3_t4;
+ sub nh xx nh by nh_nh;
+ sub nh xx t2 by nh_t2;
+ sub p1 xx p1 by p1p1;
+ sub p3 xx p3 by p3p3;
+ sub rh xx rh by rh_rh;
+ sub z1 xx z1 by z1_z1;
+ sub n1 xx rh by n1.cil_uni0D31;
+ sub uni25CC a2 anuswara by aam;
+} akhnAkhandinMalaylamlookup0;
+
+lookup akhnAkhandinMalaylam2lookup0 {
+ lookupflag 0;
+ sub k1 xx ZWJ by k1.cil;
+ sub nh xx ZWJ by nh.cil;
+ sub n1 xx ZWJ by n1.cil;
+ sub r3 xx ZWJ by r3.cil;
+ sub l3 xx ZWJ by l3.cil;
+ sub lh xx ZWJ by lh.cil;
+ sub k1 xx sh by glyph142;
+ sub ch3 xx nj by ch3nj;
+ sub k1 xx k1 by k1k1;
+ sub ng xx k1 by ngk1;
+ sub t1 xx t1 by t1t1;
+ sub th3 xx th3 by th3th3;
+ sub ng xx ng by ngng;
+ sub k1 xx th1 by k1th1;
+ sub k3 xx m1 by k3m1;
+ sub k3 xx th3th4 by k3th3th4;
+ sub k3 xx n1 by k3n1;
+ sub ch3 xx ch3 by ch3ch3;
+ sub nj xx ch3 by njch3;
+ sub nj xx nj by njnj;
+ sub nj xx ch1 by njch1;
+ sub nj xx ch2 by njch2;
+ sub nh xx m1 by nhm1;
+ sub nh xx t3 by nht3;
+ sub nh xx t1 by nht1;
+ sub th1 xx th1 by th1th1;
+ sub th1 xx s1 by th1s1;
+ sub th1 xx th2 by th1th2;
+ sub th1 xx m1 by th1m1;
+ sub th1 xx p4 by th1p4;
+ sub th1 xx n1 by th1n1;
+ sub th3 xx th4 by th3th4;
+ sub n1 xx n1 by n1n1;
+ sub n1 xx th3 by n1th3;
+ sub n1 xx th1 by n1th1;
+ sub n1 xx th4 by n1th4;
+ sub n1 xx m1 by n1m1;
+ sub n1 xx th2 by n1th2;
+ sub m1 xx m1 by m1m1;
+ sub m1 xx p1 by m1p1;
+ sub z1 xx ch1 by z1ch1;
+ sub s1 xx th2 by s1th2;
+ sub h1 xx n1 by h1n1;
+ sub h1 xx m1 by h1m1;
+ sub lh xx lh by lh_lh;
+ sub k1 xx s1 by k1_s1;
+ sub k1 xx t1 by k1_t1;
+ sub k4 xx n1 by k4_n1;
+ sub k3 xx k3 by k3_k3;
+ sub k1 xx sh xx m1 by k1shm1;
+ sub ch1 xx ch1 by ch1_glyph133;
+ sub ch1 xx ch2 by ch1_ch2;
+ sub t3 xx t3 by t3_t3;
+ sub t3 xx t4 by t3_t4;
+ sub t3 xx ch3 by t3_ch3;
+ sub nh xx nh by nh_nh;
+ sub nh xx t2 by nh_t2;
+ sub p1 xx p1 by p1p1;
+ sub p1 xx n1 by p1_n1;
+ sub p1 xx s1 by p1_s1;
+ sub p1 xx th1 by p1_th1;
+ sub p3 xx p3 by p3p3;
+ sub p3 xx th3 by p3_th3;
+ sub p3 xx th4 by p3_th4;
+ sub p3 xx k1 by p3_k1;
+ sub p2 xx k1 by p2_k1;
+ sub p2 xx th1 by p2_th1;
+ sub m1 xx n1 by m1_n1;
+ sub y1 xx y1 by y1y1;
+ sub y1 xx m1 by y1_m1;
+ sub y1 xx p1 by y1_p1;
+ sub y1 xx k1 by y1_k1;
+ sub y1 xx k1 xx k1 by y1_k1k1;
+ sub y1 xx th1 by y1_th1;
+ sub y1 xx th1 xx th1 by y1_th1th1;
+ sub rh xx rh by rh_rh;
+ sub l3 xx l3 by l3_l3.bb;
+ sub l3 xx p1 by l3_p1;
+ sub l3 xx k1 by l3_k1;
+ sub l3 xx m1 by l3_m1;
+ sub v1 xx v1 by v1_glyph133;
+ sub z1 xx z1 by z1_z1;
+ sub z1 xx n1 by z1_n1;
+ sub z1 xx m1 by z1_m1;
+ sub sh xx p1 by sh_p1;
+ sub sh xx k1 by sh_k1;
+ sub sh xx nh by sh_nh;
+ sub sh xx t1 by sh_t1;
+ sub sh xx t2 by sh_t2;
+ sub sh xx m1 by sh_m1;
+ sub sh xx p2 by sh_p2;
+ sub sh xx th1 by sh_th1;
+ sub sh xx n1 by sh_n1;
+ sub s1 xx s1 by s1_s1;
+ sub s1 xx rh xx rh by s1_rh_rh;
+ sub s1 xx p1 by s1_p1;
+ sub s1 xx th1 by s1_th1;
+ sub s1 xx k1 by s1_k1;
+ sub s1 xx n1 by s1_n1;
+ sub s1 xx m1 by s1_m1;
+ sub zh xx th1 by zh_th1;
+ sub zh xx k1 by zh_k1;
+ sub zh xx th1 xx th1 by zh_th1th1;
+ sub zh xx m1 by zh_m1;
+ sub n1 xx rh by n1.cil_uni0D31;
+ sub uni25CC a2 anuswara by aam;
+ sub l3 xx k1 xx k1 by l3_k1_xx_k1;
+ sub l3 xx th1 xx th1 by l3_th1_xx_th1;
+ sub l3 xx th1 by l3_th1;
+} akhnAkhandinMalaylam2lookup0;
+
+lookup prefPreBaseFormsinMalaylam2lookup1 {
+ lookupflag 0;
+ sub xx r3 by r4;
+} prefPreBaseFormsinMalaylam2lookup1;
+
+lookup blwfBelowBaseFormsinMalaylamlookup2 {
+ lookupflag 0;
+ sub l3 xx by l3.bb;
+} blwfBelowBaseFormsinMalaylamlookup2;
+
+lookup blwfBelowBaseFormsinMalaylam2lookup2 {
+ lookupflag 0;
+ sub xx l3 by l3.bb;
+} blwfBelowBaseFormsinMalaylam2lookup2;
+
+lookup pstfPostBaseFormsinMalaylamlookup3 {
+ lookupflag 0;
+ sub y1 xx by y2;
+ sub r3 xx by r4;
+ sub v1 xx by v2;
+} pstfPostBaseFormsinMalaylamlookup3;
+
+lookup pstfPostBaseFormsinMalaylam2lookup3 {
+ lookupflag 0;
+ sub xx y1 by y2;
+ sub xx v1 by v2;
+} pstfPostBaseFormsinMalaylam2lookup3;
+
+lookup blwsBelowBaseSubstitutionsinMalaylamMalaylam2lookup4 {
+ lookupflag 0;
+ sub k1 l3.bb by k1_l3.bb;
+ sub k3 l3.bb by k3_l3.bb;
+ sub th1 l3.bb by th1_l3.bb;
+ sub p1 l3.bb by p1_l3.bb;
+ sub p3 l3.bb by p3_l3.bb;
+ sub p2 l3.bb by p2_l3.bb;
+ sub m1 l3.bb by m1_l3.bb;
+ sub l3 l3.bb by l3_l3.bb;
+ sub v1 l3.bb by v1_l3.bb;
+ sub z1 l3.bb by z1_l3.bb;
+ sub s1 l3.bb by s1_l3.bb;
+ sub h1 l3.bb by h1_l3.bb;
+} blwsBelowBaseSubstitutionsinMalaylamMalaylam2lookup4;
+
+lookup halfHalfFormsinMalaylamlookup5 {
+ lookupflag 0;
+ sub k1 xx ZWJ by k1.cil;
+ sub nh xx ZWJ by nh.cil;
+ sub n1 xx ZWJ by n1.cil;
+ sub r3 xx ZWJ by r3.cil;
+ sub l3 xx ZWJ by l3.cil;
+ sub lh xx ZWJ by lh.cil;
+ sub k1 xx by k1_xx;
+ sub k2 xx by k2_xx;
+ sub k3 xx by k3_xx;
+ sub k4 xx by k4_xx;
+ sub ng xx by ng_xx;
+ sub ch1 xx by ch1_xx;
+ sub ch2 xx by ch2_xx;
+ sub ch3 xx by ch3_xx;
+ sub ch4 xx by ch4_xx;
+ sub nj xx by nj_xx;
+ sub t1 xx by t1_xx;
+ sub t2 xx by t2_xx;
+ sub t3 xx by t3_xx;
+ sub t4 xx by t4_xx;
+ sub nh xx by nh_xx;
+ sub th1 xx by th1_xx;
+ sub th2 xx by th2_xx;
+ sub th3 xx by th3_xx;
+ sub th4 xx by th4_xx;
+ sub n1 xx by n1_xx;
+ sub p1 xx by p1_xx;
+ sub p2 xx by p2_xx;
+ sub p3 xx by p3_xx;
+ sub p4 xx by p4_xx;
+ sub m1 xx by m1_xx;
+ sub y1 xx by y1_xx;
+ sub r3 xx by r3_xx;
+ sub rh xx by rh_xx;
+ sub l3 xx by l3_xx;
+ sub lh xx by lh_xx;
+ sub zh xx by zh_xx;
+ sub v1 xx by v1_xx;
+ sub z1 xx by z1_xx;
+ sub sh xx by sh_xx;
+ sub s1 xx by s1_xx;
+ sub h1 xx by h1_xx;
+ sub rh_rh xx by rh_rh_xx;
+} halfHalfFormsinMalaylamlookup5;
+
+lookup halnHalantFormsinMalaylamlookup6 {
+ lookupflag 0;
+ sub k1 xx ZWJ by k1.cil;
+ sub nh xx ZWJ by nh.cil;
+ sub n1 xx ZWJ by n1.cil;
+ sub r3 xx ZWJ by r3.cil;
+ sub l3 xx ZWJ by l3.cil;
+ sub lh xx ZWJ by lh.cil;
+} halnHalantFormsinMalaylamlookup6;
+
+lookup presPreBaseSubstitutionsinMalaylamlookup7 {
+ lookupflag 0;
+ sub k1_xx th1 by k1th1;
+ sub k3_xx m1 by k3m1;
+ sub k3_xx th3th4 by k3th3th4;
+ sub k3_xx n1 by k3n1;
+ sub ch3_xx ch3 by ch3ch3;
+ sub nj_xx ch3 by njch3;
+ sub nh_xx m1 by nhm1;
+ sub k1_xx l3 by k1_l3.bb;
+ sub k1_xx s1 by k1_s1;
+ sub k1_xx t1 by k1_t1;
+ sub k3_xx l3 by k3_l3.bb;
+ sub t3_xx ch3 by t3_ch3;
+ sub th1_xx l3 by th1_l3.bb;
+ sub p1_xx n1 by p1_n1;
+ sub p1_xx l3 by p1_l3.bb;
+ sub p1_xx s1 by p1_s1;
+ sub p1_xx th1 by p1_th1;
+ sub p3_xx l3 by p3_l3.bb;
+ sub p3_xx th3 by p3_th3;
+ sub p3_xx th4 by p3_th4;
+ sub p3_xx k1 by p3_k1;
+ sub p2_xx l3 by p2_l3.bb;
+ sub p2_xx k1 by p2_k1;
+ sub p2_xx th1 by p2_th1;
+ sub m1_xx l3 by m1_l3.bb;
+ sub m1_xx n1 by m1_n1;
+ sub y1_xx m1 by y1_m1;
+ sub y1_xx p1 by y1_p1;
+ sub y1_xx k1 by y1_k1;
+ sub y1_xx th1 by y1_th1;
+ sub l3_xx l3 by l3_l3.bb;
+ sub l3_xx p1 by l3_p1;
+ sub l3_xx k1 by l3_k1;
+ sub l3_xx m1 by l3_m1;
+ sub v1_xx l3 by v1_l3.bb;
+ sub z1_xx l3 by z1_l3.bb;
+ sub z1_xx n1 by z1_n1;
+ sub z1_xx m1 by z1_m1;
+ sub sh_xx p1 by sh_p1;
+ sub sh_xx k1 by sh_k1;
+ sub sh_xx nh by sh_nh;
+ sub sh_xx t1 by sh_t1;
+ sub sh_xx t2 by sh_t2;
+ sub sh_xx m1 by sh_m1;
+ sub sh_xx p2 by sh_p2;
+ sub sh_xx th1 by sh_th1;
+ sub sh_xx n1 by sh_n1;
+ sub s1_xx s1 by s1_s1;
+ sub s1_xx l3 by s1_l3.bb;
+ sub s1_xx p1 by s1_p1;
+ sub s1_xx th1 by s1_th1;
+ sub s1_xx k1 by s1_k1;
+ sub s1_xx n1 by s1_n1;
+ sub s1_xx m1 by s1_m1;
+ sub h1_xx l3 by h1_l3.bb;
+ sub zh_xx th1 by zh_th1;
+ sub zh_xx k1 by zh_k1;
+ sub zh_xx m1 by zh_m1;
+ sub k1_xx r3 by r3.pb_uni0D15;
+ sub k1 r4 by r3.pb_uni0D15;
+ sub k3_xx r3 by r3.pb_uni0D17;
+ sub k3 r4 by r3.pb_uni0D17;
+ sub k4_xx r3 by r3.pb_uni0D18;
+ sub k4 r4 by r3.pb_uni0D18;
+ sub ch2_xx r3 by r3.pb_uni0D1B;
+ sub ch2 r4 by r3.pb_uni0D1B;
+ sub ch3_xx r3 by r3.pb_uni0D1C;
+ sub ch3 r4 by r3.pb_uni0D1C;
+ sub ch4_xx r3 by r3.pb_uni0D1D;
+ sub ch4 r4 by r3.pb_uni0D1D;
+ sub t1_xx r3 by r3.pb_uni0D1F;
+ sub t1 r4 by r3.pb_uni0D1F;
+ sub t3_xx r3 by r3.pb_uni0D21;
+ sub t3 r4 by r3.pb_uni0D21;
+ sub t4_xx r3 by r3.pb_uni0D22;
+ sub t4 r4 by r3.pb_uni0D22;
+ sub th1_xx r3 by r3.pb_uni0D24;
+ sub th1 r4 by r3.pb_uni0D24;
+ sub th3_xx r3 by r3.pb_uni0D26;
+ sub th3 r4 by r3.pb_uni0D26;
+ sub th4_xx r3 by r3.pb_uni0D27;
+ sub th4 r4 by r3.pb_uni0D27;
+ sub n1_xx r3 by r3.pb_uni0D28;
+ sub n1 r4 by r3.pb_uni0D28;
+ sub p1 r4 by r3.pb_uni0D2A;
+ sub p1_xx r3 by r3.pb_uni0D2A;
+ sub p2_xx r3 by r3.pb_uni0D2B;
+ sub p2 r4 by r3.pb_uni0D2B;
+ sub p3_xx r3 by r3.pb_uni0D2C;
+ sub p3 r4 by r3.pb_uni0D2C;
+ sub p4_xx r3 by r3.pb_uni0D2D;
+ sub p4 r4 by r3.pb_uni0D2D;
+ sub m1_xx r3 by r3.pb_uni0D2E;
+ sub m1 r4 by r3.pb_uni0D2E;
+ sub v1_xx r3 by r3.pb_uni0D35;
+ sub v1 r4 by r3.pb_uni0D35;
+ sub z1 r4 by r3.pb_uni0D36;
+ sub z1_xx r3 by r3.pb_uni0D36;
+ sub sh_xx r3 by r3.pb_uni0D37;
+ sub sh r4 by r3.pb_uni0D37;
+ sub s1_xx r3 by r3.pb_uni0D38;
+ sub s1 r4 by r3.pb_uni0D38;
+ sub h1_xx r3 by r3.pb_uni0D39;
+ sub h1 r4 by r3.pb_uni0D39;
+ sub rh_rh_xx r3 by r3.pb_glyph218;
+ sub rh_rh r4 by r3.pb_glyph218;
+ sub nht3 r4 by r3.pb_glyph159;
+ sub nht3 xx r3 by r3.pb_glyph159;
+ sub nht1 r4 by r3.pb_glyph160;
+ sub nht1 xx r3 by r3.pb_glyph160;
+ sub n1th3 r4 by r3.pb_glyph169;
+ sub n1th3 xx r3 by r3.pb_glyph169;
+ sub n1th1 r4 by r3.pb_glyph170;
+ sub n1th1 xx r3 by r3.pb_glyph170;
+ sub m1p1 r4 by r3.pb_glyph175;
+ sub m1p1 xx r3 by r3.pb_glyph175;
+ sub n1th4 r4 by r3.pb_glyph171;
+ sub n1th4 xx r3 by r3.pb_glyph171;
+} presPreBaseSubstitutionsinMalaylamlookup7;
+
+lookup presPreBaseSubstitutionsinMalaylam2lookup7 {
+ lookupflag 0;
+ sub r4 k1 by r3.pb_uni0D15;
+ sub r4 k3 by r3.pb_uni0D17;
+ sub r4 k4 by r3.pb_uni0D18;
+ sub r4 ch2 by r3.pb_uni0D1B;
+ sub r4 ch3 by r3.pb_uni0D1C;
+ sub r4 ch4 by r3.pb_uni0D1D;
+ sub r4 t1 by r3.pb_uni0D1F;
+ sub r4 t3 by r3.pb_uni0D21;
+ sub r4 t4 by r3.pb_uni0D22;
+ sub r4 th1 by r3.pb_uni0D24;
+ sub r4 th3 by r3.pb_uni0D26;
+ sub r4 th4 by r3.pb_uni0D27;
+ sub r4 n1 by r3.pb_uni0D28;
+ sub r4 p1 by r3.pb_uni0D2A;
+ sub r4 p2 by r3.pb_uni0D2B;
+ sub r4 p3 by r3.pb_uni0D2C;
+ sub r4 p4 by r3.pb_uni0D2D;
+ sub r4 m1 by r3.pb_uni0D2E;
+ sub r4 v1 by r3.pb_uni0D35;
+ sub r4 z1 by r3.pb_uni0D36;
+ sub r4 sh by r3.pb_uni0D37;
+ sub r4 s1 by r3.pb_uni0D38;
+ sub r4 h1 by r3.pb_uni0D39;
+ sub r4 rh_rh by r3.pb_glyph218;
+ sub r4 nht3 by r3.pb_glyph159;
+ sub r4 nht1 by r3.pb_glyph160;
+ sub r4 n1th3 by r3.pb_glyph169;
+ sub r4 n1th1 by r3.pb_glyph170;
+ sub r4 m1p1 by r3.pb_glyph175;
+ sub r4 n1th4 by r3.pb_glyph171;
+} presPreBaseSubstitutionsinMalaylam2lookup7;
+
+lookup pstsPostBaseSubstitutionsinMalaylamlookup8 {
+ lookupflag 0;
+ sub y1 y2 by y1y1;
+ sub y1_xx k1k1 by y1_k1k1;
+ sub y1_xx th1th1 by y1_th1th1;
+ sub v1 v2 by v1_glyph133;
+ sub s1_xx rh_rh by s1_rh_rh;
+} pstsPostBaseSubstitutionsinMalaylamlookup8;
=====================================
features/tables.fea
=====================================
--- /dev/null
+++ b/features/tables.fea
@@ -0,0 +1,46 @@
+#Mark attachment classes (defined in GDEF, used in lookupflags)
+
+ at GDEF_Simple = [.null nonmarkingreturn space exclam quotedbl numbersign
+ dollar percent ampersand quotesingle parenleft parenright asterisk plus
+ comma hyphen period slash zero one two three four five six seven eight
+ nine colon semicolon less equal greater question at bracketleft
+ backslash bracketright asciicircum underscore grave braceleft bar
+ braceright asciitilde anuswara visarga ml_a ml_aa ml_i ml_ii ml_u ml_uu
+ ml_r ml_l ml_e ml_ee ml_ai ml_o ml_oo ml_au1 k1 k2 k3 k4 ng ch1 ch2 ch3
+ ch4 nj t1 t2 t3 t4 nh th1 th2 th3 th4 n1 p1 p2 p3 p4 m1 y1 r3 rh l3 lh
+ zh v1 z1 sh s1 h1 a2 i1 i2 u1 u2 r1 e1 e2 ai1 o1 o2 au1 xx au2 ml_rr
+ ml_ll ml_0 ml_1 ml_2 ml_3 ml_4 ml_5 ml_6 ml_7 ml_8 ml_9 uni200B ZWNJ
+ ZWJ quoteleft quoteright quotedblleft quotedblright uni25CC glyph133 l1
+ l2 zh_th1th1 nhcil2 nlcil2 r3cil2 l3cil2 lhcil2 k1cil2 ml_1000 rh_half
+ n2 ml_100];
+ at GDEF_Ligature = [k1.cil nh.cil n1.cil r3.cil l3.cil lh.cil l3.bb y2 r4 v2
+ glyph142 ch3nj k1k1 ngk1 t1t1 th3th3 ngng k1th1 k3m1 k3th3th4 k3n1
+ ch3ch3 njch3 njnj njch1 njch2 nhm1 nht3 nht1 th1th1 th1s1 th1th2 th1m1
+ th1p4 th1n1 th3th4 n1n1 n1th3 n1th1 n1th4 n1m1 n1th2 m1m1 m1p1 z1ch1
+ s1th2 h1n1 h1m1 lh_lh k1_l3.bb k1_s1 k1_t1 k4_n1 k3_k3 k3_l3.bb k1shm1
+ ch1_glyph133 ch1_ch2 t3_t3 t3_t4 t3_ch3 nh_nh nh_t2 th1_l3.bb p1p1
+ p1_n1 p1_l3.bb p1_s1 p1_th1 p3p3 p3_l3.bb p3_th3 p3_th4 p3_k1 p2_l3.bb
+ p2_k1 p2_th1 m1_l3.bb m1_n1 y1y1 y1_m1 y1_p1 y1_k1 y1_k1k1 y1_th1
+ y1_th1th1 rh_rh l3_l3.bb l3_p1 l3_k1 l3_m1 v1_glyph133 v1_l3.bb z1_z1
+ z1_l3.bb z1_n1 z1_m1 sh_p1 sh_k1 sh_nh sh_t1 sh_t2 sh_m1 sh_p2 sh_th1
+ sh_n1 s1_s1 s1_l3.bb s1_rh_rh s1_p1 s1_th1 s1_k1 s1_n1 s1_m1 h1_l3.bb
+ zh_th1 zh_k1 zh_m1 n1.cil_uni0D31 r3.pb_uni0D15 r3.pb_uni0D17
+ r3.pb_uni0D18 r3.pb_uni0D1B r3.pb_uni0D1C r3.pb_uni0D1D r3.pb_uni0D1F
+ r3.pb_uni0D21 r3.pb_uni0D22 r3.pb_uni0D24 r3.pb_uni0D26 r3.pb_uni0D27
+ r3.pb_uni0D28 r3.pb_uni0D2A r3.pb_uni0D2B r3.pb_uni0D2C r3.pb_uni0D2D
+ r3.pb_uni0D2E r3.pb_uni0D35 r3.pb_uni0D36 r3.pb_uni0D37 r3.pb_uni0D38
+ r3.pb_uni0D39 r3.pb_glyph218 r3.pb_glyph159 r3.pb_glyph160
+ r3.pb_glyph169 r3.pb_glyph170 r3.pb_glyph175 k1_xx k2_xx k3_xx k4_xx
+ ng_xx ch1_xx ch2_xx ch3_xx ch4_xx nj_xx t1_xx t2_xx t3_xx t4_xx nh_xx
+ th1_xx th2_xx th3_xx th4_xx n1_xx p1_xx p2_xx p3_xx p4_xx m1_xx y1_xx
+ r3_xx rh_xx l3_xx lh_xx zh_xx v1_xx z1_xx sh_xx s1_xx h1_xx rh_rh_xx
+ r3.pb_glyph171 aam l3_k1_xx_k1 l3_th1_xx_th1 l3_th1 ];
+
+ at GDEF_Mark = [xx dotreph];
+table GDEF {
+ # 1. Bases: single character, spacing glyphs.
+ # 2. Ligatures: multiple character, spacing glyphs.
+ # 3. Marks: non-spacing combining glyphs.
+ # 4. Components: part of single character, spacing glyphs.
+ GlyphClassDef @GDEF_Simple, @GDEF_Ligature, @GDEF_Mark, ;
+} GDEF;
=====================================
tests/tests.txt
=====================================
--- /dev/null
+++ b/tests/tests.txt
@@ -0,0 +1,207 @@
+Arabic Numerals
+0 1 2 3 4 5 6 7 8 9
+--------------------
+Malayalam Numerals
+൦ ൧ ൨ ൩ ൪ ൫ ൬ ൭ ൮ ൯
+--------------------
+Malayalam numbers
+10 ൰
+100 ൱
+1000 ൲
+Quarter ൳
+Half ൴
+ThreeQuarter ൵
+--------------------
+Date Marks
+10൹
+10-ാം
+6 ാം
+--------------------
+എടാാാാ എടാാാാാാാാ
+ാ ി ു
+1-ാം, 1-ാമത്തെ, 1ാം, 1ാമത്തെ
+--------------------
+Dotreph ൎ + various glyphs
+ൎഠ
+ൎപ
+ൎത
+ൎവ
+അഥൎവ്വം
+തീൎത്ഥം
+തീൎത്ഥ്
+ചൎക്ക
+നിൎഗ്ഗളം
+വൎത്തുളം
+ചൎച്ച
+ചൎച്ച്
+മാൎച്ച്
+മാൎത്ത
+ഭാൎയ
+ഭാൎയ്യ
+ദുൎഗ്ഗുണം
+അൎദ്ധവൃത്തം
+നിൎലോഭം
+നിൎല്ലോഭം
+ഉൎവശി
+ഉൎവ്വശി
+തൎജമ
+തൎജ്ജമ
+സൂൎയന്
+സൂൎയ്യന്
+അൎജ്ജുനന്
+മാൎജ്ജാരന്
+--------------------
+Rendering glyphs with r4 ( ്ര)
+പ്ര
+ഥ്ര
+ഖ്ര
+ക്സ്ര
+ന്റ്ര
+ബ്ര
+പ്പ്ര
+സ്പ്ര
+സ്പ്രി
+സ്പ്രേ
+ഗ്ദ്ധ്രോ
+ക്ത്ര
+സബ്ഗ്രൂപ്പ്
+മുഖ്യമന്ത്രി
+സ്വാതന്ത്ര്യം
+പ്രസിഡന്റ്
+മഞ്ഞപ്പ്രസാദം
+സാമ്രാജ്യം
+വൈസ്രോയി
+അബ്സ്റ്റ്രാക്റ്റ്
+--------------------
+ഒന്നു്
+ചര്ച്ചയ്ക്കു്
+ചര്ച്ചയ്ക്ക്
+യൗവനം
+ഔഷധം
+കൌമുദി
+സ്വപ്നം
+--------------------
+ആന്റണി
+ആന്റി ആന്റീ
+എന്റുപ്പാപ്പ
+എന്റെ
+വിന്റേജ്
+ആന്റോ
+പാന്റ്
+ഹെന്റി
+എന്റിക്കലെക്സി
+--------------------
+കാറ്റ്
+മുറ്റത്ത്
+കാറ്റാടി
+വറ്റില്ല
+അറ്റുപോയി
+ഏറ്റെടുത്തു
+മാറ്റൊലി
+ലക്ചററോട്
+ലാറ്ററൈറ്റ്മണ്ണ്
+--------------------
+ക്സ
+ബ്സ
+ബ്സു
+ക്ത
+ക്കു
+ക്കൂ
+യ്ക
+യ്ക്ക
+യ്ക്കു
+യ്ക്കൂ
+യ്ത
+യ്ക്കു
+യ്ത്ത
+യ്ത്തു
+യ്ന
+യ്നു
+ല്ക
+ല്ക്ക
+ല്ക്കു
+ല്തു
+ല്ത്തൂ
+ല്പ
+ല്പു
+ഷ്ക്ക
+ഷ്ക്കു
+ഷ്ഠൂ
+ഴ്വ
+ഭൄ
+ഥൃ
+ശ്ന
+വ്ശ
+ശ്ക
+ശ്ക്ക
+ശ്ദ
+ശ്പ
+ശ്ബ
+ദ്ഗ
+ദ്ന
+ദ്ല
+ദ്ബ
+ദ്മ
+സ്ഗ
+സ്ഹ
+ഹ്ത
+പ്ത
+പ്തു
+സ്പ്ലേ
+കയ്പ്
+കയ്പ്പ്
+ആഴ്ച്ച
+ആഴ്ച
+അജ്മീര്
+പച്ചപ്പയ്യ്
+കല്ല്
+ഉവ്വ്
+കുറ്റ്യാടി
+വയ്യ
+യ്യു
+വ്വു
+വ്വൂ
+യ്യൂ
+ല്ലു
+ല്ലൂ
+എല്ലായ്പ്പോഴും
+--------------------
+'എനിയ്ക്ക്'
+"പപ്പയുടെ സ്വന്തം അപ്പൂസ്"
+"അവനി വാഴ്വ് കിനാവ്"
+"അവള്ക്ക്"
+--------------------
+പറയ്വോ?
+പോയ്വര്വോ?
+--------------------
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+sed do eiusmod tempor incididunt ut labore et dolore magna
+aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
+laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
+dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum
+
+
+ഒരാൾ സ്വയം ജീവിതം അവസാനം സത്യം ഇവര് അവള് മീന്
+ജപം തറ ആന പീപ്പി അപ്പൂസ് ജര്മനി മലയാളം ഇനം
+മതം ഇഗ്വാന കാവ്യ സന്താപം സൈസ് അഛന് മഴ
+അറ കൌമ വാഴ്വ് സ്വപ്നം കിനാവ് വിജയം
+ജനിതകഘടനയില് അങ്ങാടി മാങ്ങാപ്പഴം ഓടീ
+മെയിലിങ് ധനാഗമനമാര്ഗങ്ങള് അധ്യാപകന്
+സംസ്കാരം)
+
+ “And not only the labourers but also the classes directly or indirectly
+exploiting the labourers are made subject, through the division of labour,
+to the tool of their function: the empty-minded bourgeois to his own
+capital and his own insane craving for profits; the lawyer to his fossilised
+legal conceptions, which dominate him as an independent power; the
+'educated classes' in general to their manifold species of local narrow
+-mindedness and one-sidedness, to their own physical and mental short
+-sightedness, to their stunted growth due to their narrow specialised
+education and their being chained for life to this specialised activity
+even when this specialised activity is merely to do nothing.” എന്ന്
+ഏംഗല്സ് നൂറു വര്ഷം മുമ്പേ Anti-Duhring(1876)ല് പറഞ്ഞുവെച്ചതാണ്.
+എല്ലാ അറിവുകളും വിരല്ചൂണ്ടുന്നത് പ്രവൃത്തിയിലേയ്ക്കാണ്.
+
=====================================
tools/build.py
=====================================
--- /dev/null
+++ b/tools/build.py
@@ -0,0 +1,141 @@
+#!/usr/bin/python
+# coding=utf-8
+#
+# Font build utility
+#
+
+import sys
+import time
+import os
+import fontforge
+import psMat
+from tempfile import mkstemp
+from fontTools.ttLib import TTFont
+from fontTools.ttx import makeOutputFileName
+
+
+def flattenNestedReferences(font, ref, new_transform=(1, 0, 0, 1, 0, 0)):
+ """Flattens nested references by replacing them with the ultimate reference
+ and applying any transformation matrices involved, so that the final font
+ has only simple composite glyphs. This to work around what seems to be an
+ Apple bug that results in ignoring transformation matrix of nested
+ references."""
+
+ name = ref[0]
+ transform = ref[1]
+ glyph = font[name]
+ new_ref = []
+ if glyph.references and glyph.foreground.isEmpty():
+ for nested_ref in glyph.references:
+ for i in flattenNestedReferences(font, nested_ref, transform):
+ matrix = psMat.compose(i[1], new_transform)
+ new_ref.append((i[0], matrix))
+ else:
+ matrix = psMat.compose(transform, new_transform)
+ new_ref.append((name, matrix))
+
+ return new_ref
+
+
+def validateGlyphs(font):
+ """Fixes some common FontForge validation warnings, currently handles:
+ * wrong direction
+ * flipped references
+ In addition to flattening nested references."""
+
+ wrong_dir = 0x8
+ flipped_ref = 0x10
+ for glyph in font.glyphs():
+ state = glyph.validate(True)
+ refs = []
+
+ if state & flipped_ref:
+ glyph.unlinkRef()
+ glyph.correctDirection()
+ if state & wrong_dir:
+ glyph.correctDirection()
+
+ for ref in glyph.references:
+ for i in flattenNestedReferences(font, ref):
+ refs.append(i)
+ if refs:
+ glyph.references = refs
+
+infont = sys.argv[1]
+font = fontforge.open(infont)
+outfont = infont.replace(".sfd", ".ttf")
+tmpfont = mkstemp(suffix=os.path.basename(outfont))[1]
+
+# Remove all GSUB lookups
+for lookup in font.gsub_lookups:
+ font.removeLookup(lookup)
+
+# Remove all GPOS lookups
+for lookup in font.gpos_lookups:
+ font.removeLookup(lookup)
+
+# Merge the new featurefile
+font.mergeFeature(sys.argv[2])
+font.version = sys.argv[3]
+font.appendSFNTName('English (US)', 'Version',
+ sys.argv[3] + '.0+' + time.strftime('%Y%m%d'))
+font.selection.all()
+font.correctReferences()
+font.simplify()
+font.selection.none()
+# fix some common font issues
+validateGlyphs(font)
+font.generate(tmpfont, flags=("omit-instructions", "round", "opentype"))
+font.close()
+# now open in fontTools
+font = TTFont(tmpfont, recalcBBoxes=0)
+
+# our 'name' table is a bit bulky, and of almost no use in for web fonts,
+# so we strip all unnecessary entries.
+name = font['name']
+names = []
+for record in name.names:
+ platID = record.platformID
+ langID = record.langID
+ nameID = record.nameID
+
+ # we keep only en_US entries in Windows and Mac platform id, every
+ # thing else is dropped
+ if (platID == 1 and langID == 0) or (platID == 3 and langID == 1033):
+ if nameID == 13:
+ # the full OFL text is too much, replace it with a simple
+ # string
+ if platID == 3:
+ # MS strings are UTF-16 encoded
+ text = 'OFL v1.1'.encode('utf_16_be')
+ else:
+ text = 'OFL v1.1'
+ record.string = text
+ names.append(record)
+ # keep every thing else except Descriptor, Sample Text
+ elif nameID not in (10, 19):
+ names.append(record)
+
+name.names = names
+
+# FFTM is FontForge specific, remove it
+del(font['FFTM'])
+# force compiling GPOS/GSUB tables by fontTools, saves few tens of KBs
+for tag in ('GPOS', 'GSUB'):
+ font[tag].compile(font)
+
+font.save(outfont)
+# Generate WOFF
+woffFileName = makeOutputFileName(infont, outputDir=None, extension='.woff')
+print("Processing %s => %s" % (infont, woffFileName))
+font.flavor = "woff"
+font.save(woffFileName, reorderTables=False)
+# Generate WOFF2
+woff2FileName = makeOutputFileName(infont, outputDir=None, extension='.woff2')
+print("Processing %s => %s" % (infont, woff2FileName))
+font.flavor = "woff2"
+font.save(woff2FileName, reorderTables=False)
+
+font.close()
+
+os.remove(tmpfont)
=====================================
tools/requirements.txt
=====================================
--- /dev/null
+++ b/tools/requirements.txt
@@ -0,0 +1,2 @@
+git+https://github.com/google/brotli@v0.3.0#egg=Brotli
+fonttools >= 3.0
\ No newline at end of file
View it on GitLab: https://gitlab.com/smc/raghumalayalamsans/commit/8d235f36aa69500da5724bbf3388585d71172f55
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.smc.org.in/pipermail/discuss-smc.org.in/attachments/20160403/17d3b74f/attachment-0001.htm>
More information about the discuss
mailing list