| 1 |
%D \module |
| 2 |
%D [ file=luatex-fonts, |
| 3 |
%D version=2009.12.01, |
| 4 |
%D title=\LUATEX\ Support Macros, |
| 5 |
%D subtitle=Generic \OPENTYPE\ Font Handler, |
| 6 |
%D author=Hans Hagen, |
| 7 |
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] |
| 8 |
|
| 9 |
%D \subject{Welcome} |
| 10 |
%D |
| 11 |
%D This file is one of a set of basic functionality enhancements |
| 12 |
%D for \LUATEX\ derived from the \CONTEXT\ \MKIV\ code base. Please |
| 13 |
%D don't polute the \type {luatex-*} namespace with code not coming |
| 14 |
%D from the \CONTEXT\ development team as we may add more files. |
| 15 |
%D |
| 16 |
%D As this is an experimental setup, it might not always work out as |
| 17 |
%D expected. Around \LUATEX\ version 0.50 we expect the code to be |
| 18 |
%D more or less okay. |
| 19 |
%D |
| 20 |
%D This file implements a basic font system for a bare \LUATEX\ |
| 21 |
%D system. By default \LUATEX\ only knows about the classic \TFM\ |
| 22 |
%D fonts but it can read other font formats and pass them to \LUA. |
| 23 |
%D With some glue code one can then construct a suitable \TFM\ |
| 24 |
%D representation that \LUATEX\ can work with. For more advanced font |
| 25 |
%D support a bit more code is needed that needs to be hooked |
| 26 |
%D into the callback mechanism. |
| 27 |
%D |
| 28 |
%D This file is currently rather simple: it just loads the \LUA\ file |
| 29 |
%D with the same name. An example of a \type {luatex.tex} file that is |
| 30 |
%D just plain \TEX: |
| 31 |
%D |
| 32 |
%D \starttyping |
| 33 |
%D \catcode`\{=1 % left brace is begin-group character |
| 34 |
%D \catcode`\}=2 % right brace is end-group character |
| 35 |
%D |
| 36 |
%D \input plain |
| 37 |
%D |
| 38 |
%D \everyjob\expandafter{\the\everyjob\input luatex-fonts\relax} |
| 39 |
%D |
| 40 |
%D \dump |
| 41 |
%D \stoptyping |
| 42 |
%D |
| 43 |
%D We could load the \LUA\ file in \type {\everyjob} but maybe some |
| 44 |
%D day we need more here. |
| 45 |
%D |
| 46 |
%D When defining a font you can use two prefixes. A \type {file:} |
| 47 |
%D prefix forced a file search, while a \type {name:} prefix will |
| 48 |
%D result in consulting the names database. Such a database can be |
| 49 |
%D generated with: |
| 50 |
%D |
| 51 |
%D \starttyping |
| 52 |
%D mtxrun --usekpse --script fonts --names |
| 53 |
%D \stoptyping |
| 54 |
%D |
| 55 |
%D This will generate a file \type {luatex-fonts-names.lua} that has |
| 56 |
%D to be placed in a location where it can be found by \KPSE. Beware: |
| 57 |
%D the \type {--kpseonly} flag is only used outside \CONTEXT\ and |
| 58 |
%D provides very limited functionality, just enough for this task. |
| 59 |
%D |
| 60 |
%D The code loaded here does not come out of thin air, but is mostly |
| 61 |
%D shared with \CONTEXT, however, in that macropackage we go beyond |
| 62 |
%D what is provided here. When you use the code packaged here you |
| 63 |
%D need to keep a few things in mind: |
| 64 |
%D |
| 65 |
%D \startitemize |
| 66 |
%D |
| 67 |
%D \item This subsystem will be extended, improved etc. in about the |
| 68 |
%D same pace as \CONTEXT\ \MKIV. However, because \CONTEXT\ provides a |
| 69 |
%D rather high level of integration not all features will be supported |
| 70 |
%D in the same quality. Use \CONTEXT\ if you want more goodies. |
| 71 |
%D |
| 72 |
%D \item There is no official \API\ yet, which means that using |
| 73 |
%D functions implemented here is at your own risk, in the sense that |
| 74 |
%D names and namespaces might change. There will be a minimal \API\ |
| 75 |
%D defined once \LUATEX\ version 1.0 is out. Instead of patching the |
| 76 |
%D files it's better to overload functions if needed. |
| 77 |
%D |
| 78 |
%D \item The modules are not stripped too much, which makes it |
| 79 |
%D possible to benefit from improvements in the code that take place |
| 80 |
%D in the perspective of \CONTEXT\ development. They might be split a |
| 81 |
%D bit more in due time so the baseline might become smaller. |
| 82 |
%D |
| 83 |
%D \item The code is maintained and tested by the \CONTEXT\ |
| 84 |
%D development team. As such it might be better suited for this macro |
| 85 |
%D package and integration in other systems might demand some |
| 86 |
%D additional wrapping. Problems can be reported to the team but as we |
| 87 |
%D use \CONTEXT\ \MKIV\ as baseline, you'd better check if the problem |
| 88 |
%D is a general \CONTEXT\ problem too. |
| 89 |
%D |
| 90 |
%D \item The more high level support for features that is provided in |
| 91 |
%D \CONTEXT\ is not part of the code loaded here as it makes no sense |
| 92 |
%D elsewhere. Some experimental features are not part of this code |
| 93 |
%D either but some might show up later. |
| 94 |
%D |
| 95 |
%D \item Math font support will be added but only in its basic form |
| 96 |
%D once that the Latin Modern and \TEX\ Gyre math fonts are |
| 97 |
%D available. |
| 98 |
%D |
| 99 |
%D \item At this moment the more nifty speed-ups are not enabled |
| 100 |
%D because they work in tandem with the alternative file handling |
| 101 |
%D that \CONTEXT\ uses. Maybe around \LUATEX\ 1.0 we will bring some |
| 102 |
%D speedup into this code too (if it pays off at all). |
| 103 |
%D |
| 104 |
%D \item The code defines a few global tables. If this code is used |
| 105 |
%D in a larger perspective then you can best make sure that no |
| 106 |
%D conflicts occur. The \CONTEXT\ package expects users to work in |
| 107 |
%D their own namespace (\type {userdata}, \type {thirddata}, \type |
| 108 |
%D {moduledata} or \type {document}. The team takes all freedom to |
| 109 |
%D use any table at the global level but will not use tables that are |
| 110 |
%D named after macro packages. Later the \CONTEXT\ might operate in |
| 111 |
%D a more controlled namespace but it has a low priority. |
| 112 |
%D |
| 113 |
%D \item There is some tracing code present but this is not enabled |
| 114 |
%D and not supported outside \CONTEXT\ either as it integrates quite |
| 115 |
%D tightly into \CONTEXT. In case of problems you can use \CONTEXT\ |
| 116 |
%D for tracking down problems. |
| 117 |
%D |
| 118 |
%D \item Patching the code in distributions is dangerous as it might |
| 119 |
%D fix your problem but introduce new ones for \CONTEXT. So, best keep |
| 120 |
%D the original code as it is. |
| 121 |
%D |
| 122 |
%D \item Attributes are (automatically) taken from the range 127-255 so |
| 123 |
%D you'd best not use these yourself. |
| 124 |
%D |
| 125 |
%D \stopitemize |
| 126 |
%D |
| 127 |
%D If this all sounds a bit tricky, keep in mind that it makes no sense |
| 128 |
%D for us to maintain multiple code bases and we happen to use \CONTEXT. |
| 129 |
%D |
| 130 |
%D For more details about how the font subsystem works we refer to |
| 131 |
%D publications in \TEX\ related journals, the \CONTEXT\ documentation, |
| 132 |
%D and the \CONTEXT\ wiki. |
| 133 |
|
| 134 |
\directlua { |
| 135 |
if not fonts then |
| 136 |
dofile(kpse.find_file("luatex-fonts.lua","tex")) |
| 137 |
end |
| 138 |
} |
| 139 |
|
| 140 |
\endinput |