summaryrefslogtreecommitdiff
path: root/src/features/dlig.fea
blob: 836ecca181b8c7ad3507d1a0408cbcb367da70ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Discretionary Ligatures
# https://learn.microsoft.com/en-us/typography/opentype/spec/features_ae#dlig

# Set IgnoreMarks to skip over marks in lookups.
# For example, if we have /f/acutecomb/i, treat lookup as /f/i
# https://learn.microsoft.com/en-us/typography/opentype/spec/chapter2#lookup-table
lookupflag IgnoreMarks;

# fi
sub f' [
  i idotless idotless.double itildebelow ibar igrave iacute iogonek
  ihookabove idotbelow icyrillic ij i.sc

  j jdotless jdotlessbar uni0249 uni0249.ccmp jcrosstail yotgreek jecyrillic
] by f.i;

# ff -> ff'
@DLIG_f_L = [ f fdotaccent feng ];
@DLIG_f_R = [ f.1 fdotaccent.1 feng.1 ];

# tt -> tt'
@DLIG_t_L = [
  t tpalatalhook tcedilla tcaron tcommaaccent tdotaccent tdotbelow
  tlinebelow tcircumflexbelow tdieresis
];

@DLIG_t_R = [
  t.1 tpalatalhook.1 tcedilla.1 tcaron.1 tcommaaccent.1 tdotaccent.1 tdotbelow.1
  tlinebelow.1 tcircumflexbelow.1 tdieresis.1
];

# left side "trigger" glyph for t.1 and f.1 sub
@DLIG_t1_L = [
  @DLIG_f_L @DLIG_f_R

  k khook kcommaaccent kcaron kacute kdotbelow klinebelow k.base

  r rrthook uni024D rfishhook rdescend racute rcommaaccent rcaron
  rdblgrave rinvertedbreve rdotaccent rdotbelow rdotbelowmacron rlinebelow

  @DLIG_t_L @DLIG_t_R

  v vtilde vdotbelow

  w wdieresis wcircumflex wgrave wacute wdotaccent wdotbelow wring

  x xdotaccent xdieresis khacyrillic chi

  y ydieresis uni024F yacute ycircumflex uni0233 ydotaccent yring ygrave ydotbelow
  yhookabove ytilde ucyrillic ushortcyrillic umacroncyrillic udieresiscyrillic
  uhungarumlautcyrillic yogonek y.sc

  # lower case glyphs with long ("beyond x-height") left vertical stroke
  d dcroat drthook dhook dtopbar dcurl ddotaccent ddotbelow dlinebelow dcedilla
  dcircumflexbelow dong

  l lslash lbar lmidtilde lrthook lbelt lcurl ldot lacute
  lcommaaccent lcaron
  ldotbelow ldotbelowmacron llinebelow lcircumflexbelow
  l.ss02 lslash.ss02 lbar.ss02 lmidtilde.ss02 lbelt.ss02 ldot.ss02 lacute.ss02
  lcommaaccent.ss02 lcaron.ss02
  ldotbelow.ss02 ldotbelowmacron.ss02 llinebelow.ss02 lcircumflexbelow.ss02

];


# ffi (note. f.i is sub'd by liga)
sub f [ f f.i ]' i by f.i.1;

# tt, ft, rt, tf, ff, ft ...
sub @DLIG_t1_L @DLIG_t_L' by @DLIG_t_R;
sub @DLIG_t1_L @DLIG_f_L' by @DLIG_f_R;

# interrobang
sub exclam question by interrobang;
sub question exclam by interrobang;
sub exclamdown questiondown by invertedinterrobang;
sub questiondown exclamdown by invertedinterrobang;