diff --git a/optex/base/f-lmfonts.opm b/optex/base/f-lmfonts.opm index 5356680e..721bcd33 100644 --- a/optex/base/f-lmfonts.opm +++ b/optex/base/f-lmfonts.opm @@ -3,8 +3,8 @@ \_famdecl [Latin Modern] \LMfonts {TeX Gyre fonts based on Coputer Modern} {\roman \sans \quotset \ttset \ttprop \ttlight \ttcond \upital \dunhill submods:\caps \slant \nbold \bolder} {\rm \bf \it \bi \tt} {LM} - {[lmroman10-regular]} - {\_def\_fontnamegen {[\_optname{lm\_subfamV.\_currV}]:\_fontfeatures}} + {lmroman10-regular} + {\_def\_fontnamegen {\_optname{lm\_subfamV.\_currV}:\_fontfeatures}} \_wlog{\_detokenize{% Modifiers (selects subfamily):^^J @@ -106,12 +106,12 @@ Note: Text fonts support optical sizes, but LatinModern-Math only for scripts.^^ \_onlyif subfam=tt: {\_fvars r b isl bisl }} \_moddef \caps {\_onlyif subfam=rm,tt: {\_fvars rc . ic . }} -\_def \_tryloadtt {\_fontdef\_tentt{\_LMfonts \_addto\_fontfeatures{-tlig;}\_ttset \_rm}} +\_def \_tryloadtt {\_fontdef\_tentt{\_LMfonts \_addto\_fontfeatures{tlig=no;}\_ttset \_rm}} \_private \LMfonts \ttset ; % used in \_tryloadtt \_initfontfamily % new font family must be initialized -\_loadmath {[latinmodern-math]} +\_loadmath {latinmodern-math} \_endcode diff --git a/optex/base/f-technika.opm b/optex/base/f-technika.opm index b29b29ed..824d5316 100644 --- a/optex/base/f-technika.opm +++ b/optex/base/f-technika.opm @@ -2,8 +2,8 @@ \_famdecl [Technika] \Technika {Fonts from visual style of CTU in Prague} {\caps \light \book} {\rm \bf \it \bi \stencil} {} - {[Technika-Regular]} - {\_def\_fontnamegen {[Technika\_stencilV-\_currV]:\_capsV\_fontfeatures}} + {Technika-Regular} + {\_def\_fontnamegen {Technika\_stencilV-\_currV:\_capsV\_fontfeatures}} \_wlog{\_detokenize{% Modifiers:^^J diff --git a/optex/base/fonts-select.opm b/optex/base/fonts-select.opm index 355a71a1..26c2a827 100644 --- a/optex/base/fonts-select.opm +++ b/optex/base/fonts-select.opm @@ -30,14 +30,15 @@ The \`\_tryloadtt` is implemented differently because we want to keep family independence for `\tt` macro, see section~\ref[tt]. So, `\_tryloadtt` is defined constantly as \"loading `\tt` font" and it is - not re-defined to `\relax`. On the other hand, `\_tryloadtt` is - re-defined in the \^`\initunifonts` macro or when - \~`\famvardef``\tt` is used. + not re-defined to `\relax`. \`\_ttunifont` is default font for `\tt` + variant. User can re-define it or use \^`\famvardef``\tt`. \_cod ----------------------------- \_def\_reloading{\_loadf{rm}\_tenrm \_loadf{bf}\_tenbf \_loadf{it}\_tenit \_loadf{bi}\_tenbi} \_def\_loadf#1#2{\_sdef{_tryload#1}{\_ifmmode \_else \_resizefont{#1}#2\_fi}} -\_def\_tryloadtt{\_resizefont{tt}\_tentt} % only in TFM mode +\_def\_tryloadtt {\_begingroup \_let\_fontnamegen\_ttunifont % \tt uses \_ttunifont + \_resizefont{tt}\_tentt\_relax \_ea\_endgroup \_ea\_let \_ea\_tentt \_the\_tentt}% +\_def\_ttunifont{lmmono10-regular:\_fontfeatures-tlig;} \_let\_tryloadrm=\_relax \_let\_tryloadbf=\_relax @@ -66,17 +67,19 @@ The is `rm` or `bf` or `it` or `bi` or `tt`. The new is declared (roughly speaking) by: \begtt \catcode`<=13 - \_font = \_ten \_sizespec % in TFM mode - \_font = {\_fontnamegen} \_sizespec % in OTF mode + \_font = \_ten \_sizespec + % or if "\_fontnamegen" is defined: + \_font = {\_fontnamegen} \_sizespec \endtt - The font is loaded by \`\_doresizefont```. This macro has - meaning \`\_doresizetfmfont` in TFM mode (default in format) and it - switches to \^`\_doresizeunifont` when \^`\initunifonts` is used.\nl + I.e. there is a fallback to TFM mode if \^`\_fontnamegen` is not defined. + The font is loaded by \`\_doresizefont```.\nl The `` is generated by the `\fontname` \TeX/ primitive where \`\_rfontskipat` removes the `at` part of the `\fontname` output.\nl The \`\_whatresize` is defined as ``.\nl The \^`\_fontloaded``` is a macro which can be used for post-processing when a font is loaded. + The \^`\_fontnamegen` expands to the font name/file:font-features + depending on the current font context. \_cod ----------------------------- \_def\_resizefont#1#2{% @@ -84,30 +87,17 @@ \_lastmagsize=\_zo \_if t\_ignoresecond#1\_else \_slet{_tryload#1}{_relax}\_fi } -\_def\_doresizetfmfont#1{\_logfont{#1}% - \_ea\_font\_ea#1\_ea\_rfontskipat - \_fontname \_cs{_ten\_whatresize} \_relax\_space \_sizespec \_relax -} -\_let\_doresizefont=\_doresizetfmfont -\_def\_logfont#1{} % default is no logging of used fonts - -\_def\_rfontskipat#1{\_ifx#1"\_ea\_rfskipatX \_else\_ea\_rfskipatN\_ea#1\_fi} -\_def\_rfskipatX #1" #2\_relax{"\_whichtfm{#1}"} -\_def\_rfskipatN #1 #2\_relax{\_whichtfm{#1}} - - \_doc ----------------------------- - \`\_doresizeunifont``` implements the OTF mode of - loading fonts \^`\_doresizefont`. - There is a fallback to TFM mode if \^`\_fontnamegen` is not defined.\nl - The \^`\_fontnamegen` expands to the font name/file:font-features - depending on the current font context. - \_cod ----------------------------- - -\_def\_doresizeunifont #1{\_logfont{#1}% - \_ifx\_fontnamegen\_undefined \_doresizetfmfont#1\_else +\_def\_doresizefont #1{\_logfont{#1}% + \_ifx\_fontnamegen\_undefined + \_ea\_font\_ea#1\_ea\_rfontskipat + \_fontname \_cs{_ten\_whatresize} \_relax\_space \_sizespec \_relax + \_else \_font#1={\_fontnamegen} \_sizespec \_relax \_setwsp#1\_relax \_fi } +\_def\_logfont#1{} % default is no logging of used fonts + +\_def\_rfontskipat #1 #2\_relax{\_whichtfm{#1}} \_doc ----------------------------- If a font is loaded by \^`\_resizefont` or \^`\resizethefont` then the @@ -128,34 +118,11 @@ \_def\_newfontloaded #1{} \_doc ----------------------------- - \`\initunifonts` macro extends \LuaTeX's font capabalities, - in order to be able to load Unicode fonts. Unfortunately, this part of - \OpTeX/ depends on the `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`. - Finally, \^`\initunifonts` sets itself to relax because we don't want to do - this work twice.\nl - \`\_ttunifont` is default font for `\tt` variant. - User can re-define it or use \^`\famvardef``\tt`. + For backwards compatibility we define `\initunifonts` as `\relax` (it is + done automatically now). \_cod ----------------------------- -\_def\_initunifonts {% - \_directlua{% - require('luaotfload-main') - luaotfload.main() - optex_hook_into_luaotfload() - }% - \_gdef\_rfskipatX ##1" ##2\_relax{"##1"}% - \_global\_let \_doresizefont=\_doresizeunifont - \_gdef\_tryloadtt {\_begingroup \_let\_fontnamegen\_ttunifont % \tt uses \_ttunifont - \_resizefont{tt}\_tentt\_relax \_ea\_endgroup \_ea\_let \_ea\_tentt \_the\_tentt}% - \_global\_let \_initunifonts=\_relax % we need not to do this work twice - \_global\_let \initunifonts=\_relax -} -\_def\_ttunifont{[lmmono10-regular]:\_fontfeatures-tlig;} +\_let\_initunifonts \_relax \_public \initunifonts ; @@ -503,7 +470,7 @@ special font features provided by \LuaTeX/ (and by \XeTeX/ too but it is not our business). The \`\setwordspace` recalculates the `\fontdimen2,3,4` of the font using the \`\setwsp` macro which is used by the - \^`\_doresizeunifont` macro. It activates a dummy font feature `+Ws` too in + \^`\_doresizefont` macro. It activates a dummy font feature `+Ws` too in order the font is reloded by the `\font` primitive (with independent `\fontdimen` registers). \_cod ----------------------------- @@ -981,34 +948,6 @@ with Unicode fonts loaded by \^`\fontfam`. \printdoctail fams-ini.opm -\secc[exfont] Notices about extension of `\font` primitive -%--------------------------------------------------------- - -Unicode fonts are loaded by extended `\font` primitive. This extension is -not activated in \OpTeX/ by default, \^`\initunifonts` macro activates it. -You need not use \^`\initunifonts` explicitly if \^`\fontfam` macro is -used because \^`\fontfam` runs it internally. - -The \^`\initunifonts` loads the Lua code from the Luaotfload package which -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 to built-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 the 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 the `luahbtex` engine is not used then `mode=harf` is ignored. See -Luaotfload documentation for more information. - \endinput 2021-07-16 \initunifonts: optex_hook_into_luaotfload added. diff --git a/optex/base/math-unicode.opm b/optex/base/math-unicode.opm index eaa0e72f..cd84c9b1 100644 --- a/optex/base/math-unicode.opm +++ b/optex/base/math-unicode.opm @@ -71,23 +71,23 @@ \_cod ----------------------------- \_def\_normalunimath{% - \_loadumathfamily 1 {\_unimathfont}{} % Base font + \_loadumathfamily 0 {\_unimathfont}{} % Base font \_loadmathfamily 4 rsfs % script \_setunimathdimens }% \_def\_boldunimath{% \_ifx\_unimathboldfont \_undefined - \_loadumathfamily 1 {\_unimathfont}{embolden=1.7;} % Base faked bold + \_loadumathfamily 0 {\_unimathfont}{embolden=1.7;} % Base faked bold \_else - \_loadumathfamily 1 {\_unimathboldfont}{} % Base real bold font + \_loadumathfamily 0 {\_unimathboldfont}{} % Base real bold font \_fi \_loadmathfamily 4 rsfs % script \_setunimathdimens }% \_def\_setunimathdimens{% PlainTeX sets these dimens for 10pt size only: - \_delimitershortfall=0.5\_fontdimen6\_textfont1 - \_nulldelimiterspace=0.12\_fontdimen6\_textfont1 - \_setbox0=\_hbox{\_everymath{}$\_fam1\_displaystyle{0\_atop0}$}% + \_delimitershortfall=0.5\_fontdimen6\_textfont0 + \_nulldelimiterspace=0.12\_fontdimen6\_textfont0 + \_setbox0=\_hbox{\_everymath{}$\_displaystyle{0\_atop0}$}% \_Umathfractiondelsize\_displaystyle = \_dimexpr(\_ht0-\_Umathaxis\_displaystyle)*2\_relax \_setbox0=\_box\_voidbox } @@ -101,7 +101,7 @@ \begtt \loadmath{[xitsmath-regular]} \def\_boldmath{% - \_loadumathfamily 1 {[xitsmath-bold]}{} % Base font + \_loadumathfamily 0 {[xitsmath-bold]}{} % Base font \_loadmathfamily 4 rsfs % script \_loadumathfamily 5 {[xitsmath-regular]}{} \_def\|{\_Udelimiter 0 5 "02016 }% % norm delimiter from family 5 diff --git a/optex/base/optex.ini b/optex/base/optex.ini index a949afb6..cf114962 100644 --- a/optex/base/optex.ini +++ b/optex/base/optex.ini @@ -91,6 +91,7 @@ \_directlua{ % preload OpTeX's Lua code into format as bytecode lua.bytecode[1] = assert(loadfile(kpse.find_file("optex", "lua"))) + lua.bytecode[2] = assert(loadfile(kpse.find_file("luatex-fonts-merged", "lua"))) } \_everyjob = {% diff --git a/optex/base/optex.lua b/optex/base/optex.lua index 5114ea21..0bc41d25 100644 --- a/optex/base/optex.lua +++ b/optex/base/optex.lua @@ -222,7 +222,7 @@ function callback.add_to_callback(name, fn, description) return call_callback(name, ...) end) else - err("cannot add to callback '"..name.."' - no such callback exists") + err("cannot add to callback '"..name.."' - it doesn't exist or is disabled") end -- add function to callback list for this callback @@ -264,6 +264,13 @@ function callback.remove_from_callback(name, description) return fn, description end -- +-- Disable a callback completely. +function callback.disable_callback(name) + callback_register(name, false) + -- don't allow adding functions from now on + callback_types[name] = nil +end +-- -- helper iterator generator for iterating over reverselist callback functions local function reverse_ipairs(t) local i, n = #t + 1, 1 @@ -396,6 +403,7 @@ luatexbase = { create_callback = callback.create_callback, add_to_callback = callback.add_to_callback, remove_from_callback = callback.remove_from_callback, + disable_callback = callback.disable_callback, call_callback = callback.call_callback, callbacktypes = {} } @@ -573,31 +581,54 @@ callback.add_to_callback("pre_shipout_filter", function(list) return tonode(list) end, "_colors") -- --- We also hook into `luaotfload`'s handling of color. Instead of the default --- behavior (inserting colorstack whatsits) we set our own attribute. The hook --- has to be registered {\em after} `luaotfload` is loaded. -function optex_hook_into_luaotfload() - if not luaotfload.set_colorhandler then - return -- old luaotfload, colored fonts will be broken - end - local setattribute = direct.set_attribute - local token_setmacro = token.set_macro - local color_count = registernumber("_colorcnt") - local tex_getcount, tex_setcount = tex.getcount, tex.setcount - luaotfload.set_colorhandler(function(head, n, rgbcolor) -- rgbcolor = "1 0 0 rg" - local attr = tonumber(token_getmacro("_color::"..rgbcolor)) - if not attr then - attr = tex_getcount(color_count) - tex_setcount(color_count, attr + 1) - local strattr = tostring(attr) - token_setmacro("_color::"..rgbcolor, strattr) - token_setmacro("_color:"..strattr, rgbcolor) - -- no stroke color set - end - setattribute(n, color_attribute, attr) - return head, n - end) +-- Load ConTeXt font loading code with some preparations +logs = logs or {} +function texio.reporter(...) + if trace_context then + texio.write_nl(...) + end end +-- +-- Attribute 0 must be 0 for ConTeXt +tex.setattribute(0, 0) +-- +local attrs = {} +attributes = attributes or {} +function attributes.private(name) + local num = attrs[name] + if not num then + num = alloc.new_attribute(name) + attrs[name] = num + end + return num +end +-- +local saved = callback.register +function callback.register(cb, fn) + if fn == false then + callback.disable_callback(cb) + else + callback.add_to_callback(cb, fn, "context") + end +end +-- +utf = unicode.utf8 +-- +-- load the bulk of the ConTeXt code +lua.bytecode[2]() +-- +-- Register callbacks +callback.disable_callback("ligaturing") +callback.disable_callback("kerning") +callback.add_to_callback("pre_linebreak_filter", nodes.simple_font_handler, "context") +callback.add_to_callback("hpack_filter", nodes.simple_font_handler, "context") +callback.add_to_callback("define_font", fonts.definers.read, "context") +-- +callback.register = saved + +-- "\font=name" is a font name lookup with fallback to file name, we don't +-- support font name, yet +fonts.names.resolve = function() end -- History: -- 2021-07-16 support for colors via attributes added diff --git a/optex/base/unimath-codes.opm b/optex/base/unimath-codes.opm index d7f0d387..22557177 100644 --- a/optex/base/unimath-codes.opm +++ b/optex/base/unimath-codes.opm @@ -40,20 +40,20 @@ \_chardef\_ncharsxA="1D63C \_chardef\_ncharsxa="1D656 \_chardef\_ncharttA="1D670 \_chardef\_nchartta="1D68A -\_protected\_def\_rmvariables {\_umathrange{A-Z}71\_ncharrmA \_umathrange{a-z}71\_ncharrma} -\_protected\_def\_bfvariables {\_umathrange{A-Z}71\_ncharbfA \_umathrange{a-z}71\_ncharbfa} -\_protected\_def\_itvariables {\_umathrange{A-Z}71\_ncharitA \_umathrange{a-z}71\_ncharita} -\_protected\_def\_bivariables {\_umathrange{A-Z}71\_ncharbiA \_umathrange{a-z}71\_ncharbia} -\_protected\_def\_calvariables {\_umathrange{A-Z}71\_ncharclA \_umathrange{a-z}71\_ncharcla} -\_protected\_def\_bcalvariables {\_umathrange{A-Z}71\_ncharbcA \_umathrange{a-z}71\_ncharbca} -\_protected\_def\_frakvariables {\_umathrange{A-Z}71\_ncharfrA \_umathrange{a-z}71\_ncharfra} -\_protected\_def\_bfrakvariables {\_umathrange{A-Z}71\_ncharbrA \_umathrange{a-z}71\_ncharbra} -\_protected\_def\_bbvariables {\_umathrange{A-Z}71\_ncharbbA \_umathrange{a-z}71\_ncharbba} -\_protected\_def\_sansvariables {\_umathrange{A-Z}71\_ncharsnA \_umathrange{a-z}71\_ncharsna} -\_protected\_def\_bsansvariables {\_umathrange{A-Z}71\_ncharbsA \_umathrange{a-z}71\_ncharbsa} -\_protected\_def\_isansvariables {\_umathrange{A-Z}71\_ncharsiA \_umathrange{a-z}71\_ncharsia} -\_protected\_def\_bisansvariables {\_umathrange{A-Z}71\_ncharsxA \_umathrange{a-z}71\_ncharsxa} -\_protected\_def\_ttvariables {\_umathrange{A-Z}71\_ncharttA \_umathrange{a-z}71\_nchartta} +\_protected\_def\_rmvariables {\_umathrange{A-Z}70\_ncharrmA \_umathrange{a-z}70\_ncharrma} +\_protected\_def\_bfvariables {\_umathrange{A-Z}70\_ncharbfA \_umathrange{a-z}70\_ncharbfa} +\_protected\_def\_itvariables {\_umathrange{A-Z}70\_ncharitA \_umathrange{a-z}70\_ncharita} +\_protected\_def\_bivariables {\_umathrange{A-Z}70\_ncharbiA \_umathrange{a-z}70\_ncharbia} +\_protected\_def\_calvariables {\_umathrange{A-Z}70\_ncharclA \_umathrange{a-z}70\_ncharcla} +\_protected\_def\_bcalvariables {\_umathrange{A-Z}70\_ncharbcA \_umathrange{a-z}70\_ncharbca} +\_protected\_def\_frakvariables {\_umathrange{A-Z}70\_ncharfrA \_umathrange{a-z}70\_ncharfra} +\_protected\_def\_bfrakvariables {\_umathrange{A-Z}70\_ncharbrA \_umathrange{a-z}70\_ncharbra} +\_protected\_def\_bbvariables {\_umathrange{A-Z}70\_ncharbbA \_umathrange{a-z}70\_ncharbba} +\_protected\_def\_sansvariables {\_umathrange{A-Z}70\_ncharsnA \_umathrange{a-z}70\_ncharsna} +\_protected\_def\_bsansvariables {\_umathrange{A-Z}70\_ncharbsA \_umathrange{a-z}70\_ncharbsa} +\_protected\_def\_isansvariables {\_umathrange{A-Z}70\_ncharsiA \_umathrange{a-z}70\_ncharsia} +\_protected\_def\_bisansvariables {\_umathrange{A-Z}70\_ncharsxA \_umathrange{a-z}70\_ncharsxa} +\_protected\_def\_ttvariables {\_umathrange{A-Z}70\_ncharttA \_umathrange{a-z}70\_nchartta} \_chardef\_greekrmA="0391 \_chardef\_greekrma="03B1 \_chardef\_greekbfA="1D6A8 \_chardef\_greekbfa="1D6C2 @@ -62,18 +62,18 @@ \_chardef\_greeksnA="1D756 \_chardef\_greeksna="1D770 \_chardef\_greeksiA="1D790 \_chardef\_greeksia="1D7AA -\_protected\_def\_itgreek {\_umathrangegreek71\_greekita} -\_protected\_def\_rmgreek {\_umathrangegreek71\_greekrma} -\_protected\_def\_bfgreek {\_umathrangegreek71\_greekbfa} -\_protected\_def\_bigreek {\_umathrangegreek71\_greekbia} -\_protected\_def\_bsansgreek {\_umathrangegreek71\_greeksna} -\_protected\_def\_bisansgreek{\_umathrangegreek71\_greeksia} -\_protected\_def\_itGreek {\_umathrangeGREEK71\_greekitA \_setnablait} -\_protected\_def\_rmGreek {\_umathrangeGREEK71\_greekrmA \_setnablarm} -\_protected\_def\_bfGreek {\_umathrangeGREEK71\_greekbfA \_setnablabf} -\_protected\_def\_biGreek {\_umathrangeGREEK71\_greekbiA \_setnablabi} -\_protected\_def\_bsansGreek {\_umathrangeGREEK71\_greeksnA \_setnablabsans} -\_protected\_def\_bisansGreek{\_umathrangeGREEK71\_greeksiA \_setnablabisans} +\_protected\_def\_itgreek {\_umathrangegreek70\_greekita} +\_protected\_def\_rmgreek {\_umathrangegreek70\_greekrma} +\_protected\_def\_bfgreek {\_umathrangegreek70\_greekbfa} +\_protected\_def\_bigreek {\_umathrangegreek70\_greekbia} +\_protected\_def\_bsansgreek {\_umathrangegreek70\_greeksna} +\_protected\_def\_bisansgreek{\_umathrangegreek70\_greeksia} +\_protected\_def\_itGreek {\_umathrangeGREEK70\_greekitA \_setnablait} +\_protected\_def\_rmGreek {\_umathrangeGREEK70\_greekrmA \_setnablarm} +\_protected\_def\_bfGreek {\_umathrangeGREEK70\_greekbfA \_setnablabf} +\_protected\_def\_biGreek {\_umathrangeGREEK70\_greekbiA \_setnablabi} +\_protected\_def\_bsansGreek {\_umathrangeGREEK70\_greeksnA \_setnablabsans} +\_protected\_def\_bisansGreek{\_umathrangeGREEK70\_greeksiA \_setnablabisans} \_doc ----------------------------- \`\_setnabla` is used in order to `\nabla` behaves like uppercase Greek @@ -81,7 +81,7 @@ If you want to deactivate this behavior, use `\def\_setnabla#1 {}`. \_cod ----------------------------- -\_def \_setnabla {\_Umathcode"2207 = 7 1} +\_def \_setnabla {\_Umathcode"2207 = 7 0} \_def \_setnablarm {\_setnabla"02207 } \_def \_setnablabf {\_setnabla"1D6C1 } \_def \_setnablait {\_setnabla"1D6FB } @@ -100,12 +100,12 @@ \_chardef\_digitbsO="1D7EC \_chardef\_digitttO="1D7F6 -\_protected\_def\_rmdigits {\_umathrange{0-9}71\_digitrmO} -\_protected\_def\_bfdigits {\_umathrange{0-9}71\_digitbfO} -\_protected\_def\_bbdigits {\_umathrange{0-9}71\_digitbbO} -\_protected\_def\_sansdigits {\_umathrange{0-9}71\_digitsnO} -\_protected\_def\_bsansdigits {\_umathrange{0-9}71\_digitbsO} -\_protected\_def\_ttdigits {\_umathrange{0-9}71\_digitttO} +\_protected\_def\_rmdigits {\_umathrange{0-9}70\_digitrmO} +\_protected\_def\_bfdigits {\_umathrange{0-9}70\_digitbfO} +\_protected\_def\_bbdigits {\_umathrange{0-9}70\_digitbbO} +\_protected\_def\_sansdigits {\_umathrange{0-9}70\_digitsnO} +\_protected\_def\_bsansdigits {\_umathrange{0-9}70\_digitbsO} +\_protected\_def\_ttdigits {\_umathrange{0-9}70\_digitttO} \_doc ----------------------------- The \`\cal`, \`\bbchar`, \`\frak`, \`\script` and @@ -164,10 +164,10 @@ } \_sdef{_c:L}{1}\_sdef{_c:B}{2}\_sdef{_c:V}{2}\_sdef{_c:R}{3}\_sdef{_c:N}{0}\_sdef{_c:U}{0} \_sdef{_c:F}{0}\_sdef{_c:O}{4}\_sdef{_c:C}{5}\_sdef{_c:P}{6}\_sdef{_c:A}{7} - \_def\_pset#1#2{\_Umathcode#1=\_tmp\_space 1 #1\_relax - \_if#2O\_Udelcode#1=1 #1\_relax\_fi - \_if#2C\_Udelcode#1=1 #1\_relax\_fi - \_if#2F\_Udelcode#1=1 #1\_relax\_fi + \_def\_pset#1#2{\_Umathcode#1=\_tmp\_space 0 #1\_relax + \_if#2O\_Udelcode#1=0 #1\_relax\_fi + \_if#2C\_Udelcode#1=0 #1\_relax\_fi + \_if#2F\_Udelcode#1=0 #1\_relax\_fi } \_catcode`#=14 \_everyeof={;{} } \_def\par{} \_globaldefs=1 \_ea \_p \_input mathclass.opm @@ -183,11 +183,11 @@ \_begingroup % \input unimath-table.opm (it is a copy of unicode-math-table.tex): \_def\UnicodeMathSymbol #1#2#3#4{% \_ifnum#1=\_Umathcodenum#1 % the code isn't set by mathclass.opm - \_Umathchardef#2=0 1 #1 \_Umathcode#1=0 1 #1 + \_Umathchardef#2=0 0 #1 \_Umathcode#1=0 0 #1 \_else \_Umathcharnumdef#2=\_Umathcodenum#1 \_fi - \_ifx#3\_mathopen \_def#2{\_Udelimiter 4 1 #1 }\_fi - \_ifx#3\_mathclose \_def#2{\_Udelimiter 5 1 #1 }\_fi - \_ifx#3\_mathaccent \_def#2{\_Umathaccent fixed 7 1 #1 }\_fi + \_ifx#3\_mathopen \_def#2{\_Udelimiter 4 0 #1 }\_fi + \_ifx#3\_mathclose \_def#2{\_Udelimiter 5 0 #1 }\_fi + \_ifx#3\_mathaccent \_def#2{\_Umathaccent fixed 7 0 #1 }\_fi } \_globaldefs=1 \_input unimath-table.opm \_endgroup @@ -196,29 +196,29 @@ Many special characters must be declared with care... \_cod ----------------------------- -\_global\_Udelcode`<=1 "027E8 % these characters have different meaning -\_global\_Udelcode`>=1 "027E9 % as normal and as delimeter +\_global\_Udelcode`<=0 "027E8 % these characters have different meaning +\_global\_Udelcode`>=0 "027E9 % as normal and as delimeter \_mit % default math alphabets setting % hyphen character is transformed to minus: -\_Umathcode `- = 2 1 "2212 +\_Umathcode `- = 2 0 "2212 % mathclass defines : as Punct, plain.tex as Rel, we keep mathclass, % i.e. there is difference from plain.tex, you can use $f:A\to B$. % mathclas defines ! as Ord, plain.tex as Close -\_Umathcode `! = 5 1 `! % keep plain.tex declaration -\_Umathchardef \mathexclam = 5 1 `! +\_Umathcode `! = 5 0 `! % keep plain.tex declaration +\_Umathchardef \mathexclam = 5 0 `! % mathclas defines ? as Punct, plain.tex as Close -\_Umathcode `? = 5 1 `? % keep plain.tex declaration -\_Umathchardef \mathquestion = 5 1 `? +\_Umathcode `? = 5 0 `? % keep plain.tex declaration +\_Umathchardef \mathquestion = 5 0 `? -\_Umathcode `* = 2 1 "02217 % equivalent to \ast, like in plain TeX +\_Umathcode `* = 2 0 "02217 % equivalent to \ast, like in plain TeX -\_protected\_def \_sqrt {\_Uradical 1 "0221A } -\_protected\_def \_cuberoot {\_Uradical 1 "0221B } -\_protected\_def \_fourthroot {\_Uradical 1 "0221C } +\_protected\_def \_sqrt {\_Uradical 0 "0221A } +\_protected\_def \_cuberoot {\_Uradical 0 "0221B } +\_protected\_def \_fourthroot {\_Uradical 0 "0221C } \_def \nabla {^^^^2207} % \nabla behaves as uppercase Gereek letter, see \_setnabla @@ -237,36 +237,36 @@ \pointint "02A15 \sqint "02A16 \intlarhk "02A17 \intx "02A18 \intcap "02A19 \intcup "02A1A \upint "02A1B \lowint "02A1C \_relax "0 -\_protected\_def \vert {\_Udelimiter 0 1 "07C } -\_protected\_def \Vert {\_Udelimiter 0 1 "02016 } -\_protected\_def \Vvert {\_Udelimiter 0 1 "02980 } +\_protected\_def \vert {\_Udelimiter 0 0 "07C } +\_protected\_def \Vert {\_Udelimiter 0 0 "02016 } +\_protected\_def \Vvert {\_Udelimiter 0 0 "02980 } -\_protected\_def \_overbrace #1{\mathop {\Umathaccent 7 1 "023DE{#1}}\limits} -\_protected\_def \_underbrace #1{\mathop {\Umathaccent bottom 7 1 "023DF{#1}}\limits} -\_protected\_def \_overparen #1{\mathop {\Umathaccent 7 1 "023DC{#1}}\limits} -\_protected\_def \_underparen #1{\mathop {\Umathaccent bottom 7 1 "023DD{#1}}\limits} -\_protected\_def \_overbracket #1{\mathop {\Umathaccent 7 1 "023B4{#1}}\limits} -\_protected\_def \_underbracket #1{\mathop {\Umathaccent bottom 7 1 "023B5{#1}}\limits} +\_protected\_def \_overbrace #1{\mathop {\Umathaccent 7 0 "023DE{#1}}\limits} +\_protected\_def \_underbrace #1{\mathop {\Umathaccent bottom 7 0 "023DF{#1}}\limits} +\_protected\_def \_overparen #1{\mathop {\Umathaccent 7 0 "023DC{#1}}\limits} +\_protected\_def \_underparen #1{\mathop {\Umathaccent bottom 7 0 "023DD{#1}}\limits} +\_protected\_def \_overbracket #1{\mathop {\Umathaccent 7 0 "023B4{#1}}\limits} +\_protected\_def \_underbracket #1{\mathop {\Umathaccent bottom 7 0 "023B5{#1}}\limits} \_public \overbrace \underbrace \overparen \underparen \overbracket \underbracket ; -\_protected\def \widehat {\Umathaccent 7 1 "00302 } -\_protected\def \widetilde {\Umathaccent 7 1 "00303 } -\_protected\def \overleftharpoon {\Umathaccent 7 1 "020D0 } -\_protected\def \overrightharpoon {\Umathaccent 7 1 "020D1 } -\_protected\def \overleftarrow {\Umathaccent 7 1 "020D6 } -\_protected\def \overrightarrow {\Umathaccent 7 1 "020D7 } -\_protected\def \overleftrightarrow {\Umathaccent 7 1 "020E1 } +\_protected\def \widehat {\Umathaccent 7 0 "00302 } +\_protected\def \widetilde {\Umathaccent 7 0 "00303 } +\_protected\def \overleftharpoon {\Umathaccent 7 0 "020D0 } +\_protected\def \overrightharpoon {\Umathaccent 7 0 "020D1 } +\_protected\def \overleftarrow {\Umathaccent 7 0 "020D6 } +\_protected\def \overrightarrow {\Umathaccent 7 0 "020D7 } +\_protected\def \overleftrightarrow {\Umathaccent 7 0 "020E1 } -\_mathchardef\ldotp="612E +\_Umathchardef \ldotp = 6 0 "002E \_let\|=\Vert \_mathcode`\_="8000 -\_global\_Umathcode "22EF = 0 1 "22EF % mathclass says that it is Rel -\_global\_Umathcode "002E = 0 1 "002E % mathclass says that dot is Punct -\_global\_Umathchardef \unicodecdots = 0 1 "22EF +\_global\_Umathcode "22EF = 0 0 "22EF % mathclass says that it is Rel +\_global\_Umathcode "002E = 0 0 "002E % mathclass says that dot is Punct +\_global\_Umathchardef \unicodecdots = 0 0 "22EF -\_global\_Umathcode `/ = 0 1 `/ % mathclass says that / is Bin, Plain TeX says that it is Ord. +\_global\_Umathcode `/ = 0 0 `/ % mathclass says that / is Bin, Plain TeX says that it is Ord. % compressed dots in S and SS styles (usable in \matrix when it is in T, S and SS style) \_protected\_def \vdots {\_relax \_ifnum \_mathstyle>3 \_unicodevdots \_else \_vdots \_fi}