diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-06 21:40:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-06 21:40:42 +0000 |
commit | c2e79031dc84ba98da9a7e985b4cd94eff21d8cf (patch) | |
tree | dec2f847f2c49a031f2da2ea95a670a468e44a38 /Master/texmf-dist/tex/platex | |
parent | f990d3b31353f4fa27c61965524c96d5bbceae0b (diff) |
pxrubrica (6may17)
git-svn-id: svn://tug.org/texlive/trunk@44225 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/platex')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty | 99 |
1 files changed, 83 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty b/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty index 3efd8853ac3..9dd51d8ffe9 100644 --- a/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty +++ b/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pxrubrica} - [2017/04/27 v1.3 PX Japanese-style ruby] + [2017/05/05 v1.3a PX Japanese-style ruby] \RequirePackage{keyval} \def\pxrr@pkgname{pxrubrica} \def\pxrr@error{% @@ -524,6 +524,9 @@ }{% \pxrr@csletcs{ifpxrr@in@luatex}{iffalse}% } +\ifpxrr@in@luatex + \directlua{ pxrubrica = {} } +\fi \@ifpackageloaded{luatexja-core}{% \pxrr@csletcs{ifpxrr@in@luatexja}{iftrue}% }{% @@ -581,13 +584,19 @@ \ifpxrr@in@ptex \begingroup \catcode`\|=0 \gdef\pxrr@if@in@tate{% - \pxrr@cond|iftdir|fi + \pxrr@cond{\if + |iftdir|ifmdir F|else T|fi|else F|fi + T}\fi } \endgroup \else\ifpxrr@in@luatexja - \def\pxrr@if@in@tate{% - \pxrr@cond\ifnum\ltjgetparameter{direction}=\thr@@\fi - } + \ifx\ltj@curtfnt\@undefined + \let\pxrr@if@in@tate\@secondoftwo + \else + \def\pxrr@if@in@tate{% + \pxrr@cond\ifnum\ltjgetparameter{direction}=\thr@@\fi + } + \fi \else \let\pxrr@if@in@tate\@secondoftwo \fi\fi @@ -654,13 +663,58 @@ } \else\ifpxrr@in@luatexja \def\pxrr@get@iiskip#1{% - \edef#1{% - \ifnum\ltjgetparameter{autospacing}=\@ne - \ltjgetparameter{kanjiskip}% - \else \pxrr@zeropt + \ifnum\ltjgetparameter{autospacing}=\@ne + \xdef\pxrr@x@gtempa{\ltjgetparameter{kanjiskip}}% + \ifdim\glueexpr\pxrr@x@gtempa=\maxdimen + \pxrr@get@interchar@glue{\pxrr@x@K\pxrr@x@K}% + \ifdim\glueexpr\pxrr@x@gtempa=\maxdimen + \pxrr@warn@unknown@iiskip + \global\let\pxrr@x@gtempa\pxrr@zeropt + \fi \fi - }% + \let#1\pxrr@x@gtempa + \else + \let#1\pxrr@zeropt + \fi + } + \def\pxrr@warn@unknown@iiskip{% + \global\let\pxrr@warn@unknown@iiskip\relax + \pxrr@warn{Cannot find the kanjiskip value}% + } + \def\pxrr@get@interchar@glue#1{% + \begingroup + \setbox\z@\hbox{#1}% + \skip\z@\maxdimen\relax + \directlua{% + pcall(pxrubrica._get_interchar_glue) + }% + \xdef\pxrr@x@gtempa{\the\skip\z@}% + \endgroup } + \begingroup + \endlinechar=10 \directlua{% + local node, tex = node, tex + local id_glyph, id_glue = node.id("glyph"), node.id("glue") + local id_hlist = node.id("hlist") + function pxrubrica._get_interchar_glue() + local c, n = false, tex.box[0].head + while n do + if n.id == id_glyph or n.id == id_hlist then + c = true + elseif c and n.id == id_glue then + if n.width then + tex.setglue(0, n.width, n.stretch, n.shrink, + n.stretch_order, n.shrink_order) + elseif n.spec then + tex.setskip(0, node.copy(n.spec)) + end + break + end + n = n.next + end + end + }% + \endgroup% \else \def\pxrr@get@iiskip#1{% \let#1\pxrr@zeropt @@ -686,12 +740,23 @@ } \else\ifpxrr@in@luatexja \def\pxrr@get@iaiskip#1{% - \edef#1{% - \ifnum\ltjgetparameter{autoxspacing}=\@ne - \ltjgetparameter{xkanjiskip}% - \else \pxrr@zeropt + \ifnum\ltjgetparameter{autoxspacing}=\@ne + \xdef\pxrr@x@gtempa{\ltjgetparameter{xkanjiskip}}% + \ifdim\glueexpr\pxrr@x@gtempa=\maxdimen + \pxrr@get@interchar@glue{A\pxrr@x@K}% + \ifdim\glueexpr\pxrr@x@gtempa=\maxdimen + \pxrr@warn@unknown@iaiskip + \global\let\pxrr@x@gtempa\pxrr@zeropt + \fi \fi - }% + \let#1\pxrr@x@gtempa + \else + \let#1\pxrr@zeropt + \fi + } + \def\pxrr@warn@unknown@iaiskip{% + \global\let\pxrr@warn@unknown@iaiskip\relax + \pxrr@warn{Cannot find the xkanjiskip value}% } \else \def\pxrr@get@iaiskip#1{% @@ -2692,10 +2757,12 @@ \hb@xt@\pxrr@dima{% \kern-.5\pxrr@dima \pxrr@if@in@tate{}{\lower.38\pxrr@dima}% - \hbox{% + \hb@xt@2\pxrr@dima{% \pxrr@dima=\f@size\p@ \fontsize{2\pxrr@dima}{\z@}\selectfont + \hss \pxrr@ja@dot + \hss }% \hss }% |