Skip to content

Commit

Permalink
Improve latin kerning and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshtr committed Feb 4, 2021
1 parent 129bb43 commit e883cfb
Show file tree
Hide file tree
Showing 4 changed files with 570 additions and 9 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ TTF=$(FONTS:%=$(BLDDIR)/$(NAME)-%.ttf)
WOFF2=$(FONTS:%=$(BLDDIR)/$(NAME)-%.woff2)
PDFS=$(FONTS:%=$(BLDDIR)/$(NAME)-%-ligatures.pdf) \
$(FONTS:%=$(BLDDIR)/$(NAME)-%-content.pdf) \
$(FONTS:%=$(BLDDIR)/$(NAME)-%-kerning.pdf) \
$(FONTS:%=$(BLDDIR)/$(NAME)-%-table.pdf)

$(BLDDIR)/%.otf: $(SRCDIR)/%.ufo
Expand Down Expand Up @@ -45,6 +46,12 @@ $(BLDDIR)/%-ligatures.pdf: $(BLDDIR)/%.ttf
--foreground=333333 --text-file $(tests)/ligatures.txt \
--output-file $(BLDDIR)/$(@F);

$(BLDDIR)/%-kerning.pdf: $(BLDDIR)/%.ttf
@echo " TEST $(@F)"
@hb-view $< --font-size 14 --margin 100 --line-space 1.5 \
--foreground=333333 --text-file $(tests)/kerning.txt \
--output-file $(BLDDIR)/$(@F);

$(BLDDIR)/%-content.pdf: $(BLDDIR)/%.ttf
@echo " TEST $(@F)"
@hb-view $< --font-size 14 --margin 100 --line-space 1.5 \
Expand Down
11 changes: 8 additions & 3 deletions sources/features/kerning.fea
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@ lookup viramaPos {
@lc_left_slant = [v w];
@lc_left_round = [e c a d o q g];
@lc_right_round = [a e b c o p g];
@lc_postive_space = [r f y v w ];
@lc_above_base = [a b c d e f h i k l m n o r s t u v w x z];
@lc_negative_space = [j];

@uc_left_slant = [V Y W T];
@uc_right_slant = [V Y W T];
@uc_right_slant = [V Y W T F];
@uc_left_round = [O Q];
@uc_right_round = [O Q D P];

lookup latinPos {
lookupflag 0;
pos @lc_right_slant @lc_left_round -50;
pos @lc_right_round @lc_left_slant -50;
pos @lc_postive_space @lc_negative_space -350;
pos @lc_above_base @lc_negative_space -300;

pos @uc_right_slant @lc_left_round -160;
pos @uc_right_slant @uc_left_slant -160;

pos A @uc_left_slant -160;
pos A @uc_left_slant -200;
pos A @lc_left_slant -80;
pos @uc_right_slant A -160;
pos @uc_right_slant A -200;

pos @uc_right_slant @uc_left_round -160;
pos @uc_right_round @uc_left_slant -160;
Expand Down
6 changes: 0 additions & 6 deletions tests/content.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,3 @@ Le droit au respect de la vie privée figure à l'article 12 de Déclaration
universelle des droits de l'homme de 19481, à l'article 8 de la Convention
européenne des droits de l'homme et à l'article 17 du Pacte

PJ GAYATHRI SANTHOSH BINOY KAVYA DOMINIC ADHESION OFFER YOURS APPLE TV YAVYLT
Va Ve We Ya Ye ve
we ye te tv fv vo ovowa
Tv Ao AO To TO Lo La LV LW LO WJ VJ

ന്റ് അത്" "()" അത്) ന്റി ന്റീ
Loading

0 comments on commit e883cfb

Please sign in to comment.