font-afk.lua /size: 6866 b    last modification: 2020-07-01 14:35
1if not modules then modules = { } end modules ['font-afk'] = {
2    version   = 1.001,
3    comment   = "companion to font-lib.mkiv",
4    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5    copyright = "PRAGMA ADE / ConTeXt Development Team",
6    license   = "see context related readme files",
7    dataonly  = true,
8}
9
10--[[ldx--
11<p>For ligatures, only characters with a code smaller than 128 make sense,
12anything larger is encoding dependent. An interesting complication is that a
13character can be in an encoding twice but is hashed once.</p>
14--ldx]]--
15
16local allocate = utilities.storage.allocate
17
18fonts.handlers.afm.helpdata = {
19    ligatures = allocate { -- okay, nowadays we could parse the name but type 1 fonts
20        ['f'] = { -- don't have that many ligatures anyway
21            { 'f', 'ff' },
22            { 'i', 'fi' },
23            { 'l', 'fl' },
24        },
25        ['ff'] = {
26            { 'i', 'ffi' }
27        },
28        ['fi'] = {
29            { 'i', 'fii' }
30        },
31        ['fl'] = {
32            { 'i', 'fli' }
33        },
34        ['s'] = {
35            { 't', 'st' }
36        },
37        ['i'] = {
38            { 'j', 'ij' }
39        },
40    },
41    texligatures = allocate {
42     -- ['space'] = {
43     --     { 'L', 'Lslash' },
44     --     { 'l', 'lslash' }
45     -- },
46     -- ['question'] = {
47     --     { 'quoteleft', 'questiondown' }
48     -- },
49     -- ['exclam'] = {
50     --     { 'quoteleft', 'exclamdown' }
51     -- },
52        ['quoteleft'] = {
53            { 'quoteleft', 'quotedblleft' }
54        },
55        ['quoteright'] = {
56            { 'quoteright', 'quotedblright' }
57        },
58        ['hyphen'] = {
59            { 'hyphen', 'endash' }
60        },
61        ['endash'] = {
62            { 'hyphen', 'emdash' }
63        }
64    },
65    leftkerned = allocate {
66        AEligature = "A",  aeligature = "a",
67        OEligature = "O",  oeligature = "o",
68        IJligature = "I",  ijligature = "i",
69        AE         = "A",  ae         = "a",
70        OE         = "O",  oe         = "o",
71        IJ         = "I",  ij         = "i",
72        Ssharp     = "S",  ssharp     = "s",
73    },
74    rightkerned = allocate {
75        AEligature = "E",  aeligature = "e",
76        OEligature = "E",  oeligature = "e",
77        IJligature = "J",  ijligature = "j",
78        AE         = "E",  ae         = "e",
79        OE         = "E",  oe         = "e",
80        IJ         = "J",  ij         = "j",
81        Ssharp     = "S",  ssharp     = "s",
82    },
83    bothkerned = allocate {
84        Acircumflex = "A",  acircumflex = "a",
85        Ccircumflex = "C",  ccircumflex = "c",
86        Ecircumflex = "E",  ecircumflex = "e",
87        Gcircumflex = "G",  gcircumflex = "g",
88        Hcircumflex = "H",  hcircumflex = "h",
89        Icircumflex = "I",  icircumflex = "i",
90        Jcircumflex = "J",  jcircumflex = "j",
91        Ocircumflex = "O",  ocircumflex = "o",
92        Scircumflex = "S",  scircumflex = "s",
93        Ucircumflex = "U",  ucircumflex = "u",
94        Wcircumflex = "W",  wcircumflex = "w",
95        Ycircumflex = "Y",  ycircumflex = "y",
96
97        Agrave = "A",  agrave = "a",
98        Egrave = "E",  egrave = "e",
99        Igrave = "I",  igrave = "i",
100        Ograve = "O",  ograve = "o",
101        Ugrave = "U",  ugrave = "u",
102        Ygrave = "Y",  ygrave = "y",
103
104        Atilde = "A",  atilde = "a",
105        Itilde = "I",  itilde = "i",
106        Otilde = "O",  otilde = "o",
107        Utilde = "U",  utilde = "u",
108        Ntilde = "N",  ntilde = "n",
109
110        Adiaeresis = "A",  adiaeresis = "a",  Adieresis = "A",  adieresis = "a",
111        Ediaeresis = "E",  ediaeresis = "e",  Edieresis = "E",  edieresis = "e",
112        Idiaeresis = "I",  idiaeresis = "i",  Idieresis = "I",  idieresis = "i",
113        Odiaeresis = "O",  odiaeresis = "o",  Odieresis = "O",  odieresis = "o",
114        Udiaeresis = "U",  udiaeresis = "u",  Udieresis = "U",  udieresis = "u",
115        Ydiaeresis = "Y",  ydiaeresis = "y",  Ydieresis = "Y",  ydieresis = "y",
116
117        Aacute = "A",  aacute = "a",
118        Cacute = "C",  cacute = "c",
119        Eacute = "E",  eacute = "e",
120        Iacute = "I",  iacute = "i",
121        Lacute = "L",  lacute = "l",
122        Nacute = "N",  nacute = "n",
123        Oacute = "O",  oacute = "o",
124        Racute = "R",  racute = "r",
125        Sacute = "S",  sacute = "s",
126        Uacute = "U",  uacute = "u",
127        Yacute = "Y",  yacute = "y",
128        Zacute = "Z",  zacute = "z",
129
130        Dstroke = "D",  dstroke = "d",
131        Hstroke = "H",  hstroke = "h",
132        Tstroke = "T",  tstroke = "t",
133
134        Cdotaccent = "C",  cdotaccent = "c",
135        Edotaccent = "E",  edotaccent = "e",
136        Gdotaccent = "G",  gdotaccent = "g",
137        Idotaccent = "I",  idotaccent = "i",
138        Zdotaccent = "Z",  zdotaccent = "z",
139
140        Amacron = "A",  amacron = "a",
141        Emacron = "E",  emacron = "e",
142        Imacron = "I",  imacron = "i",
143        Omacron = "O",  omacron = "o",
144        Umacron = "U",  umacron = "u",
145
146        Ccedilla = "C",  ccedilla = "c",
147        Kcedilla = "K",  kcedilla = "k",
148        Lcedilla = "L",  lcedilla = "l",
149        Ncedilla = "N",  ncedilla = "n",
150        Rcedilla = "R",  rcedilla = "r",
151        Scedilla = "S",  scedilla = "s",
152        Tcedilla = "T",  tcedilla = "t",
153
154        Ohungarumlaut = "O",  ohungarumlaut = "o",
155        Uhungarumlaut = "U",  uhungarumlaut = "u",
156
157        Aogonek = "A",  aogonek = "a",
158        Eogonek = "E",  eogonek = "e",
159        Iogonek = "I",  iogonek = "i",
160        Uogonek = "U",  uogonek = "u",
161
162        Aring = "A",  aring = "a",
163        Uring = "U",  uring = "u",
164
165        Abreve = "A",  abreve = "a",
166        Ebreve = "E",  ebreve = "e",
167        Gbreve = "G",  gbreve = "g",
168        Ibreve = "I",  ibreve = "i",
169        Obreve = "O",  obreve = "o",
170        Ubreve = "U",  ubreve = "u",
171
172        Ccaron = "C",  ccaron = "c",
173        Dcaron = "D",  dcaron = "d",
174        Ecaron = "E",  ecaron = "e",
175        Lcaron = "L",  lcaron = "l",
176        Ncaron = "N",  ncaron = "n",
177        Rcaron = "R",  rcaron = "r",
178        Scaron = "S",  scaron = "s",
179        Tcaron = "T",  tcaron = "t",
180        Zcaron = "Z",  zcaron = "z",
181
182        dotlessI = "I",  dotlessi = "i",
183        dotlessJ = "J",  dotlessj = "j",
184
185        AEligature = "AE",  aeligature = "ae",  AE         = "AE",  ae         = "ae",
186        OEligature = "OE",  oeligature = "oe",  OE         = "OE",  oe         = "oe",
187        IJligature = "IJ",  ijligature = "ij",  IJ         = "IJ",  ij         = "ij",
188
189        Lstroke    = "L",   lstroke    = "l",   Lslash     = "L",   lslash     = "l",
190        Ostroke    = "O",   ostroke    = "o",   Oslash     = "O",   oslash     = "o",
191
192        Ssharp     = "SS",  ssharp     = "ss",
193
194        Aumlaut = "A",  aumlaut = "a",
195        Eumlaut = "E",  eumlaut = "e",
196        Iumlaut = "I",  iumlaut = "i",
197        Oumlaut = "O",  oumlaut = "o",
198        Uumlaut = "U",  uumlaut = "u",
199    }
200}
201