Hagen - Pragma ADE

Hagen - Pragma ADE Hagen - Pragma ADE

context.aanhet.net
from context.aanhet.net More from this publisher
13.07.2013 Views

16 Font formats /fonts/tfm/vendor/typeface /fonts/vf/vendor/typeface /fonts/type1/vendor/typeface /fonts/truetype/vendor/typeface /fonts/opentype/vendor/typeface /fonts/fea /fonts/cid /fonts/dvips/enc /fonts/dvips/map There can be multiple roots and the right locations are specified in a configuration file. Currently all engines can use the dvips encoding and map files, so luckily we don’t need to duplicate this. For some reason TrueType and OpenType fonts have different locations and you need to be aware of the fact that some fonts come in both formats (just to confuse users) so you might end up with conflicts. In ConT E Xt we try to make live somewhat easier by also supporting a simple path structure: /fonts/data/vendor/typeface This way files are kept together and installing commercial fonts is less complex and error prone. Also, in practice we only have one set of files now: one of the other OpenType formats. If you want to see the difference between a traditional (pdfT E X or X Ǝ T E X plus ConT E Xt MkII) setup or a modern one (LuaT E X with ConT E Xt MkIV) you can install the ConT E Xt suite (formerly known as minimals). If you explicitly choose for a LuaT E X only setup, you will notice that far less files get installed. 1.9 Text Todo. 1.10 Math Todo. 1.11 Caching lua / luc tma / tmc

2 Modes 2.1 Introduction We use the term modes for classifying the several ways characters are turned into glyphs. When a font is defined, a set of features can be associated and one of them is the mode. none Characters are just mapped onto glyphs and no substitution or positioning takes place. base The routines built into the engine are used. For many Latin fonts this is a rather useable and efficient method. node Here alternative routines written in Lua are used. This mode is needed for more complex scripts as well as more advanced features that demand some analysis. auto This mode will determine the most suitable mode for the given feature set. When we talk about features, we refer to more than only features provided by fonts as ConT E Xt adds some of its own. In the following section each of these modes is discussed. Before we do so a short introduction to font tables that we use is given. 2.2 The font table The internal representation of a font in ConT E Xt is such that we can conveniently access data that is needed in the mentioned modes. When a font is used for the first time, or when it has changed, it is read in its most raw form. After some cleanup and normalization the font gets cached when it is a Type1 or OpenType font. This is done in a rather efficient way. A next time the cached copy is used. The normalized table is shared among instances of a font. This means that when a font is used at a different scale, or when a different feature set is used, the font gets loaded only once and its data is shared when possible. In figure 2.1 we have visualized the process. Say that you ask for font whatever at 12pt using featureset smallcaps. In low level code this boils down to: \font\MySmallCaps=whatever*smallcaps at 12pt In ConT E Xt we have overloaded the font loader so Lua code takes care of the loading. Basically there is a function hooked into LuaT E X’s font definer (the \font primitive) that returns a table and from that on LuaT E X will create its internal representation that is identified by a number, the so called font id. So, in fact the \Whatever command is a reference to a font id, a positive number. When this font is already loaded, ConT E Xt will reuse the id and pas that one. 17 Modes

2 Modes<br />

2.1 Introduction<br />

We use the term modes for classifying the several ways characters are turned into<br />

glyphs. When a font is defined, a set of features can be associated and one of them<br />

is the mode.<br />

none Characters are just mapped onto glyphs and no substitution or positioning takes<br />

place.<br />

base The routines built into the engine are used. For many Latin fonts this is a rather<br />

useable and efficient method.<br />

node Here alternative routines written in Lua are used. This mode is needed for more<br />

complex scripts as well as more advanced features that demand some analysis.<br />

auto This mode will determine the most suitable mode for the given feature set.<br />

When we talk about features, we refer to more than only features provided by fonts as<br />

ConT E Xt adds some of its own. In the following section each of these modes is discussed.<br />

Before we do so a short introduction to font tables that we use is given.<br />

2.2 The font table<br />

The internal representation of a font in ConT E Xt is such that we can conveniently access<br />

data that is needed in the mentioned modes. When a font is used for the first time, or<br />

when it has changed, it is read in its most raw form. After some cleanup and normalization<br />

the font gets cached when it is a Type1 or OpenType font. This is done in a rather<br />

efficient way. A next time the cached copy is used.<br />

The normalized table is shared among instances of a font. This means that when a<br />

font is used at a different scale, or when a different feature set is used, the font gets<br />

loaded only once and its data is shared when possible. In figure 2.1 we have visualized<br />

the process. Say that you ask for font whatever at 12pt using featureset smallcaps. In<br />

low level code this boils down to:<br />

\font\MySmallCaps=whatever*smallcaps at 12pt<br />

In ConT E Xt we have overloaded the font loader so Lua code takes care of the loading.<br />

Basically there is a function hooked into LuaT E X’s font definer (the \font primitive) that<br />

returns a table and from that on LuaT E X will create its internal representation that is<br />

identified by a number, the so called font id. So, in fact the \Whatever command is a<br />

reference to a font id, a positive number. When this font is already loaded, ConT E Xt will<br />

reuse the id and pas that one.<br />

17<br />

Modes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!