diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/optex/base/fonts-select.opm')
-rw-r--r-- | Master/texmf-dist/tex/luatex/optex/base/fonts-select.opm | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/luatex/optex/base/fonts-select.opm b/Master/texmf-dist/tex/luatex/optex/base/fonts-select.opm index 83ded2f35b8..8e7ab81fcf4 100644 --- a/Master/texmf-dist/tex/luatex/optex/base/fonts-select.opm +++ b/Master/texmf-dist/tex/luatex/optex/base/fonts-select.opm @@ -3,25 +3,26 @@ \_codedecl \fontfam {Fonts selection system <2020-03-18>} % preloaded in format \_doc ----------------------------- - The \`\initunifonts` initializes extended `\font` primitive - (to be able to load Unicode fonts). Unfortunately, this part of - \OpTeX/ depends on \LaTeX/ lua codes `ltluatex.lua` and - `luaotfload-main.lua`. And this code need to be declared a - control sequence `\e@alloc@attribute@count` by `\countdef` primitive. - Moreover, the `\initunifont` switches with + \`\initunifonts` macro extends \LuaTeX's font capabalities, + in order to be able to load Unicode fonts. Unfortunately, this part of + \OpTeX/ depends on `luaotfload` package, which adapts Con\TeX/t's generic + font loader for plain \TeX/ and \LaTeX. `luaotfload` uses Lua functions + from \LaTeX's `luatexbase` namespace, we provide our own replacements. + Moreover, `\initunifont` switches with the \^`\_doresizefont` macro to OTF mode which is represented by the macro \`\_doresizeunifont`. This mode includes a fallback to TFM mode if \^`\_fontnamegen` is not defined. - Finally, the `\initunifnt` sets itself to relax because we need not to do + Finally, `\initunifonts` sets itself to relax because we don't want to do this work twice. \_cod ----------------------------- \_def\_initunifonts {% - \_ea\_newcount \_csname e@alloc@attribute@count\_endcsname - \_global \_csname e@alloc@attribute@count\_endcsname=-1 - \_directlua{% - require("ltluatex") - require('luaotfload-main') local _void = luaotfload.main () + \directlua{% + require('luaotfload-main') + print_bak = print + print = function () end + luaotfload.main() + print = print_bak % "print hack" until luaotfload will be corrected }% \_gdef\_rfskipatX ##1" ##2\_relax{"##1"}% \_global\_let \_doresizefont=\_doresizeunifont @@ -663,6 +664,34 @@ with Unicode fonts loaded by \^`\fontfam`. \printdoctail fams-ini.opm +\secc[exfont] Notices about extension of `\font` primitive +%--------------------------------------------------------- + +Unicode fonts are dealed by extended `\font` primitive. This extension is +not activated in \OpTeX/ by default, \^`\initunifonts` macro activates it. +You need not to use \^`\initunifonts` explicitly if \^`\fontfam` macro is +used because \^`\fontfam` runs it internally. + +The \^`\initunifonts` loads the lua code from Luaotfload package which +actually implements the `\font` primitive extension. See its +documentation `luaotfload-latex.pdf` for information about +all possibilities of extended `\font` primitive. + +The \OpTeX/ format is initialized by `luatex` engine by default but +you can initialize it by `luahbtex` engine too. Then the harfbuzz library is +ready to use for font rendering as an alternative of build-in font renderer +from Luaotfload. The harfbuzz library gives more features for rendering +indic and arabic scripts. But it is not used as default, you need to specify +`mode=harf` in fontfeatures field when `\font` is used. Moreover, when +`mode=harf` is used, then you must specify `script` too. For example + +\begtt +\font\devafont=[NotoSansDevanagari-Regular]:mode=harf;script=dev2 +\endtt +% +If `luahbtex` engine is not used then `mode=harf` is ignored. See +Luaotfload documentation for more information. + \endinput 2020-04-18 \_tryloadfamslocal introduced |