summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty91
1 files changed, 33 insertions, 58 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
index f55a93f0d52..cfff0f06b7c 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2017/04/01 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2017/05/05 Patch to NFSS2 for LuaTeX-ja]
\def\ltj@chardef@text@cmd#1{%
\let\@ifdefinable\@@ifdefinable%
@@ -405,65 +405,40 @@
\@height.7\baselineskip \@depth.3\baselineskip}%
\let\size@update\relax}}
-\ifdefined\newluafunction
- \newluafunction\ltj@@adjust@baseline@inner
- \begingroup\catcode`\~=12
- \directlua{%
- local nulltable = {}
- local t = lua.get_functions_table()
- local getfont, dir_tate = font.getfont, luatexja.dir_table.dir_tate
- local fmt, get_attr = luatexja.jfont.font_metric_table, tex.getattribute
- local setdimen, set_attr = tex.setdimen, tex.setattribute
- local dir = luatexja.unary_pars.direction
- t[\the\ltj@@adjust@baseline@inner] = function()
- local ft = fmt[get_attr('ltj@curtfnt')] or nulltable
+\newluafunction\ltj@@adjust@baseline@inner
+\begingroup\catcode`\~=12
+\directlua{%
+ local nulltable = {}
+ local t = lua.get_functions_table()
+ local getfont, dir_tate = font.getfont, luatexja.dir_table.dir_tate
+ local fmt, get_attr = luatexja.jfont.font_metric_table, tex.getattribute
+ local setdimen, set_attr = tex.setdimen, tex.setattribute
+ local dir = luatexja.unary_pars.direction
+ t[\the\ltj@@adjust@baseline@inner] = function()
+ local ft = fmt[get_attr('ltj@curtfnt')] or nulltable
+ ft = ft and ft.char_type or nulltable
+ local fk = ft and ft[0] or nulltable
+ local ht, dp, wd = fk.height or 0, fk.depth or 0,
+ fk.width or ft.zw or 0
+ local fm
+ = ((getfont(font.current()) or nulltable)
+ .characters or nulltable)[77] or nulltable %% 'M'
+ set_attr('ltj@tablshift',
+ 0.5*((fm.height or 0)- (fm.depth or 0) - ht+ dp))
+ if dir() ~= dir_tate then
+ ft = fmt[get_attr('ltj@curjfnt')] or nulltable
ft = ft and ft.char_type or nulltable
- local fk = ft and ft[0] or nulltable
- local ht, dp, wd = fk.height or 0, fk.depth or 0,
- fk.width or ft.zw or 0
- local fm
- = ((getfont(font.current()) or nulltable)
- .characters or nulltable)[77] or nulltable %% 'M'
- set_attr('ltj@tablshift',
- 0.5*((fm.height or 0)- (fm.depth or 0) - ht+ dp))
- if dir() ~= dir_tate then
- ft = fmt[get_attr('ltj@curjfnt')] or nulltable
- ft = ft and ft.char_type or nulltable
- fk = ft and ft[0] or nulltable
- ht, dp, wd = fk.height or 0, fk.depth or 0,
- fk.width or ft.zw or 0
- end
- setdimen('cht', ht); setdimen('cdp', dp)
- setdimen('cwd', wd); setdimen('chs', wd)
- setdimen('cHT', ht+dp)
+ fk = ft and ft[0] or nulltable
+ ht, dp, wd = fk.height or 0, fk.depth or 0,
+ fk.width or ft.zw or 0
end
- }\endgroup
- \def\adjustbaseline{\luafunction\ltj@@adjust@baseline@inner
- \cvs\normalbaselineskip}
-\else
- \newbox\adjust@box
- \newbox\adjust@box@aux
- \newdimen\adjust@dimen
- \def\adjustbaseline{%
- \setbox\adjust@box\hbox{%
- \ltj@ykblshift\z@\ltj@tkblshift\z@ 漢}%
- \cht\ht\adjust@box
- \cdp\dp\adjust@box
- \cwd\wd\adjust@box
- \cvs\normalbaselineskip
- \chs\cwd
- \cHT\cht \advance\cHT\cdp
- \setbox\adjust@box@aux\hbox{\tate\ltj@tkblshift\z@ 漢}%
- \setbox\adjust@box\hbox{\tate\ltj@tablshift\z@ M}%
- \adjust@dimen\ht\adjust@box
- \advance\adjust@dimen\dp\adjust@box
- \advance\adjust@dimen-\ht\adjust@box@aux
- \divide\adjust@dimen\tw@
- \advance\adjust@dimen0.5\dp\adjust@box@aux
- \advance\adjust@dimen-\dp\adjust@box
- \ltj@tablshift=\adjust@dimen
- }
-\fi
+ setdimen('cht', ht); setdimen('cdp', dp)
+ setdimen('cwd', wd); setdimen('chs', wd)
+ setdimen('cHT', ht+dp)
+ end
+}\endgroup
+\def\adjustbaseline{\luafunction\ltj@@adjust@baseline@inner
+ \cvs\normalbaselineskip}
\DeclareRobustCommand\romanencoding[1]{%
\expandafter\ifx\csname T@#1\endcsname\relax
\@latex@error{Encoding scheme `#1' unknown}\@eha