From 49f342e07099ccf4336fb7be401f453065977aca Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 9 Jan 2016 22:28:57 +0000 Subject: csplain (9jan16) git-svn-id: svn://tug.org/texlive/trunk@39330 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/csplain/base/csplain.ini | 8 +- Master/texmf-dist/tex/csplain/base/etex-mac.tex | 100 +++++++++++++++++++++++ Master/texmf-dist/tex/csplain/base/hyphen.lan | 12 ++- Master/texmf-dist/tex/csplain/fonts/luafonts.tex | 51 ++++++++---- 4 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 Master/texmf-dist/tex/csplain/base/etex-mac.tex (limited to 'Master/texmf-dist/tex/csplain') diff --git a/Master/texmf-dist/tex/csplain/base/csplain.ini b/Master/texmf-dist/tex/csplain/base/csplain.ini index 859dfa88266..6af4b59d418 100644 --- a/Master/texmf-dist/tex/csplain/base/csplain.ini +++ b/Master/texmf-dist/tex/csplain/base/csplain.ini @@ -5,10 +5,11 @@ \input csfontsm % macros: \sizespec, \resizefont, \resizeall, \tenbi, \bi \input il2code % extra codes for czech / slovak letters in ISO-8859-2 encoding \ifx\directlua\undefined \else\input luatexiniconfig.tex \fi % LuaTeX specific +\ifx\eTeXversion\undefined \else\input etex-mac.tex \fi % eTeX specific \input hyphen.lan % czech / slovak hyphenation pattern (may be others too) \input plaina4 % \hsize and \vsize for A4 \everyjob=\expandafter{\the\everyjob - \message{The format: csplain .} + \message{The format: csplain .} \message{The cs-fonts are preloaded and A4 size implicitly defined.}} \ifx\xprncode\undefined \else %% The encTeX is detected \count255=128 % All codes > 128 are printable: @@ -227,6 +228,11 @@ file extcode.tex renamed to il2code.tex (suggested by Jan Kasprzak) hyphen.lan: \chardef\USenglish=0 added (for backward compatibility) t1code.tex, ucode.tex: waring supressed if non-csplain loads the file +** 15 ** +* etex-mac.tex introduced. +* hyphen.lan: errmessage about incompatible encoding implemented +* luafonts.tex: new code for new version 80 + COPYRIGHT ========= diff --git a/Master/texmf-dist/tex/csplain/base/etex-mac.tex b/Master/texmf-dist/tex/csplain/base/etex-mac.tex new file mode 100644 index 00000000000..76a078f4d44 --- /dev/null +++ b/Master/texmf-dist/tex/csplain/base/etex-mac.tex @@ -0,0 +1,100 @@ +% etex-mac.tex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Petr Olsak January 2016 + +% This file is a part of csplain package. It is inputted during +% csplain format generation when eTeX is detected (from ). + +% The \newcount, \newdimen, etc. allocators are redefined here in order +% to access the extension register fields from eTeX (up to index 32768). + +% See the end of the file for more details + +\ifx\loccount\undefined \else + \errmessage{etex.src macro package detected, don't use etex-mac} + \endpinput \fi + +\chardef\tmp=\catcode`@ \catcode`@=11 + +\let\inscOunt=\insc@unt +\chardef\insc@unt=200 +\def\et@xmaxregs{32768} % maximal index of registers in eTeX + +\outer\def\newinsert#1{% \newinsert re-defined: + \global\advance\inscxunt by\m@ne + \ifnum\inscOunt<\insc@out + \errmessage{No room for a new \string\insert, try to \chardef\insc@unt < 200}% + \else \allocationnumber=\inscOunt + \global\chardef#1=\allocationnumber + \wlog{\string#1=\string\insert\the\allocationnumber}% + \fi +} +\outer\def\et@newcount{\alloc@0\count\countdef\et@xmaxregs} +\outer\def\et@newdimen{\alloc@1\dimen\dimendef\et@xmaxregs} +\outer\def\et@newskip{\alloc@2\skip\skipdef\et@xmaxregs} +\outer\def\et@newbox{\alloc@4\box\mathchardef\et@xmaxregs} + +\outer\def\newmuskip{\alloc@3\muskip\muskipdef\et@xmaxregs} +\outer\def\newtoks{\alloc@5\toks\toksdef\et@xmaxregs} + +\def\ch@ck#1#2#3{% \ch@ck re-defined + \ifnum\count1#1<#2\relax\else + \ifnum#1<6 + \ifnum#2<\et@xmaxregs + \wlog{eTeX allocation of \string#3: skipping range \string\insc@unt...255}% + \begingroup \escapechar=-1 + \global \expandafter\let \csname new\string#3\expandafter\endcsname + \csname et@new\string#3\endcsname + \endgroup + \count1#1=256 + \ifx#3\box \ch@ckboxch \fi + \else \errmessage{No room for a new #3}% + \fi\fi\fi +} +\def\ch@ckboxch #1\global\chardef{#1\global\mathchardef} + +\newcount\marks@count \marks@count=0 % allocation starts from 1, 2, 3, ... + +\outer\def\newmarks{\et@alloc \marks@count \marks \mathchardef \et@xmaxregs} +\def\et@alloc #1#2#3#4#5{% + \global\advance#1by\@ne + \ifnum#1<#4\relax + \allocationnumber=#1% + \global#3#5=\allocationnumber + \wlog{\string#5=\string#2\the\allocationnumber}% + \else \errmessage{No room for a new #3}\fi +} + +\expandafter\def\expandafter\loggingall\expandafter{\loggingall + \tracingcommands=3 \tracinglostchars=2 + \errorstopmode + \tracinggroups=1 \tracingifs=1 \tracingscantokens=1 + \tracingnesting=1 \tracingassigns=2 +} + +\catcode`@=\tmp + +\endinput + +The \newcount, \newdimen, \newskip and \newbox allocators are kept from +plainTeX, but if the maximal number from plainTeX \insc@unt is reached then +the range \insc@unt...255 is skipped and next indexes are set to 256, 257, ... +The appropriate allocator macro is redefined to the macro \et@newcount, +\et@newdimen etc. in such case. + +The \insc@unt is set as a constant 200. The \newinsert macro is redefined: +it operates with \inscOunt register instead of \insc@unt. The allocated +indexes are 254, 253, ..., \insc@unt. If the limit is reached then the error +"No room for a new \insert" is printed. User can try to set \insc@unt +constant to the value less than 200 in such case. + +The macros \newmuskip, \newtoks are redefined to allocate linear array of +indexes 10, 11, ..., \et@xmaxregs. + +Another allocators (\newread, \newwrite, \newfam, \newlanguage) are unchanged. + +The new allocator \newmarks is defined as an example how to do this without +the Knuth's dirty trick \count1#1. + +The \tracingall, \loggingall macros are re-defined in order to print more +information provided by eTeX. diff --git a/Master/texmf-dist/tex/csplain/base/hyphen.lan b/Master/texmf-dist/tex/csplain/base/hyphen.lan index 1eb5b715e93..af264ab2a2e 100644 --- a/Master/texmf-dist/tex/csplain/base/hyphen.lan +++ b/Master/texmf-dist/tex/csplain/base/hyphen.lan @@ -11,7 +11,7 @@ \message{Loading #4 encoding, \string#1=#2 (#3).} #5 \endgroup \expandafter \def \csname lan:#2\endcsname {#3} - \expandafter \def \csname #3lang\endcsname {% + \expandafter \def \csname #3lang\endcsname {\langpatterntest#9% \language=#9\relax \initlanguage{#3}\frenchspacing \lefthyphenmin=#6\righthyphenmin=#7% \message{#3 hyphenation used (\string\language=\the\language). @@ -22,6 +22,12 @@ \advance\numpatterns by1 \fi } +\def\langpatterntest#1{\ifx\undefined#1\langpatterntestA#1\fi} +\def\langpatterntestA#1{% + \errmessage{Pattern \noexpand#1 ins't supported in ISO-8859-2. + Use \noexpand\input \ifx\unicodelangs\empty t1code\else ucode\fi\space first}% + \chardef#1=0 +} \def\pattlist{} \def\initlanguage#1{} \newcount\numpatterns @@ -433,8 +439,8 @@ {\lccode"200C="200C \lccode"200D="200D \robustpatterns \input hyph-kn }11 \unicodelangs \knPatt -\loadpatterns \loUnicode 214 lo {Lao \patt in Unicode} - {\robustpatterns \input hyph-lo }11 \unicodelangs \loPatt +%\loadpatterns \loUnicode 214 lo {Lao \patt in Unicode} +% {\robustpatterns \input hyph-lo }11 \unicodelangs \loPatt \loadpatterns \lvUnicode 215 lv {Latvian \patt in Unicode} {\robustpatterns \input hyph-lv }22 \unicodelangs \lvPatt diff --git a/Master/texmf-dist/tex/csplain/fonts/luafonts.tex b/Master/texmf-dist/tex/csplain/fonts/luafonts.tex index b6d5899a096..88795e9a553 100644 --- a/Master/texmf-dist/tex/csplain/fonts/luafonts.tex +++ b/Master/texmf-dist/tex/csplain/fonts/luafonts.tex @@ -3,23 +3,22 @@ % LuaTeX needs these \directlua in order to \font primitive works like in XeTeX. % Petr Olsak Nov. 2012, Nov. 2013 -\ifnum\luatexversion<76 %%% +\openin15=ltluatex.tex -\message{processing luaotfload.lua (1)} -\directlua{luatexbase = luatexbase or {} - luatexbase.luatexversion = \the\luatexversion\space - luatexbase.luatexrevision = \luatexrevision\space - require('luatexbase.attr') - require('luatexbase.cctb') - require('luatexbase.modutils') - oriwrite = texio.write_nl % I don't need to see unusual info - function texio.write_nl(...) end - require('luatexbase.mcb') - luatexbase.require_module('lualibs') - luatexbase.require_module('luaotfload') - texio.write_nl = oriwrite % return to original meaning +\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 + +\message{processing ltluatex.lua (3)} +\directlua{ + require("ltluatex") + require('luaotfload-main') local _void = luaotfload.main () } -\else %%% \luatexversion>=76 +\endinput \fi + +\ifnum\luatexversion>75 %%%%%%%%%%%%% LuaTeXversion = 76...80 \ifnum\luatexversion<79 \def\luaotfloadfile{luaotfload} \else \def\luaotfloadfile{luaotfload-main}\fi @@ -39,7 +38,25 @@ luatexbase.require_module('\luaotfloadfile') texio.write_nl = oriwrite % return to original meaning } -\fi \global\let\luafonts=\relax -\endinput +\endinput \fi + +\ifnum\luatexversion<76 %%%%%%%%%%%%% LuaTeXvesion < 76: + +\message{processing luaotfload.lua (1)} +\directlua{luatexbase = luatexbase or {} + luatexbase.luatexversion = \the\luatexversion\space + luatexbase.luatexrevision = \luatexrevision\space + require('luatexbase.attr') + require('luatexbase.cctb') + require('luatexbase.modutils') + oriwrite = texio.write_nl % I don't need to see unusual info + function texio.write_nl(...) end + require('luatexbase.mcb') + luatexbase.require_module('lualibs') + luatexbase.require_module('luaotfload') + texio.write_nl = oriwrite % return to original meaning +} +\endinput \fi + -- cgit v1.2.3