mk-nicetoknow.tex /size: 2271 b    last modification: 2023-12-21 09:43
1% language=us
2
3\environment mk-environment
4
5\startcomponent mk-nicetoknow
6
7\chapter{Nice to know}
8
9\section{Tricky ligatures}
10
11Getting the 1.06 release of Latin Modern out in the wild took some discussion and
12testing. Not only were the names (internal names as well as file names) changed in
13such a way that multiple paplications could deal with it, but also some more
14advanced ligature trickery was added.
15
16\startbuffer
17\definefontfeature
18  [ijtest]
19  [mode=node,
20   script=latn,language=nld,strategy=3,
21   liga=yes,kern=yes]
22
23\definefont
24  [ijfont]
25  [name:lmroman10regular*ijtest at 36pt]
26
27\start \ijfont \setstrut fijn ijsje fiets flink effe\stop
28\stopbuffer
29
30\typebuffer
31
32This bit of Dutch shows up as:
33
34\getbuffer
35
36Do you see the trick? There are both an ij and an fi ligature, but we need to prevent
37the ij ligature in fijn. Of course not all fonts have this feature, which indicated
38that you can never depend on it.
39
40\section {Herds}
41
42A while ago, Duane, Taco and I published the Cow Font. It's non||trivial to
43cook up a font made of cows, but of course Mojca Miklavec (who else) wants
44to typeset something Slovenian in this font. Now, the problem is that in
45\MKIV\ we don't have fallback characters, or more precisely, we don't make
46\UTF\ characters active and accent composing commands are mapped onto \UTF.
47
48This means that nothing will show up when we have no characters in the
49defined fonts. For the moment we stick to simple virtual fonts but
50because we can use node lists in virtual fonts, in the near future we will
51cook up a way to create arbitrary fallback characters.
52
53The following example demonstrates how to \quote {complete} a font that misses
54glyphs.
55
56\startbuffer
57\definefontfeature[coward] [kern=yes,ligatures=yes]
58\definefontfeature[cowgirl][kern=yes,ligatures=yes,compose=yes]
59
60\definefontsynonym [cows] [koeieletters.afm*coward]
61\definefontsynonym [herd] [koeieletters.afm*cowgirl]
62
63\blank[3*medium]
64\dontleavehmode\hbox{\definedfont[cows sa 5](č)(š)(ž)}
65\blank[3*medium]
66\dontleavehmode\hbox{\definedfont[herd sa 5](č)(š)(ž)}
67\blank[3*medium]
68\dontleavehmode\hbox{\definedfont[herd sa 5](\v{c})(\v{s})(\v{z})}
69\stopbuffer
70
71\typebuffer
72
73As expected (at least by me) the first line has no compose characters.
74
75\getbuffer
76
77\stopcomponent
78