Debian Codegraph @

texmf-dist/doc/luatex/luaotfload/filegraph.tex

raw
1 % !Mode:: "TeX:EN:UTF-8:Main"
2 %created with by @marmot 14.09.2018
3 %
4 \documentclass[border=3.14mm,tikz]{standalone}
5 \usetikzlibrary{fit,matrix,positioning,arrows.meta,decorations.text,shapes.callouts}
6 \pgfdeclarelayer{background}
7 \pgfdeclarelayer{container}
8 \pgfdeclarelayer{foreground}
9 \pgfsetlayers{container,background,main,foreground}
10 \usepackage {fontspec}
11 \usepackage {unicode-math}
12 \usepackage{tikzlings-marmots,tikzducks}
13
14 \setmainfont[
15 % Numbers = OldStyle, %% buggy with font cache
16 Ligatures = TeX,
17 BoldFont = {Linux Libertine O Bold},
18 ItalicFont = {Linux Libertine O Italic},
19 SlantedFont = {Linux Libertine O Italic},
20 ]{Linux Libertine O}
21 \setmonofont[Ligatures=TeX,Scale=MatchLowercase]{InconsolataN-Regular.otf}
22 %setsansfont[Ligatures=TeX]{Linux Biolinum O}
23 \setsansfont[Ligatures=TeX,Scale=MatchLowercase]{Iwona Medium}
24
25 \usepackage{luacode}
26 \begin{luacode}
27 require("luaotfload-filelist.lua")
28
29 function printctxfontlist ()
30 t= luaotfload.filelist.selectctxfontentries (luaotfload.filelist.data)
31 for i,v in ipairs (t) do
32 tex.sprint("\\mbox{"..v.name..v.ext.."} ")
33 end
34 end
35
36 function printctxlibslist ()
37 t= luaotfload.filelist.selectctxlibsentries (luaotfload.filelist.data)
38 local rowcnt = 0
39 local sep = "&"
40 for i,v in ipairs (t) do
41 rowcnt = rowcnt + 1
42 if rowcnt % 4 == 0 then sep = "\\\\" else sep = "&" end
43 tex.sprint("\\mbox{"..v.name..v.ext.."}".. sep)
44 end
45 end
46
47 function printctxgenericlist ()
48 t= luaotfload.filelist.selectctxgeneusedentries (luaotfload.filelist.data)
49 local rowcnt = 0
50 local sep = "&"
51 for i,v in ipairs (t) do
52 rowcnt = rowcnt + 1
53 if rowcnt % 2 == 0 then sep = "\\\\" else sep = "&" end
54 tex.sprint("\\mbox{"..v.ctxpref..v.name..v.ext.."}".. sep)
55 end
56 end
57
58
59 function printlibrarylist ()
60 t = luaotfload.filelist.selectlollibentries (luaotfload.filelist.data)
61 local rowcnt = 0
62 local sep = "&"
63 for i,v in ipairs (t) do
64 rowcnt = rowcnt + 1
65 if rowcnt % 2 == 0 then sep = "\\\\" else sep = "&" end
66 tex.sprint("\\mbox{"..v.gitpref..v.name..v.ext.."}".. sep)
67 end
68 if rowcnt % 2 == 1 then tex.sprint("\\\\") end -- if odd number we must end the matrix
69 end
70
71 function printscriptlist ()
72 t = luaotfload.filelist.selectlolscrentries (luaotfload.filelist.data)
73 for i,v in ipairs ( t ) do
74 if v.kind == 8 then
75 tex.sprint( v.name .."\\\\")
76 end
77 end
78 end
79
80 \end{luacode}
81 \begin{document}
82 \begin{tikzpicture}[rounded corners,basic/.style={inner
83 sep=9pt,font=\ttfamily,align=center}]
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 % text nodes
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87 % m1
88 \matrix [matrix of nodes,font=\ttfamily,nodes={anchor=base west},
89 label={[name=mL1,font=\itshape]above:Luaotfload Libraries}] (m1)
90 {%
91 %<<<<<<<<<<<<<<<<
92 \directlua{printlibrarylist()}
93 %>>>>>>>>>>>>>>>>
94 };
95 % m2
96 \node[right=4.2cm of m1,fill=gray!20,draw=gray!30,dashed,basic] (m2) {luaotfload-blacklist.cnf};
97 % m3
98 \matrix [below=2cm of m1,matrix of nodes,font=\ttfamily,nodes={anchor=base west},
99 label={[name=mL3,font=\itshape,anchor=south]above:Lualibs -- Lua Libraries from Context}] (m3)
100 {%
101 %<<<<<<<<<<<<<<<<
102 \directlua{printctxlibslist ()}
103 %>>>>>>>>>>>>>>>>
104 };
105 % m4
106 \node[left=2cm of m3,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm] (m4) {luaotfload.lua};
107 % m5
108 \node[fill=gray!20,draw=gray!30,dashed,basic,inner sep=6mm,anchor=south west] at (m3.south -|
109 m2.west)(m5){%
110 %<<<<<<<<<<<<<<<<
111 luaotfload-names.lua.gz\\
112 luaotfload-names.luc
113 %>>>>>>>>>>>>>>>>
114 };
115 % m6
116 \node[below=3cm of m3,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm] (m6){luaotfload-init.lua};
117 % m7
118 \node[above right=0.5cm and 2.5cm of m6,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm] (m7){luaotfload-log.lua};
119 % m8
120 \matrix [below left=1cm and 2cm of m6,matrix of nodes,font=\ttfamily,
121 row sep=5mm,
122 nodes={inner sep=3mm,fill=orange!10,rounded corners},
123 label={[name=mL8,font=\it]above:Fontloader}] (m8)
124 {%
125 %<<<<<<<<<<<<<<<<
126 fontloader-basics-gen.lua\\
127 fontloader-YY-MM-DD.lua\\
128 %<<<<<<<<<<<<<<<<
129 };
130 % m9
131 \node [below right=1cm and 2cm of m6,font=\ttfamily,
132 inner sep=3mm,text width=7.3cm,align=left,
133 label={[name=mL9,font=\itshape]Font and Node Libraries from Context}] (m9)
134 {\spaceskip=1.5em \raggedright
135 %%<<<<<<<<<<<<<<<<
136 \directlua{printctxfontlist()}
137 %>>>>>>>>>>>>>>>>
138 };
139 % m10
140 \node [below=1cm of m9,font=\ttfamily,
141 inner sep=3mm,text width=7.3cm,align=center,
142 label={[name=mL10,font=\itshape]Font Loader (LuaTeX-Fonts)}] (m10)
143 {\tabcolsep=0.5em
144 \begin{tabular}{@{}ll@{}}
145 %<<<<<<<<<<<<<<<<
146 \directlua{printctxgenericlist ()}
147 %>>>>>>>>>>>>>>>>
148 \end{tabular}
149 };
150 % m11
151 \node [above=1cm of m9] (m11) {Merged libraries};
152 % m12
153 \matrix [below=4cm of m6,xshift=-1cm,matrix of nodes,font=\ttfamily,
154 row sep=5mm,
155 nodes={inner sep=3mm,fill=gray!10,rounded corners,text width=3cm,align=center},
156 label={[name=mL12,font=\sffamily]above:Standalone scripts}] (m12)
157 {%
158 %<<<<<<<<<<<<<<<<
159 \directlua{printscriptlist ()}
160 %>>>>>>>>>>>>>>>>
161 };
162 % m13
163 \node[below=1.2cm of m10,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm] (m13)
164 {%
165 %<<<<<<<<<<<<<<<<
166 luaotfload-glyphlist.lua
167 %>>>>>>>>>>>>>>>>
168 };
169 % m14
170 \node[below=0.8cm of m13,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm] (m14)
171 {%
172 %<<<<<<<<<<<<<<<<
173 luaotfload-characters.lua
174 %>>>>>>>>>>>>>>>>
175 };
176 % m15
177 \node[below=3cm of m8,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm]
178 (m15) {%
179 %<<<<<<<<<<<<<<<<
180 luaotfload-tool.lua
181 %>>>>>>>>>>>>>>>>
182 };
183 % m16
184 \node[below=1cm of m15,fill=gray!20,draw=gray!30,thick,basic,inner sep=6mm]
185 (m16) {%
186 %<<<<<<<<<<<<<<<<
187 luaotfload-diagnostics.lua
188 %>>>>>>>>>>>>>>>>
189 };
190 % m17
191 \node[below=2cm of m16,xshift=3cm,fill=gray!20,draw=gray!30,dashed,basic,inner sep=6pt]
192 (m17) {%
193 %<<<<<<<<<<<<<<<<
194 luaotfload-status.lua
195 %>>>>>>>>>>>>>>>>
196 };
197
198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
199 % envelopes
200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201 \begin{pgfonlayer}{background}
202 %M1
203 \node[fill=gray!10,fit=(m1)(mL1),rounded corners=0](mF1){};
204 %M3
205 \node[fill=blue!10,fit=(m3)(mL3),rounded corners=0](mF3){};
206 %M9
207 \node[fill=purple!10,fit=(m9)(mL9)](mF9){};
208 %M10
209 \node[fill=purple!10,fit=(m10)(mL10)](mF10){};
210 \end{pgfonlayer}
211 \begin{pgfonlayer}{container}
212 %M1
213 \node[fill=gray!20,fit=(mF1)](M1){};
214 %M3
215 \node[fill=blue!20,fit=(mF3)](M3){};
216 %M8
217 \node[fill=orange!20,fit=(m8)(mL8)](mF8){};
218 %M11
219 \node[fill=purple!20,fit=(m11)(mF9)(mF10)](M11){};
220 %M11
221 \node[top color=gray!40,bottom color=red!60!black,fit=(mL12)(m12)](M12){};
222 \end{pgfonlayer}
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224 % arrows
225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
226 \begin{scope}[font=\sffamily,>={Triangle[open]},annotate/.style={postaction={decorate,decoration={text along path,text
227 align=center,raise=2pt,text={|\sffamily| #1}}}}]
228 \draw[->,annotate=luaotfload-database.lua] (M1) -- (m2);
229 \draw[->,annotate=main()] (m4) -- (M1);
230 \draw[->] (m4) -- (M3);
231 \draw[->,annotate=luaotfload-database.lua] (M1.-15) to[out=0,in=90] (m5);
232 \draw[->,annotate=main()] (m4) to[out=-70,in=120] (m6);
233 \draw[->,annotate=init{{\_}}early()] (m6) to[out=45,in=190] (m7);
234 \draw[<-,annotate=init{{\_}}early()] (m8-1-1) to[in=-150,out=0] (m6);
235 \draw[<-,annotate=init{{\_}}main()] (m8-2-1) to[in=-100,out=4] (m6);
236 \draw[->,annotate=unmerged] (m6) to[out=0,in=180] (mF9.150);
237 \draw[->,dashed,annotate=merged] (m8-2-1) to[out=0,in=180] (mF9.170);
238 \draw[->,dashed,annotate=pulls] (m12-1-1) to[out=0,in=180] (mF9);
239 \draw[->,dashed,annotate=pulls] (m12-1-1) to[out=0,in=180] (mF10);
240 \draw[<-,dashed,annotate=merges] (m8-2-1) to[out=-45,in=180] (m12-1-1);
241 \draw[->] (mF10) to node[midway,left]{luatex-fonts-enc.lua} (m13);
242 \draw[->] (mF10.-30) to[out=-60,in=50]node[pos=0.3,right]{ luaotfload-auxiliary.lua} (m14.15);
243 \draw[->,dashed,annotate=generates from glyphlist.txt] (m12-2-1) to[out=0,in=180] (m13);
244 \draw[->,dashed,annotate=generates from Context's char-def.lua] (m12-3-1) to[out=0,in=180] (m14);
245 \draw[->,dashed,annotate={{-}{-}update}] (m15) to[out=130,in=-80] ++ (-3.5,4)
246 to[out=100,in=-110] ++ (0,2)
247 to[out=70,in=-165] (m5);
248 \draw[->,annotate=version information] (m15) to[out=-170,in=90] ++(-3.5,-3)
249 to[out=-90,in=180] (m17);
250 \draw[->] (m15) -- node[midway,right]{-\,-diagnose} (m16);
251 \draw[->,annotate=hash files] (m16) -- (m17);
252 \draw[<-,dashed,annotate=generates from distribution files] (m17)
253 to[out=0,in=-135] ++(5,1) to[out=45,in=0] (m12-4-1);
254 \end{scope}
255
256 \begin{scope}[shift={([xshift=2cm,yshift=-3cm]current bounding box.north west)},sharp corners]
257 \marmot;
258 \duck[invisible];
259 \node[anchor=south,draw,text width=3cm,shape=rectangle callout,font=\sffamily\scriptsize,align=center]
260 at ([yshift=1cm,xshift=-0.5cm]bill)
261 {It looks complicated\\ because it is complicated!};
262 %
263 \end{scope}
264
265 \end{tikzpicture}
266 \end{document}