Hagen - Pragma ADE
Hagen - Pragma ADE Hagen - Pragma ADE
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
- Page 48 and 49: 46 Lookups \font \MyFontG = lmr12 s
- Page 50 and 51: 48 Lookups 3.4 Name Say that we wan
- Page 52 and 53: 50 Lookups We add another specifier
- Page 54 and 55: 52 Methods \definefont [MyFont] [Bo
- Page 56 and 57: 54 Methods } copyright = "ConTeXt d
- Page 58 and 59: 56 Features of all, all we get to s
- Page 60 and 61: 58 Features in base mode. A single
- Page 62 and 63: 60 Features accumulate within a wor
- Page 64 and 65: 62 Features features analyze=yes, c
- Page 66 and 67: 64 Features \definedfont[lmroman10-
- Page 68 and 69: 66 Features single substitutions or
- Page 70 and 71: 68 F -0.492 eatures result ffi feat
- Page 72 and 73: 70 Features font 80: lmroman10-regu
- Page 74 and 75: 72 Features font 46: cambria.ttf @
- Page 76 and 77: 74 Features } } This goodie file is
- Page 78 and 79: 76 Features { name = "msbm10.tfm",
- Page 80 and 81: 78 Features \starttypescript[somefo
- Page 82 and 83: 80 Features \setupbodyfont [mojcasf
- Page 84 and 85: 82 Features } normalweight = "extra
- Page 86 and 87: 84 Features "QF.waqf", "SKTH.waqf",
- Page 88 and 89: 86 Features featureset=smallcaps] O
- Page 90 and 91: 88 Features } }, When defining the
- Page 92 and 93: 90 Features local defaultfraction =
- Page 94 and 95: 92 Features } } ["LMRoman-Bold"] =
- Page 96 and 97: 94 Features In fact, in addition to
- Page 100 and 101: 98 Features step 1 I don't wanna kn
- Page 102 and 103: 100 Features If you’re lucky your
- Page 104 and 105: 102 Scripts
- Page 121 and 122: However, when we go the other way,
- Page 124: 122 Math the regular a--z character
- Page 127 and 128: While there are lots of text fonts,
- Page 129 and 130: 8 Extensions 8.1 Introduction One o
- Page 131: [default] [itlc=5] This is demonstr
- Page 134 and 135: 132 Extensions \definefontfeature [
- Page 136 and 137: 134 Extensions characters to improv
- Page 138 and 139: 136 Extensions U+00079 0.05 y 0.05
- Page 140 and 141: 138 Extensions protrusion classes T
- Page 142 and 143: 140 Extensions [fonts.composing.def
- Page 144 and 145: 142 } Extensions top = { x = -250,
- Page 146 and 147: 144 Extensions
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