summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/csplain/fonts/luafonts.tex
blob: 90b7db5c84fbb0a62c79b57e7028f80e61bddc89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
% This is a result of my reverse engeneering of the luaotfload.sty package.
% LuaTeX needs these \directlua in order to \font primitive works like in XeTeX.
% Petr Olsak     Nov. 2012,  Nov. 2013

\ifx\luafonts\undefined \else \message{...skipping}\endinput\fi
\global\let\luafonts=\relax

\openin15=ltluatex.tex
\ifeof15 \else \closein15  %%%%%%%%%%%%% ltluatex exists

\expandafter\ifx\csname e@alloc@attribute@count\endcsname \relax
   \csname newcount\expandafter \endcsname \csname e@alloc@attribute@count\endcsname
   \csname e@alloc@attribute@count\endcsname=-1 \fi

\message{processing ltluatex.lua (3)}
\directlua{
  require("ltluatex")
  require('luaotfload-main') local _void = luaotfload.main ()
}
\endinput \fi           

\ifnum\luatexversion>75  %%%%%%%%%%%%% LuaTeXversion = 76...80

\ifnum\luatexversion<79 \def\luaotfloadfile{luaotfload}
\else \def\luaotfloadfile{luaotfload-main}\fi

\message{processing luaotfload.lua (2)}
\expandafter\ifx\csname LuT@AllocAttribute\endcsname \relax
   \csname newcount\expandafter \endcsname \csname LuT@AllocAttribute\endcsname \fi
\csname LuT@AllocAttribute\endcsname=-1
\directlua{luatexbase = luatexbase or {}
              luatexbase.luatexversion = \the\luatexversion\space
              luatexbase.luatexrevision = \luatexrevision\space
           require('luatexbase.modutils')
           require('luatexbase.attr')
           oriwrite = texio.write_nl % I don't need to see unusual info
           function texio.write_nl(...) end
           require('luatexbase.mcb')
           luatexbase.require_module('\luaotfloadfile')
           texio.write_nl = oriwrite % return to original meaning
}
\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