diff options
author | Karl Berry <karl@freefriends.org> | 2019-04-30 22:33:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-04-30 22:33:28 +0000 |
commit | 4c47eb4c65696a0ea40b1d4352829064b2fedef4 (patch) | |
tree | 0584dc1047bc8bfb9b0f15ce248aabbbe59f81a0 | |
parent | b6d364c734eb81b15eae8ff489cf3291cb6ecc9b (diff) |
csplain (30apr19)
git-svn-id: svn://tug.org/texlive/trunk@50907 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/tex/csplain/base/lua-hyphen.lan | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/fonts/cs-ebgaramond.tex | 173 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/fonts/exchars.tex | 8 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/fonts/luafonts.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/fonts/uni-math.tex | 120 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex | 5 |
6 files changed, 306 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/csplain/base/lua-hyphen.lan b/Master/texmf-dist/tex/csplain/base/lua-hyphen.lan index 790d52c6c18..9c84902d149 100644 --- a/Master/texmf-dist/tex/csplain/base/lua-hyphen.lan +++ b/Master/texmf-dist/tex/csplain/base/lua-hyphen.lan @@ -4,7 +4,7 @@ \global\chardef\enPatt=0 \gdef\pattlist{\enPatt=0} \gdef\langlist{en(USpreloaded)} -\gdef\enlang{\uselang{en}\enPatt23\nonfrenchspacing} % \lefthyph=2 \righthyph=3 +\gdef\enlang{\dolangua{en}\enPatt23\nonfrenchspacing} % \lefthyph=2 \righthyph=3 \input uni-lcuc % \lccodes, \uccodes in unicode @@ -14,7 +14,7 @@ \def\next{\expandafter\noexpand\csname #1lang\endcsname} \expandafter\xdef \csname #1lang\endcsname {% \noexpand\loadpattrs #2 #4 - \gdef\next{\noexpand\uselang{#1}#3#5}% + \gdef\next{\noexpand\dolangua{#1}#3#5}% \next } \xdef\langlist{\langlist\space #1(#2)} @@ -25,11 +25,11 @@ luatexhyphen.loadlanguage("#1",#2) }% } -\def\uselang#1#2#3#4{\language=#2\lefthyphenmin=#3\righthyphenmin=#4\relax - \frenchspacing % \nonfrenchspacing can be set in \setlanguage{lan} - \setlanguage{#1}% +\def\dolangua#1#2#3#4{\language=#2\lefthyphenmin=#3\righthyphenmin=#4\relax + \frenchspacing % \nonfrenchspacing can be set in \initlanguage{lan} + \initlanguage{#1}% } -\def\setlanguage#1{} +\def\initlanguage#1{} \preplang enus usenglishmax \enusPatt 100 23 \preplang engb ukenglish \engbPatt 101 23 @@ -113,19 +113,19 @@ For example \preplang cs czech \csPatt 115 23 does: \global\chardef\csPatt=115 \gdef\lan:115{cs} \gdef\cslang{\loadpattrs czech 115 - \gdef\cslang{\uselang{cs}\csPatt23}% + \gdef\cslang{\dolangua{cs}\csPatt23}% \cslang} \xdef\langlist{\langlist\space #1(#2)} -and \uselang{cs}\csPatt23 does: +and \dolangua{cs}\csPatt23 does: \language=\csPatt \lefthyphenmin=2 \righthyphenmin=3 - \frenchspacing \setlanguage{cs} + \frenchspacing \initlanguage{cs} -finally \setlanguage{cs} does nothing by default. But user can redefine +finally \initlanguage{cs} does nothing by default. But user can redefine it and specify another features for selected lanuages here. For example: -\def\setlanguage#1{\csname set#1lang\endcsname} +\def\initlanguage#1{\csname set#1lang\endcsname} \def\setenuslang {\nonfrenchspacing} \def\setcslang {...czech specific} \def\setpllang {...polish specific} diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-ebgaramond.tex b/Master/texmf-dist/tex/csplain/fonts/cs-ebgaramond.tex new file mode 100644 index 00000000000..b27a2e4597c --- /dev/null +++ b/Master/texmf-dist/tex/csplain/fonts/cs-ebgaramond.tex @@ -0,0 +1,173 @@ +% The file cs-ebgaramond.tex (C) Petr Krajník, 2019 +% Use "\input cs-ebgaramond" to set the EB Garamond font family in text mode + +\ifx\ffdecl\undefined \input ff-mac \fi + +\ffdecl [EB Garamond] + {\bmed \bsemi \bext \linn \oldn \tabn \propn \caps \swash} + {\rm \bf \it \bi} {+exchars} {TX} {8t 7t U} +\ffvars {Regular}{\boldV}{Italic}{\boldV Italic} + +% Default font settings +\def\resetbold{\ffsetV{bold}{Bold}\ffsetX} +\def\resetnum {\tabn\linn} % Tabular lining numbers +\def\resetfeat{\ffsetV{feat}{}\ffsetX} + +% Bold variants +\def\bmed {\ffsetV{bold}{Medium}\ffsetX} +\def\bsemi{\ffsetV{bold}{SemiBold}\ffsetX} +\def\bext {\ffsetV{bold}{ExtraBold}\ffsetX} +\resetbold %% Default bold is Bold + +\ismacro\fotenc{U}\iftrue + + % Figures + \def\tabn{\ffsetV{tabn}{;+tnum}\ffsetX} \def\propn{\ffsetV{tabn}{;+pnum}\ffsetX} + \def\linn{\ffsetV{numb}{;+lnum}\ffsetX} \def\oldn {\ffsetV{numb}{;+onum}\ffsetX} + \resetnum + + % Features + \def\caps {\ffsetV{feat}{;+smcp}\ffsetX} + \def\swash{\ffsetV{feat}{;+swsh}\ffsetX} + \resetfeat + + \def\ffnamegen{"[EBGaramond-\ffvarV]:\fontfeatures\tabnV\numbV\featV"} + \useff{+kern;+liga}\fam % Load default \tenrm, \tenbf, \tenit and \tenbi + +\else %% Classic TeX Fonts + + \ismacro\fotenc{8t}\iftrue \def\ffenc{t1}\fi + \ismacro\fotenc{7t}\iftrue \def\ffenc{ot1}\fi + + % Figures + \def\tabn{\ffsetV{tabn}{t}\ffsetX} \def\propn{\ffsetV{tabn}{}\ffsetX} + \def\linn{\ffsetV{numb}{lf}\ffsetX} \def\oldn {\ffsetV{numb}{osf}\ffsetX} + \resetnum + + % Features + \def\caps {\ffsetV{feat}{-sc}\ffsetX} + \def\swash{\ffsetV{feat}{-swash}\ffsetX} + \resetfeat + + \def\ffnamegen{EBGaramond-\ffvarV-\tabnV\numbV\featV-\ffenc} + \ffsetX\fam % Load default \tenrm, \tenbf, \tenit and \tenbi + + \input exchars % 7c encoding implemented by exchars macro + \def\setexfamilyG #1 #2 {% Set EBGaramond Family: #1 = figures; #2 = features + \setexfont {EBGaramond-Regular-#1#2-\ffenc} TS1 EBGaramond-Regular-#1-ts1 + \setexfont {EBGaramond-Medium-#1#2-\ffenc} TS1 EBGaramond-Medium-#1-ts1 + \setexfont {EBGaramond-SemiBold-#1#2-\ffenc} TS1 EBGaramond-SemiBold-#1-ts1 + \setexfont {EBGaramond-Bold-#1#2-\ffenc} TS1 EBGaramond-Bold-#1-ts1 + \setexfont {EBGaramond-ExtraBold-#1#2-\ffenc} TS1 EBGaramond-ExtraBold-#1-ts1 + \setexfont {EBGaramond-Italic-#1#2-\ffenc} TS1 EBGaramond-Italic-#1-ts1 + \setexfont {EBGaramond-MediumItalic-#1#2-\ffenc} TS1 EBGaramond-MediumItalic-#1-ts1 + \setexfont {EBGaramond-SemiBoldItalic-#1#2-\ffenc} TS1 EBGaramond-SemiBoldItalic-#1-ts1 + \setexfont {EBGaramond-BoldItalic-#1#2-\ffenc} TS1 EBGaramond-BoldItalic-#1-ts1 + \setexfont {EBGaramond-ExtraBoldItalic-#1#2-\ffenc} TS1 EBGaramond-ExtraBoldItalic-#1-ts1 + } + \setexfamilyG lf {} \setexfamilyG lf -sc \setexfamilyG lf -swash + \setexfamilyG tlf {} \setexfamilyG tlf -sc \setexfamilyG tlf -swash + \setexfamilyG osf {} \setexfamilyG osf -sc \setexfamilyG osf -swash + \setexfamilyG tosf {} \setexfamilyG tosf -sc \setexfamilyG tosf -swash + + \ifx\mubyte\undefined \else \mubyte\euro ^^e2^^82^^ac\endmubyte \fi + \let\euro=\exeuro + +\fi +\tenrm % don't remember to initialize the family with normal font. + +\ifx\loadmathfonts\relax \endinput \fi +\ifx\mathpreloaded X\else \input tx-math \fi + +\endinput + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This file implements EBGaramond font support for plainTeX. + + Requirements +-------------- +This file needs three packages from CTAN. +The "ebgaramond" package for the base font files. +And also ffmac and tx-math macro from the "csplain" package. + + Supported switches +-------------------- +\bmed......Set default bold to Medium. +\bsemi.....Set default bold to SemiBold. +\bext......Set default bold to BoldExtended. +\linn......Lining numbers. All numbers are on the baseline. +\oldn......Old style numbers. +\tabn......Tabular numbers. All number have the same width. +\propn.....Proportional numbers. +\caps......Small Caps. +\swash.....Swash on some glyphs. + +We can reset feature groups to font default by: +\resetbold...Reset default bold. +\resetnum....Reset number options. +\resetfeat...Reset features. + + Omitted features +----------------- +I decided to omit upper and lower indexes as we can do this +via TeXs math mode. Additionally that features doesn't worked +with the whole T1 encoding and so their usage was very limited. + +Also omitted is the "titling" style (OpenType "case" font feature), +because I haven't noticed any change over the original font. +Maybe this is bug in the font OTF sources... + +In T1 code there is no space for additional "st" and other +discretionary ligatures that are set with the \swash switch. +To match T1 visual style the "dlig" font feature was omitted +in Unicode fonts. Users of Unicode TeX can turn it on with +\useff{+dlig} if they want. Then it matches the 7t encoding. + + Math support +-------------- +Default math uses the TX-Math macro which uses italic +instead of math italic to match the text font. The results +are good and usable, but far from perfect... + +There is also math package for this font "ebgaramond-maths". +Unfortunately it replaces only math italic font, and only a part, +so we get only a better Greek alphabet. Symbols as vector arrow +are missing, so this will not work anymore and other problems. +If you want a better matching Greek glyphs you can still use it. + + \input cs-ebgaramond + \ffalias {txr}{EBGaramond-Regular-lf-ot1} + \ffalias{txmi}{EBGaramond12-Italic--oml-ebgaramond} % ebgaramond-maths + +But be warned about problems and missing glyphs. +In the future I will try to make a math font macro for this font. + +If we use Unicode TeX we can use Uni-Math and Garamond-Math.otf font +from "Garamond-Math" package that perfectly matches. But the math font +is under development and can have bugs or other problems. + But tests showed that it works very nice! + + \let\loadmathfonts=\relax + \input cs-ebgaramond + \def\unimathfont{[Garamond-Math]} + \input uni-math + +"ebgaramond-math" is also a CTAN package. + + Limitations +------------- +One limitation is, that if we use \tabn\linn\caps +we get old style tabular lining numbers and not lining tabular normal numbers. +This problem/inconsistency came from the base *.otf files. + +The TS1 fonts has many holes. + +Some imperfections in math mode due the used TX-Math font. + + +%%%%%%%%%%%%%% History of versions: + +Apr.2019 First version of this font file. + +%%%%%%%%%%%%%% EOF cs-ebgaramond.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/exchars.tex b/Master/texmf-dist/tex/csplain/fonts/exchars.tex index 84674f7528d..ff1c8886d87 100644 --- a/Master/texmf-dist/tex/csplain/fonts/exchars.tex +++ b/Master/texmf-dist/tex/csplain/fonts/exchars.tex @@ -77,15 +77,15 @@ \declexfamily cs-qagr Adventor {\setexfamilyB qag r b ri bi cs } \declexfamily cs-qbkr Bonum {\setexfamilyB qbk r b ri bi cs } \declexfamily cs-qhvr Heros {\setexfamilyB qhv r b ri bi cs } -\declexfamily cs-qcsr Pagella {\setexfamilyB qcs r b ri bi cs } -\declexfamily cs-qplr Schola {\setexfamilyB qpl r b ri bi cs } +\declexfamily cs-qcsr Schola {\setexfamilyB qcs r b ri bi cs } +\declexfamily cs-qplr Pagella {\setexfamilyB qpl r b ri bi cs } \declexfamily cs-qcrr Cursor {\setexfamilyB qcr r b ri bi cs } \declexfamily ec-qtmr Termes {\setexfamilyB qtm r b ri bi ec } \declexfamily ec-qagr Adventor {\setexfamilyB qag r b ri bi ec } \declexfamily ec-qbkr Bonum {\setexfamilyB qbk r b ri bi ec } \declexfamily ec-qhvr Heros {\setexfamilyB qhv r b ri bi ec } -\declexfamily ec-qcsr Pagella {\setexfamilyB qcs r b ri bi ec } -\declexfamily ec-qplr Schola {\setexfamilyB qpl r b ri bi ec } +\declexfamily ec-qcsr Schola {\setexfamilyB qcs r b ri bi ec } +\declexfamily ec-qplr Pagella {\setexfamilyB qpl r b ri bi ec } \declexfamily ec-qcrr Cursor {\setexfamilyB qcr r b ri bi ec } \declexfamily cs-lmr10 LMfonts {\setexfamilyB lm r10 bx10 ri10 bxi10 cs } diff --git a/Master/texmf-dist/tex/csplain/fonts/luafonts.tex b/Master/texmf-dist/tex/csplain/fonts/luafonts.tex index 65d841ef940..90b7db5c84f 100644 --- a/Master/texmf-dist/tex/csplain/fonts/luafonts.tex +++ b/Master/texmf-dist/tex/csplain/fonts/luafonts.tex @@ -9,8 +9,8 @@ \ifeof15 \else \closein15 %%%%%%%%%%%%% ltluatex exists \expandafter\ifx\csname e@alloc@attribute@count\endcsname \relax - \csname newcount\expandafter \endcsname \csname e@alloc@attribute@count\endcsname \fi -\csname e@alloc@attribute@count\endcsname=-1 + \csname newcount\expandafter \endcsname \csname e@alloc@attribute@count\endcsname + \csname e@alloc@attribute@count\endcsname=-1 \fi \message{processing ltluatex.lua (3)} \directlua{ diff --git a/Master/texmf-dist/tex/csplain/fonts/uni-math.tex b/Master/texmf-dist/tex/csplain/fonts/uni-math.tex index 0951e0b30d9..6fb0922a266 100644 --- a/Master/texmf-dist/tex/csplain/fonts/uni-math.tex +++ b/Master/texmf-dist/tex/csplain/fonts/uni-math.tex @@ -1,8 +1,8 @@ % uni-math.tex -%%%%%%%%%%%%%%%%%% -% Petr Olsak 2016 +%%%%%%%%%%%%%%%%%%%%%%%% +% Petr Olsak 2016, 2019 -\def\unimathversion{May 2016} % Warning: this is at beta testing state +\def\unimathversion{Mar. 2019} % Warning: this is at beta testing state % Macros for loading Unicode math fonts in XeTeX or LuaTeX @@ -26,7 +26,11 @@ \fi\fi % lua code to re-define \font primitive \def\umathname#1#2{"#1:\mfontfeatures#2"} -\def\mfontfeatures{mode=base;script=math;} +\ifx\directlua\undefined + \def\mfontfeatures{script=math;} % XeTeX +\else + \def\mfontfeatures{mode=base;script=math;} % LuaTeX +\fi \ifx\unimathfont\relax\else % \relax ... font will be declared later \ifx\unimathfont\undefined \def\unimathfont{??}\fi @@ -37,12 +41,15 @@ \message{uni-math WARNING: \string\unimathfont{\unimathfont} isn't loadable.} \bgroup \toks0={Examples:^^J - \def\unimathfont{[xits-math]} ... XITS MATH^^J + \def\unimathfont{[XITSMath-Regular]} ... XITS MATH^^J \def\unimathfont{[latinmodern-math]} ... Latin Modern Math^^J \def\unimathfont{[texgyretermes-math]} ... TeXGyre Termes Math^^J \def\unimathfont{[texgyrebonum-math]} ... TeXGyre Bonum Math^^J \def\unimathfont{[texgyrepagella-math]} ... TeXGyre Pagella Math^^J \def\unimathfont{[texgyreschola-math]} ... TeXGyre Schola Math^^J + \def\unimathfont{[texgyredejavu-math]} ... TeXGyre DeJaVu Math^^J + \def\unimathfont{[LibertinusMath-Regular]} ... Libertinus Math^^J + \def\unimathfont{[FiraMath-Regular]} ... Fira Math^^J \def\unimathfont{[Asana-Math]} ... Asana Math^^J \let\unimathfont=\relax ... Don't load the font right now.^^J Note brackets if direct file name is used. Don't use quotes "...". @@ -170,7 +177,7 @@ \chardef\ncharsnA="1D5A0 \chardef\ncharsna="1D5BA \chardef\ncharbsA="1D5D4 \chardef\ncharbsa="1D5EE \chardef\ncharsiA="1D608 \chardef\ncharsia="1D622 -\chardef\ncharsxA="1D63C \chardef\ncharbsx="1D656 +\chardef\ncharsxA="1D63C \chardef\ncharsxa="1D656 \chardef\ncharttA="1D670 \chardef\nchartta="1D68A \protected\def\rmvariables {\umathrange{A-Z}\ncharrmA \umathrange{a-z}\ncharrma} @@ -264,7 +271,7 @@ } \catcode`#=14 \everypar={\setbox0=\lastbox \par \p} - \input MathClass.txt + \input MathClass-15.txt \endgroup \begingroup % \input unicode-math-table.tex: @@ -314,7 +321,91 @@ \def\overrightarrow {\Umathaccent 7 1 "020D7 } \def\overleftrightarrow {\Umathaccent 7 1 "020E1 } -\let\loadmathfonts=\relax % we need no more 8bit math fonts +% corrections: + +\mathchardef\ldotp="612E +\let\|=\Vert + +\let\setminus=\smallsetminus +\let\diamond=\smwhtdiamond +\let\bullet=\smblkcircle +\let\circ=\vysmwhtcircle +\let\bigcirc=\mdlgwhtcircle +\let\to=\rightarrow +\let\le=\leq +\let\ge=\geq +\let\neq=\ne +\protected\def\triangle{\mathord{\bigtriangleup}} +\let\emptyset=\varnothing +\let\hbar=\hslash +\let\land=\wedge +\let\lor=\vee +\let\owns=\ni +\let\gets=\leftarrow +\let\mathring=\ocirc +\let\lnot=\neg +\let\longdivision=\longdivisionsign +\let\backepsilon=\upbackepsilon +\let\eth=\matheth +\let\dbkarow=\dbkarrow +\let\drbkarow=\drbkarrow +\let\hksearow=\hksearrow +\let\hkswarow=\hkswarrow + +\let\varepsilon=\epsilon +\let\upalpha=\mupalpha +\let\upbeta=\mupbeta +\let\upgamma=\mupgamma +\let\updelta=\mupdelta +\let\upepsilon=\mupvarepsilon +\let\upvarepsilon=\mupvarepsilon +\let\upzeta=\mupzeta +\let\upeta=\mupeta +\let\uptheta=\muptheta +\let\upiota=\mupiota +\let\upkappa=\mupkappa +\let\uplambda=\muplambda +\let\upmu=\mupmu +\let\upnu=\mupnu +\let\upxi=\mupxi +\let\upomicron=\mupomicron +\let\uppi=\muppi +\let\uprho=\muprho +\let\upvarrho=\mupvarrho +\let\upvarsigma=\mupvarsigma +\let\upsigma=\mupsigma +\let\uptau=\muptau +\let\upupsilon=\mupupsilon +\let\upvarphi=\mupvarphi +\let\upchi=\mupchi +\let\uppsi=\muppsi +\let\upomega=\mupomega +\let\upvartheta=\mupvartheta +\let\upphi=\mupphi +\let\upvarpi=\mupvarpi + +\protected\def\not#1{% + \expandafter\ifx \csname not!\string#1\endcsname \relax + \mathrel{\mathord{\rlap{\kern1pt/}}\mathord{#1}}% + \else \csname not!\string#1\endcsname + \fi +} +\def\negationof#1#2{\expandafter\let \csname not!\string#1\endcsname =#2} +\negationof = \neq +\negationof < \nless +\negationof > \ngtr +\negationof \gets \nleftarrow +\negationof \simeq \nsime +\negationof \equal \ne +\negationof \le \nleq +\negationof \ge \ngeq +\negationof \greater \ngtr +\negationof \forksnot \forks +\negationof \in \notin + +% we need no more 8bit math fonts + +\let\loadmathfonts=\relax \endinput @@ -335,7 +426,18 @@ font has its bold vaiant (like xits-math), you can re-define \boldmath macro by: \def\boldmath{% - \loadumathfamily 1 {[xits-mathbold]}{} % Base font + \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 } diff --git a/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex b/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex index f8f21b33199..9ee58c1a853 100644 --- a/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex +++ b/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex @@ -46,6 +46,11 @@ \setfontfam [Heuristica] {\caps} {\rm \it \bf \bi \tt} {} {TX} (8t U) {\input cs-heuristica} \setfontfam [Baskervald X] {\caps} {\rm \it \bf \bi} {} {TX} (8t U) {\input cs-baskerx} \famalias{baskervald}{baskervaldx} +\setfontfam [EB Garamond] {\bmed \bsemi \bext \linn \oldn \tabn \propn \caps \swash} + {\rm \it \bf \bi} {} {TX} (8t 7t U) {\input cs-ebgaramond} +\famalias{gramanond}{ebgaramond} + + \setfontfam [Linux Libertine] {\mono \sans \caps} {\rm \it \bf \bi} {} {TX} (U sU) {\input cs-libertine} \famalias{libertine}{linuxlibertine} \famalias{linlibertine}{linuxlibertine} |