29.05.2014 Views

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

\definefontsynonym<br />

[SerifPlus]<br />

[Serif]<br />

[fallbacks=SerifFallback]<br />

This command associates a fallback with a font. <strong>The</strong>re is always a parent font and that is<br />

the font that triggers the checking <strong>of</strong> the node list.<br />

\definefont [MySerif] [SerifPlus at 10pt]<br />

Here we denes a font called \MySerif that refers to a symbolic name SerifPlus<br />

which in turn refers to the current Serif font (these symbolic names are resolved in typescripts,<br />

one <strong>of</strong> the building blocks <strong>of</strong> ConTEXts font system). <strong>The</strong> mentioned fallbacks will<br />

be initialized when the font is dened. This examples demonstrates that there is a clean<br />

separation between font denitions and fallbacks. This makes it possible to share fallback<br />

denitions.<br />

So, let's summarize what happens:<br />

• a font is dened in the normal way but has falbacks<br />

• the associated fallback fonts are dened too<br />

• the main font gets a table with fallback id's<br />

• the main font is used in the document stream<br />

• the node list is intercepted and parsed for this font<br />

• references to fallback fonts take care <strong>of</strong> missing glyphs<br />

We end with an example.<br />

\definefontfallback [Demo] [Mono] [0x30-0x39] [force=yes]<br />

\definefontsynonym [DemoSerif] [Serif] [fallbacks=Demo]<br />

\definefont [MyDemoSerif] [DemoSerif at 20pt]<br />

\MyDemoSerif Here the digits, like 13579, are replaced.<br />

Here the digits, like 13579, are replaced.<br />

Beware: the fallback denitions are global, but this is hardly a problem because normal<br />

such trickery is taking place at the document level.<br />

Virtual Reality 235

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

Saved successfully!

Ooh no, something went wrong!