summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-24 21:28:44 +0000
committerKarl Berry <karl@freefriends.org>2016-10-24 21:28:44 +0000
commit764798e280569143f4b729acbf42963d93e13a7e (patch)
tree241a26f34ad485720c8891a07353d1b66d11e36f /Master/texmf-dist/tex/luatex
parent77a90cbe15fc674a0e056da3ec42ad99159807a8 (diff)
chickenize (24oct16)
git-svn-id: svn://tug.org/texlive/trunk@42341 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/chickenize/chickenize.lua39
-rw-r--r--Master/texmf-dist/tex/luatex/chickenize/chickenize.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/chickenize/chickenize.tex87
3 files changed, 72 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua b/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
index 795744285e9..c38d14f99f6 100644
--- a/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
+++ b/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
@@ -13,27 +13,29 @@
-- of this license or (at your option) any later version. This work has the LPPL mainten-
-- ance status ‘maintained’.
-local nodenew = node.new
+local nodeid = node.id
local nodecopy = node.copy
+local nodenew = node.new
local nodetail = node.tail
-local nodeinsertbefore = node.insert_before
-local nodeinsertafter = node.insert_after
+local nodeslide = node.slide
local noderemove = node.remove
-local nodeid = node.id
local nodetraverseid = node.traverse_id
-local nodeslide = node.slide
+local nodeinsertafter = node.insert_after
+local nodeinsertbefore = node.insert_before
Hhead = nodeid("hhead")
RULE = nodeid("rule")
GLUE = nodeid("glue")
WHAT = nodeid("whatsit")
COL = node.subtype("pdf_colorstack")
-PDF_LITERAL = node.subtype("pdf_literal")
+DISC = nodeid("disc")
GLYPH = nodeid("glyph")
GLUE = nodeid("glue")
-PENALTY = nodeid("penalty")
-GLUE_SPEc = nodeid("glue_spec")
+HLIST = nodeid("hlist")
KERN = nodeid("kern")
+PUNCT = nodeid("punct")
+PENALTY = nodeid("penalty")
+PDF_LITERAL = node.subtype("pdf_literal")
color_push = nodenew(WHAT,COL)
color_pop = nodenew(WHAT,COL)
color_push.stack = 0
@@ -52,7 +54,7 @@ chicken_substitutions = 0 -- value to count the substituted chickens. Makes sens
local match = unicode.utf8.match
chickenize_ignore_word = false
chickenize_real_stuff = function(i,head)
- while ((i.next.id == GLYPH) or (i.next.id == 11) or (i.next.id == 7) or (i.next.id == 0)) do --find end of a word
+ while ((i.next.id == GLYPH) or (i.next.id == KERN) or (i.next.id == DISC) or (i.next.id == HLIST)) do --find end of a word
i.next = i.next.next
end
@@ -75,10 +77,9 @@ chickenize_real_stuff = function(i,head)
chicken[j].char = s
if match(char,"%s") then
chicken[j] = nodenew(GLUE)
- chicken[j].spec = nodenew(GLUE_SPEC)
- chicken[j].spec.width = space
- chicken[j].spec.shrink = shrink
- chicken[j].spec.stretch = stretch
+ chicken[j].width = space
+ chicken[j].shrink = shrink
+ chicken[j].stretch = stretch
end
j = j+1
end
@@ -115,7 +116,7 @@ chickenize = function(head)
end
-- At the end of the word, the ignoring is reset. New chance for everyone.
- if not((i.next.id == GLYPH) or (i.next.id == 7) or (i.next.id == 22) or (i.next.id == 11)) then
+ if not((i.next.id == GLYPH) or (i.next.id == DISC) or (i.next.id == PUNCT) or (i.next.id == KERN)) then
chickenize_ignore_word = false
end
end
@@ -395,13 +396,11 @@ leftsideright = function(head)
end
return head
end
-local letterspace_glue = nodenew(nodeid"glue")
-local letterspace_spec = nodenew(nodeid"glue_spec")
-local letterspace_pen = nodenew(nodeid"penalty")
+local letterspace_glue = nodenew(nodeid"glue")
+local letterspace_pen = nodenew(nodeid"penalty")
-letterspace_spec.width = tex.sp"0pt"
-letterspace_spec.stretch = tex.sp"0.05pt"
-letterspace_glue.spec = letterspace_spec
+letterspace_glue.width = tex.sp"0pt"
+letterspace_glue.stretch = tex.sp"0.5pt"
letterspace_pen.penalty = 10000
letterspaceadjust = function(head)
for glyph in nodetraverseid(nodeid"glyph", head) do
diff --git a/Master/texmf-dist/tex/luatex/chickenize/chickenize.sty b/Master/texmf-dist/tex/luatex/chickenize/chickenize.sty
index ed73bd33d4b..c4e2dcf1851 100644
--- a/Master/texmf-dist/tex/luatex/chickenize/chickenize.sty
+++ b/Master/texmf-dist/tex/luatex/chickenize/chickenize.sty
@@ -13,7 +13,7 @@
%% of this license or (at your option) any later version. This work has the LPPL mainten-
%% ance status ‘maintained’.
\ProvidesPackage{chickenize}%
- [2016/01/09 v0.2.3 chickenize package]
+ [2016/05/27 v0.2.4 chickenize package]
\input{chickenize}
\iffalse
diff --git a/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex b/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex
index 53ad81e4196..7d358057d0e 100644
--- a/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex
+++ b/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex
@@ -18,7 +18,7 @@
\bgroup%
\fontspec{Latin Modern Sans}%
A%
- \kern-.37em \raisebox{.7ex}{\scalebox{0.25}{L}}%
+ \kern-.4em \raisebox{.65ex}{\scalebox{0.3}{L}}%
\kern-.0em \raisebox{-0.98ex}{T}%
\egroup%
}
@@ -157,6 +157,23 @@
}
\let\dubstepize\dubstepenize
+\def\explainbackslashes{ %% inspired by xkcd #1638
+ {\tt\noindent
+\textbackslash escape character\\
+\textbackslash\textbackslash line end or escaped escape character in tex.print("")\\
+\textbackslash\textbackslash\textbackslash real, real backslash\\
+\textbackslash\textbackslash\textbackslash\textbackslash line end in tex.print("")\\
+\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash elder backslash \\
+\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash which escapes the screen and enters your brain\\
+\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash so real it transcends time and space \\
+\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash to end all other text\\
+\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash... the true name of Ba'al, the soul-eater}
+}
+
+\def\gameoflife{
+ Your Life Is Tetris. Stop Playing It Like Chess.
+}
+
\def\guttenbergenize{ %% makes only sense when using LaTeX
\AtBeginDocument{
\let\grqq\relax\let\glqq\relax
@@ -255,6 +272,11 @@
\let\nyanize\rainbowcolor
\let\unnyanize\unrainbowcolor
+\def\randomchars{
+ \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomchars,"randomchars")}}
+\def\unrandomchars{
+ \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomchars")}}
+
\def\randomcolor{
\directlua{luatexbase.add_to_callback("post_linebreak_filter",randomcolor,"randomcolor")}}
\def\unrandomcolor{
@@ -381,40 +403,35 @@
}%
}
\long\def\drawchicken{
-\luadraw{90}{
-kopf = {200,50} % Kopfmitte
-kopf_rad = 20
-
-d = {215,35} % Halsansatz
-e = {230,10} %
-
-korper = {260,-10}
-korper_rad = 40
-
-bein11 = {260,-50}
-bein12 = {250,-70}
-bein13 = {235,-70}
-
-bein21 = {270,-50}
-bein22 = {260,-75}
-bein23 = {245,-75}
-
-schnabel_oben = {185,55}
-schnabel_vorne = {165,45}
-schnabel_unten = {185,35}
-
-flugel_vorne = {260,-10}
-flugel_unten = {280,-40}
-flugel_hinten = {275,-15}
-
-sloppycircle(kopf,kopf_rad)
-sloppyline(d,e)
-sloppycircle(korper,korper_rad)
-sloppyline(bein11,bein12) sloppyline(bein12,bein13)
-sloppyline(bein21,bein22) sloppyline(bein22,bein23)
-sloppyline(schnabel_vorne,schnabel_oben) sloppyline(schnabel_vorne,schnabel_unten)
-sloppyline(flugel_vorne,flugel_unten) sloppyline(flugel_hinten,flugel_unten)
-}
+ \luadraw{90}{
+ chickenhead = {200,50} % chicken head center
+ chickenhead_rad = 20
+
+ neckstart = {215,35} % neck
+ neckstop = {230,10} %
+
+ chickenbody = {260,-10}
+ chickenbody_rad = 40
+ chickenleg = {
+ {{260,-50},{250,-70},{235,-70}},
+ {{270,-50},{260,-75},{245,-75}}
+ }
+
+ beak_top = {185,55}
+ beak_front = {165,45}
+ beak_bottom = {185,35}
+
+ wing_front = {260,-10}
+ wing_bottom = {280,-40}
+ wing_back = {275,-15}
+
+ sloppycircle(chickenhead,chickenhead_rad) sloppyline(neckstart,neckstop)
+ sloppycircle(chickenbody,chickenbody_rad)
+ sloppyline(chickenleg[1][1],chickenleg[1][2]) sloppyline(chickenleg[1][2],chickenleg[1][3])
+ sloppyline(chickenleg[2][1],chickenleg[2][2]) sloppyline(chickenleg[2][2],chickenleg[2][3])
+ sloppyline(beak_front,beak_top) sloppyline(beak_front,beak_bottom)
+ sloppyline(wing_front,wing_bottom) sloppyline(wing_back,wing_bottom)
+ }
}
%%
%%