diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/optex/math-unicode.opm')
-rw-r--r-- | Master/texmf-dist/tex/luatex/optex/math-unicode.opm | 107 |
1 files changed, 45 insertions, 62 deletions
diff --git a/Master/texmf-dist/tex/luatex/optex/math-unicode.opm b/Master/texmf-dist/tex/luatex/optex/math-unicode.opm index 9b4cf60acbc..cf800ca5408 100644 --- a/Master/texmf-dist/tex/luatex/optex/math-unicode.opm +++ b/Master/texmf-dist/tex/luatex/optex/math-unicode.opm @@ -10,22 +10,15 @@ \_def\_loadmath#1{% \_ifmathloading \_initunifonts - \_isfont"#1"\_iffalse + \_isfont{#1}\_iffalse \_opwarning{Math font "#1" not found, skipped...}% \_else \_def\_unimathfont{#1}% - \_def\_normalmath{% - \_loadumathfamily 1 {\_unimathfont}{} % Base font - \_loadmathfamily 4 rsfs % script - \_setmathdimens - }% - \_let\_boldmath=\_normalmath - \_addto\_boldmath{\_pdfliteral direct {2 Tr .3 w}\_aftergroup\_noboldmath}% - \_def\_noboldmath{\_pdfliteral direct {0 Tr 0 w}}% faked bold only :-( - \_normalmath - \_wterm {MATH-FONT: "#1" -- unicode math prepared.}% - \_setctable\_optexcatcodes \_input unimath-codes.opm \_restorectable - \_mathloadingfalse + \_let\_normalmath = \_normalunimath \_let\_boldmath = \_boldunimath + \_normalmath + \_wterm {MATH-FONT: "#1" -- unicode math prepared.}% + \_setctable\_optexcatcodes \_input unimath-codes.opm \_restorectable + \_mathloadingfalse \_fi\_fi} \_def\_loadboldmath#1#2\to #3{% @@ -34,14 +27,25 @@ \_opwarning{Bold-Math font "#1" not found, skipped...} \_else \_def\_unimathboldfont{#1}% - \_def\_boldmath{% - \_loadumathfamily 1 {\_unimathboldfont}{} % Base font - \_loadmathfamily 4 rsfs % script - \_setmathdimens - }% \_wterm {MATH-FONT: "#1" -- unicode math bold prepared.}% \_fi\_fi} +\_def\_normalunimath{% + \_loadumathfamily 1 {\_unimathfont}{} % Base font + \_loadmathfamily 4 rsfs % script + \_setmathdimens +}% +\_def\_boldunimath{% + \_ifx\_unimathboldfont \_undefined + \_loadumathfamily 1 {\_unimathfont}{embolden=1.7;} % Base faked bold + \_else + \_loadumathfamily 1 {\_unimathboldfont}{} % Base real bold font + \_fi + \_loadmathfamily 4 rsfs % script + \_setmathdimens +}% + + \_def\_umathname#1#2{"#1:\_mfontfeatures#2"} \_def\_mfontfeatures{mode=base;script=math;} @@ -56,13 +60,13 @@ \_optsize=\_optsizesave \_relax } -\_newcount\umathnumA \_newcount\umathnumB +\_newcount\_umathnumA \_newcount\_umathnumB -\def\umathcorr#1#2{\expandafter#1\expandafter{\the#2}} -\def\umathprepare#1{\def\umathscanholes##1[#1]##2##3\relax{##2}} -\def\umathvalue#1{\expandafter\umathscanholes\umathcharholes[#1]{#1}\relax} +\_def\_umathcorr#1#2{\_ea#1\_ea{\_the#2}} +\_def\_umathprepare#1{\_def\_umathscanholes##1[#1]##2##3\_relax{##2}} +\_def\_umathvalue#1{\_ea\_umathscanholes\_umathcharholes[#1]{#1}\_relax} -\def\umathcharholes{% holes in math alphabets: +\_def\_umathcharholes{% holes in math alphabets: [119893]{"210E}[119965]{"212C}[119968]{"2130}[119969]{"2131}% [119971]{"210B}[119972]{"2110}[119975]{"2112}[119976]{"2133}[119981]{"211B}% [119994]{"212F}[119996]{"210A}[120004]{"2134}% @@ -70,25 +74,25 @@ [120122]{"2102}[120127]{"210D}[120133]{"2115}[120135]{"2119} [120136]{"211A}[120137]{"211D}[120145]{"2124}% } -\def\umathrange#1#2{\umathnumB=#2\relax \umathrangeA#1} -\def\umathrangeA#1-#2{\umathnumA=`#1\relax - \loop - \umathcorr\umathprepare\umathnumB - \Umathcode \umathnumA = 7 1 \umathcorr\umathvalue{\umathnumB} - \ifnum\umathnumA<`#2\relax - \advance\umathnumA by1 \advance\umathnumB by1 - \repeat +\_def\_umathrange#1#2{\_umathnumB=#2\_relax \_umathrangeA#1} +\_def\_umathrangeA#1-#2{\_umathnumA=`#1\_relax + \_loop + \_umathcorr\_umathprepare\_umathnumB + \_Umathcode \_umathnumA = 7 1 \_umathcorr\_umathvalue{\_umathnumB} + \_ifnum\_umathnumA<`#2\_relax + \_advance\_umathnumA by1 \_advance\_umathnumB by1 + \_repeat } -\def\umathrangeGREEK{\begingroup - \lccode`A="0391 \lccode`Z="03A9 - \lowercase{\endgroup\umathrange{A-Z}}} -\def\umathrangegreek{\begingroup - \lccode`A="03B1 \lccode`Z="03D6 - \lowercase{\endgroup\umathrange{A-Z}}} -\def\greekdef#1{\ifx#1\relax \else - \begingroup \lccode`X=\umathnumB \lowercase{\endgroup \def#1{X}}% - \advance\umathnumB by 1 - \expandafter\greekdef \fi +\_def\_umathrangeGREEK{\_begingroup + \_lccode`A="0391 \_lccode`Z="03A9 + \_lowercase{\_endgroup \_umathrange{A-Z}}} +\_def\_umathrangegreek{\_begingroup + \_lccode`A="03B1 \_lccode`Z="03D6 + \_lowercase{\_endgroup \_umathrange{A-Z}}} +\_def\_greekdef#1{\_ifx#1\_relax \_else + \_begingroup \_lccode`X=\_umathnumB \_lowercase{\_endgroup \_def#1{X}}% + \_advance\_umathnumB by 1 + \_expandafter\_greekdef \_fi } \_public @@ -120,27 +124,6 @@ accepts only codes less than 255. See http://tex.stackexchange.com/questions/308749/ for more technical details. -The poor bold is used for complete bold vaiant of the font. If the selected -font has its bold vaiant (like xits-math), you can re-define \boldmath macro -by: - -\def\boldmath{% - \loadumathfamily 1 {[xitsmath-bold]}{} % Base font - \loadmathfamily 4 rsfs % script - \setmathdimens -} - -XITSmath-bold needs correction: the norm symbol ||x|| is missing here. So, you -can define: - -\def\boldmath{% - \loadumathfamily 1 {[xitsmath-bold]}{} % Base font - \loadmathfamily 4 rsfs % script - \loadumathfamily 5 {[xitsmath-regular]}{} - \def\|{\Udelimiter 0 5 "02016 }% % norm delimiter from family 5 - \setmathdimens -} - -------------------- \loadmath{[XITSMath-Regular]} ... XITS MATH^^J |