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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• support mechanism are under construction<br />

• we need to support both MkII and MkIV in one interface<br />

• backend support is yet limited<br />

Although in principle a mechanism based on attributes is much faster than using marks<br />

cum suis, the new implementation is slower. <strong>The</strong> main reason is that we need to nalize<br />

the to be shipped out box. However, since this task involved more than just color, we<br />

will gain back some runtime when other mechanisms also use attributes.<br />

complications<br />

This paragraph is somewhat complex, so skip it when you don't feel comfortabel with the<br />

subject <strong>of</strong> when you've never seen low level ConTEXt code.<br />

Attributes behave like fonts. This means that they are kind <strong>of</strong> frozen once material is<br />

boxed. Consider that we dene a box as follows:<br />

\setbox0{default {\red red \green green} default}<br />

What do you expect to come out the next code? In MkII the ‘default’ inside the box will<br />

be colored yellow but the internal red and and green words will kepe their color.<br />

default {\yellow yellow \box0\ yellow} default<br />

When we use fonts switches we don't expect the content <strong>of</strong> the box to change. So, in the<br />

following the ‘default’ texts will not become bold.<br />

\setbox0{default {\sl slanted \bi bold italic} default}<br />

default {\bf bold \box0\ bold} default<br />

Future versions <strong>of</strong> LuaTEX will provide more control over how attributes are applied to<br />

boxes, but for the moment we need to fallback on a solution built in MkIV:<br />

default {\yellow yellow \attributedbox0\ yellow} default<br />

<strong>The</strong>re is also a \attributedcopy macro. <strong>The</strong>se macros signal the attribute resolver (that<br />

kicks in just before shipout) that this box is to be treated special.<br />

In MkII we had a similar situation which is why we had the option (only used deep down<br />

in ConTEXt) to encapsulate a bunch <strong>of</strong> code with<br />

\startregistercolor[foregroundcolor]<br />

some macro code ... here foregroundcolor is applied ... more code<br />

\stopregisteringcode<br />

112 Colors redone

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

Saved successfully!

Ooh no, something went wrong!