Hagen - Pragma ADE
Hagen - Pragma ADE
Hagen - Pragma ADE
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
5 Features<br />
5.1 Introduction<br />
If you look into fonts, it is hard not to bump into kerns (spacing between characters) and<br />
ligatures (combining multiple shapes into one) and apart from monospaced fonts most<br />
Type1 fonts have them. In the OpenType universe we call these properties features and<br />
in such a font there can be many such features.<br />
For those who grew up with T E X or still remember the times of eight bit fonts, it is<br />
no secret that T E X macro packages did some magic to get most out of a font: replacing<br />
missing glyphs, fixing metrics, using commands to access shapes that had a weird code<br />
point, to mention a few. As there is absolutely no guarantee that an OpenType font does<br />
better, there is a good reason to continue messing around with fonts. After all, it’s what<br />
T E X users seem to like: control.<br />
So, when we started writing support for OpenType quite soon a mechanism has been<br />
created that permits adding our own features to the repertoire that comes with a font.<br />
Because OpenType features demand a configuration and control mechanism, it made<br />
sense to generalize that and provide a single interface.<br />
This means that when we talk about font features, we don’t limit ourselves to those<br />
provided by the font, but also those provided by ConT E Xt. As with font features, they<br />
are enabled per font.<br />
Some of the extra features are sort of generic, others are very font specific and their<br />
properties are somewhat bound to a font. Such features are defined in a font goodie<br />
files. Consider these goodies a font extension mechanism.<br />
Some features need information that only the engine can provide. This is why we have<br />
analyzers. Some are generic, others are bound to scripts. They come in action before<br />
features are applied. Rather special is applying features in combination with paragraph<br />
building. This is something very specific to ConT E Xt but it depends on properties of the<br />
font. It falls into the category ‘optimizing’.<br />
It is clear that when we talk of features many aspects of a font play a role. In this<br />
chapter we will discuss all the mentioned aspects. There is quite a bit of Lua code shown<br />
in this chapter, but don’t worry, users will seldom need to tweak fonts this way. On the<br />
other hand it’s good to see what is possible.<br />
5.2 Regulars<br />
5.2.1 Introduction<br />
The OpenType specification, which can be found on the Microsoft website is no easy<br />
reading. Some of the concepts are easy to understand, like relative positioning (that we<br />
call kerning in T E X) or ligature substitution (as we have ligatures in T E X too). It makes<br />
no sense to discuss the bitwise composition of an OpenType or TrueType file here. First<br />
55<br />
Features