Hagen - Pragma ADE

Hagen - Pragma ADE Hagen - Pragma ADE

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

96 Features } This time the application is feature driven. As with all features, setting them up has to happen before fonts are loaded. This will do the trick: \definefontfeature [lm-math] [mathdimensions=signs] The lm-math feature is not defined by default but can be used for such purposes. It is defined with the fontname: \definefontsynonym [LMMathRoman-Regular] [file:latinmodern-math-regular.otf] [features={math\mathsizesuffix,lm-math}, goodies=lm] Most goodies are bound to fonts of collections of fonts. This is different for treatments. These ship with the distribution but you can also provide your own. As this is still somewhat experimental we just mention a few aspects. The entries are filenames that point to tables. return { name = "treatments", version = "1.00", comment = "Goodies that deals with some general issues.", author = "Hans Hagen", copyright = "ConTeXt development team", treatments = { ["adobeheitistd-regular.otf"] = { embedded = false, -- not yet used comment = "this font is part of acrobat", }, ["crap.ttf"] = { ignored = true, comment = "a text file with suffix ttf", }, ["latinmodern-math.otf"] = { comment = "experimental", }, ["rubish-regular.ttf"] = { comment = "check output for missing à and á", } }, } The comment entry in such a table becomes part of the message at the end of a run:

mkiv lua stats > loaded fonts: 2 files: latinmodern-math.otf (experimental), lmroman12-regular.otf The ignored flag signals the font name database builder to ignore the file. This means that the font can still be known as file, but that its (name based) properties are not collected. As you asked explicitly for a file, the file can still be loaded. You can use this trick to avoid issues with the database builder in case of a problematic file, but a real run will still try to load the file. After all, you get what you ask for. If loading and usage is successful you get at least the message reported at the end of the run. 5.5 Analyzers An OpenType font is kind of special in the sense that it provides some information on how to turn sequences of characters into sequences of glyphs. In fact, if all fonts had a reasonable repertoire of glyphs most of the information that concerns combining, remapping and shuffling the input and/or mapping onto glyphs could as well happen in the renderer. This means that fonts have many of their internal features tables in common, or more precisely could share many gsub related issues, if only there had been some predefined sets of substitutional features. So, for most of the time, a feature processor just does what the font demands and the font provides the information. There are however a few cases where font only provide part of the logic. Take for instance the init, medi, fina and isol features that relate to positions in the word: the start, the end, in the middle or isolated. For these features to work the engine has to provide information about the state of a character (glyph) and this is where analysis kicks in. Just watch this: \definefontfeature [default-with-analyze] [default] [script=latn,mode=node, init=yes,medi=yes,fina=yes,isol=yes] \showotfcomposition {dejavu-serif*default-with-analyze at 24pt} {} {I don't wanna know tha\utfchar{"300}t!} In the tracer the different categories are colored. This kind of information is especially important for typesetting Arabic. Normally ConT E Xt can figure out itself when this is needed so you don’t have to worry too much about this kind of additional actions. font 86: DejaVuSerif.ttf @ 24.0pt features analyze=yes, curs=yes, devanagari=yes, extrafeatures=yes, fina=yes, init=yes, isol=yes, kern=yes, liga=yes, mark=yes, medi=yes, mkmk=yes, mode=node, script=latn, tlig=yes, trep=yes 97 Features

mkiv lua stats > loaded fonts: 2 files: latinmodern-math.otf (experimental), lmroman12-regular.otf<br />

The ignored flag signals the font name database builder to ignore the file. This means<br />

that the font can still be known as file, but that its (name based) properties are not<br />

collected. As you asked explicitly for a file, the file can still be loaded. You can use this<br />

trick to avoid issues with the database builder in case of a problematic file, but a real<br />

run will still try to load the file. After all, you get what you ask for. If loading and usage<br />

is successful you get at least the message reported at the end of the run.<br />

5.5 Analyzers<br />

An OpenType font is kind of special in the sense that it provides some information on how<br />

to turn sequences of characters into sequences of glyphs. In fact, if all fonts had a reasonable<br />

repertoire of glyphs most of the information that concerns combining, remapping<br />

and shuffling the input and/or mapping onto glyphs could as well happen in the<br />

renderer. This means that fonts have many of their internal features tables in common,<br />

or more precisely could share many gsub related issues, if only there had been some<br />

predefined sets of substitutional features.<br />

So, for most of the time, a feature processor just does what the font demands and the<br />

font provides the information. There are however a few cases where font only provide<br />

part of the logic. Take for instance the init, medi, fina and isol features that relate to<br />

positions in the word: the start, the end, in the middle or isolated. For these features to<br />

work the engine has to provide information about the state of a character (glyph) and<br />

this is where analysis kicks in. Just watch this:<br />

\definefontfeature<br />

[default-with-analyze]<br />

[default]<br />

[script=latn,mode=node,<br />

init=yes,medi=yes,fina=yes,isol=yes]<br />

\showotfcomposition<br />

{dejavu-serif*default-with-analyze at 24pt}<br />

{}<br />

{I don't wanna know tha\utfchar{"300}t!}<br />

In the tracer the different categories are colored. This kind of information is especially<br />

important for typesetting Arabic. Normally ConT E Xt can figure out itself when this<br />

is needed so you don’t have to worry too much about this kind of additional actions.<br />

font 86: DejaVuSerif.ttf @ 24.0pt<br />

features analyze=yes, curs=yes, devanagari=yes, extrafeatures=yes,<br />

fina=yes, init=yes, isol=yes, kern=yes, liga=yes, mark=yes,<br />

medi=yes, mkmk=yes, mode=node, script=latn, tlig=yes, trep=yes<br />

97<br />

Features

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

Saved successfully!

Ooh no, something went wrong!