summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-11 00:11:00 +0000
committerKarl Berry <karl@freefriends.org>2016-01-11 00:11:00 +0000
commitb58c2422fdc381e8a6656819c1619ab8b543839d (patch)
tree863f5848e71536de968edb1b0bbacfde05d5227d /Master/texmf-dist/source/luatex
parentcfcee1f873c225e7c4302528f481cca65194a381 (diff)
chickenize (10jan16)
git-svn-id: svn://tug.org/texlive/trunk@39341 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/luatex')
-rw-r--r--Master/texmf-dist/source/luatex/chickenize/chickenize.dtx57
1 files changed, 29 insertions, 28 deletions
diff --git a/Master/texmf-dist/source/luatex/chickenize/chickenize.dtx b/Master/texmf-dist/source/luatex/chickenize/chickenize.dtx
index d98dcb84b89..d425244117c 100644
--- a/Master/texmf-dist/source/luatex/chickenize/chickenize.dtx
+++ b/Master/texmf-dist/source/luatex/chickenize/chickenize.dtx
@@ -19,7 +19,7 @@ arno dot trautmann at gmx dot de
Hope you have fun with this package!
-This package is copyright © 2015 Arno L. Trautmann. It may be distributed and/or
+This package is copyright © 2016 Arno L. Trautmann. It may be distributed and/or
modified under the conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version. This work has the LPPL mainten-
ance status ‘maintained’.
@@ -37,7 +37,7 @@ ance status ‘maintained’.
EXPERIMENTAL CODE
-This package is copyright © 2015 Arno L. Trautmann. It may be distributed and/or
+This package is copyright © 2016 Arno L. Trautmann. It may be distributed and/or
modified under the conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version. This work has the LPPL mainten-
ance status ‘maintained’.
@@ -117,7 +117,7 @@ chickenize
\unrainbowcolor
-\centerline{v0.2.2}
+\centerline{v0.2.3}
\centerline{\hspace*{2cm} Arno L. Trautmann \ALT}
\centerline{\href{mailto:arno.trautmann@gmx.de}{arno.trautmann@gmx.de}}
@@ -140,7 +140,7 @@ If you have any suggestions or comments, just drop me a mail, I’ll be happy to
\small\noindent
\fbox{\parbox{.97\textwidth}{
-This package is copyright © 2015 Arno L. Trautmann. It may be distributed and/or
+This package is copyright © 2016 Arno L. Trautmann. It may be distributed and/or
modified under the conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version. This work has the LPPL maintenance status ‘maintained’.}}
\vspace*{1cm}
@@ -700,9 +700,6 @@ The namespace of the chickenize package is \emph{not} consistent. Please don't t
\def\unupsidedown{
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","upsidedown")}}
-\def\unuppercasecolor{
- \directlua{luatexbase.remove_from_callback("post_linebreak_filter","upsidedow")}}
-
\def\variantjustification{
\directlua{luatexbase.add_to_callback("post_linebreak_filter",variantjustification,"variantjustification")}}
\def\unvariantjustification{
@@ -809,7 +806,7 @@ sloppyline(flugel_vorne,flugel_unten) sloppyline(flugel_hinten,flugel_unten)
% Some code might be implemented to manipulate figures for full chickenization. However, I will \emph{not} load any packages at this place, as loading of expl3 or TikZ or whatever takes too much time for such a tiny package like this one. If you require any of the features presented here, you have to load the packages on your own. Maybe this will change.
% \begin{macrocode}
\ProvidesPackage{chickenize}%
- [2015/12/26 v0.2.2 chickenize package]
+ [2016/01/09 v0.2.3 chickenize package]
\input{chickenize}
% \end{macrocode}
% \subsection{Free Compliments}
@@ -859,6 +856,10 @@ WHAT = nodeid("whatsit")
COL = node.subtype("pdf_colorstack")
PDF_LITERAL = node.subtype("pdf_literal")
GLYPH = nodeid("glyph")
+GLUE = nodeid("glue")
+PENALTY = nodeid("penalty")
+GLUE_SPEc = nodeid("glue_spec")
+KERN = nodeid("kern")
% \end{macrocode}
% Now we set up the nodes used for all color things. The nodes are whatsits of subtype |pdf_colorstack|.
% \begin{macrocode}
@@ -909,8 +910,8 @@ chickenize_real_stuff = function(i,head)
local char = unicode.utf8.char(s)
chicken[j].char = s
if match(char,"%s") then
- chicken[j] = nodenew(10)
- chicken[j].spec = nodenew(47)
+ 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
@@ -983,8 +984,8 @@ end
% Linewise rotation:
% \begin{macrocode}
boustrophedon = function(head)
- rot = node.new(8,PDF_LITERAL)
- rot2 = node.new(8,PDF_LITERAL)
+ rot = node.new(WHAT,PDF_LITERAL)
+ rot2 = node.new(WHAT,PDF_LITERAL)
odd = true
for line in node.traverse_id(0,head) do
if odd == false then
@@ -1005,8 +1006,8 @@ end
% \begin{macrocode}
boustrophedon_glyphs = function(head)
odd = false
- rot = nodenew(8,PDF_LITERAL)
- rot2 = nodenew(8,PDF_LITERAL)
+ rot = nodenew(WHAT,PDF_LITERAL)
+ rot2 = nodenew(WHAT,PDF_LITERAL)
for line in nodetraverseid(0,head) do
if odd==true then
line.dir = "TRT"
@@ -1029,8 +1030,8 @@ end
% Inverse boustrophedon. At least I think, this is the way Rongorongo is written. However, the top-to-bottom direction has to be inverted, too.
% \begin{macrocode}
boustrophedon_inverse = function(head)
- rot = node.new(8,PDF_LITERAL)
- rot2 = node.new(8,PDF_LITERAL)
+ rot = node.new(WHAT,PDF_LITERAL)
+ rot2 = node.new(WHAT,PDF_LITERAL)
odd = true
for line in node.traverse_id(0,head) do
if odd == false then
@@ -1301,8 +1302,8 @@ leftsideright = function(head)
local factor = 65536/0.99626
for n in nodetraverseid(GLYPH,head) do
if (leftsiderightarray[n.char]) then
- shift = nodenew(8,PDF_LITERAL)
- shift2 = nodenew(8,PDF_LITERAL)
+ shift = nodenew(WHAT,PDF_LITERAL)
+ shift2 = nodenew(WHAT,PDF_LITERAL)
shift.data = "q -1 0 0 1 " .. n.width/factor .." 0 cm"
shift2.data = "Q 1 0 0 1 " .. n.width/factor .." 0 cm"
nodeinsertbefore(head,n,shift)
@@ -1396,15 +1397,15 @@ medievalumlaut = function(head)
if (n.char == 228 or n.char == 246 or n.char == 252) then
e_node = nodecopy(org_e_node)
e_node.font = n.font
- shift = nodenew(8,PDF_LITERAL)
- shift2 = nodenew(8,PDF_LITERAL)
+ shift = nodenew(WHAT,PDF_LITERAL)
+ shift2 = nodenew(WHAT,PDF_LITERAL)
shift2.data = "Q 1 0 0 1 " .. e_node.width/factor .." 0 cm"
nodeinsertafter(head,n,e_node)
nodeinsertbefore(head,e_node,shift)
nodeinsertafter(head,e_node,shift2)
- x_node = nodenew(11)
+ x_node = nodenew(KERN)
x_node.kern = -e_node.width
nodeinsertafter(head,shift2,x_node)
end
@@ -1608,13 +1609,13 @@ end
% \subsection{suppressonecharbreak}\label{sec:suppressonecharbreak}
% We rush through the node list before line breaking takes place and insert large penalties for breaks after single glyphs. To keep the code as small, simple and fast as possible, we |traverse_id| over spaces and see wether the |next.next| node is also a space. This might not be the best and most universal way of doing it, but the simplest. The penalty is not created newly each time, but copied – no significant speed gain, however.
% \begin{macrocode}
-suppressonecharbreakpenaltynode = node.new(12)
+suppressonecharbreakpenaltynode = node.new(PENALTY)
suppressonecharbreakpenaltynode.penalty = 10000
% \end{macrocode}
% \begin{macrocode}
function suppressonecharbreak(head)
- for i in node.traverse_id(10,head) do
- if ((i.next) and (i.next.next.id == 10)) then
+ for i in node.traverse_id(GLUE,head) do
+ if ((i.next) and (i.next.next.id == GLUE)) then
pen = node.copy(suppressonecharbreakpenaltynode)
node.insert_after(head,i.next,pen)
end
@@ -1648,8 +1649,8 @@ tanjanize = function(head)
local s = nodenew(nodeid"kern")
local m = nodenew(GLYPH,1)
local use_letter_i = true
- scale = nodenew(8,PDF_LITERAL)
- scale2 = nodenew(8,PDF_LITERAL)
+ scale = nodenew(WHAT,PDF_LITERAL)
+ scale2 = nodenew(WHAT,PDF_LITERAL)
scale.data = "0.5 0 0 0.5 0 0 cm"
scale2.data = "2 0 0 2 0 0 cm"
@@ -1712,8 +1713,8 @@ upsidedown = function(head)
for line in nodetraverseid(Hhead,head) do
for n in nodetraverseid(GLYPH,line.head) do
if (upsidedownarray[n.char]) then
- shift = nodenew(8,PDF_LITERAL)
- shift2 = nodenew(8,PDF_LITERAL)
+ shift = nodenew(WHAT,PDF_LITERAL)
+ shift2 = nodenew(WHAT,PDF_LITERAL)
shift.data = "q 1 0 0 -1 0 " .. n.height/factor .." cm"
shift2.data = "Q 1 0 0 1 " .. n.width/factor .." 0 cm"
nodeinsertbefore(head,n,shift)