diff options
author | Karl Berry <karl@freefriends.org> | 2014-06-23 23:35:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-06-23 23:35:40 +0000 |
commit | d82e5391f0626307e306305eb3fe00eac8c8da3f (patch) | |
tree | 4b85bc59b049d9b7025d666cd0fc324d83d98e4a /Master/texmf-dist/tex/luatex/luatexja/patches | |
parent | 2290bfdf9afc805d8a73d6d9728c1362486db3fd (diff) |
luatexja (22jun14)
git-svn-id: svn://tug.org/texlive/trunk@34369 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/patches')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index 2933844817a..65d86aceced 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -1,6 +1,6 @@ % % lltjfont.sty: derived from plfonts.dtx in pLaTeX. -% +% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{lltjfont}[2014/01/23 Patch to NFSS2 for LuaTeX-ja] @@ -203,7 +203,7 @@ \else %\directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{#2}')}\ifin@% % \usekanji{#2}{#3}{#4}{#5}% - % \let\font\tfont + % \global\let#1\gettfont %\else \useroman{#2}{#3}{#4}{#5}% \global\expandafter\let\expandafter#1\the\font @@ -213,7 +213,7 @@ } \def\DLMfontsw@standard#1#2#3{#1{#2{#3}}} \def\reDeclareMathAlphabet#1#2#3{% - \ifdefined#2 + \ifdefined#2 \@temptokena\expandafter{#2}% \else \@temptokena{#2}% @@ -256,7 +256,18 @@ } \newif\if@knjcmd \def\userelfont{\@knjcmdtrue} -\DeclareRobustCommand\selectfont{% + + +\RequirePackage{everysel} +\let\ltj@@EverySelectfont@Init=\@EverySelectfont@Init +\expandafter\expandafter\expandafter\let +\expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname +\@EverySelectfont@Init +\def\@EverySelectfont@Init{% + \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont + \ltj@@EverySelectfont@Init +} +\def\ltj@selectfont@patch{% \let\tmp@error@fontshape\error@fontshape \let\error@fontshape\error@kfontshape \directlua{luatexja.jfont.is_kyenc('\luatexluaescapestring{\k@encoding}')}\ifin@% @@ -270,41 +281,39 @@ \@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha %\fi \fi +% \let\k@encoding\cy@encoding \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}% \pickup@jfont \font@name + \ltj@@does@alt@set{\curr@kfontshape}% + % alt fonts の定義 + \directlua{luatexja.jfont.output_alt_font_cmd('\luatexluaescapestring{\curr@kfontshape}')}% + % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする + \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% + \fi +% \edef\tmp@item{{\k@encoding}}\expandafter\def\expandafter\k@encoding\tmp@item \kenc@update \let\error@fontshape\tmp@error@fontshape +% \if@knjcmd \@knjcmdfalse \expandafter\ifx \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\relax \expandafter\ifx \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\relax \else - \csname rel@\k@encoding/\k@family/\k@series/all\endcsname + \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\selectfont + % 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり \fi \else - \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname + \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\selectfont + % 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり \fi \fi - \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}% - \pickup@font - \font@name - \enc@update - \ifx\f@linespread\baselinestretch \else - \set@fontsize\baselinestretch\f@size\f@baselineskip - \fi - \size@update -% ここからは altfont 用 - \ltj@@does@alt@set{\curr@kfontshape}% - % alt fonts の定義 - \directlua{luatexja.jfont.output_alt_font_cmd('\luatexluaescapestring{\curr@kfontshape}')}% - % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする - \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}% - \fi } +\EverySelectfont{\ltj@selectfont@patch} + \def\KanjiEncodingPair#1#2{\@namedef{t@enc@#1}{#2}\@namedef{y@enc@#2}{#1}} \KanjiEncodingPair{JY3}{JT3} \def\set@fontsize#1#2#3{% @@ -332,7 +341,7 @@ \newbox\adjust@box \newdimen\adjust@dimen \def\adjustbaseline{% - \setbox\adjust@box\hbox{\ltjsetparameter{yjabaselineshift=\z@}あ}% + \setbox\adjust@box\hbox{\ltj@ykblshift=0あ}% \cht\ht\adjust@box \cdp\dp\adjust@box \cwd\wd\adjust@box @@ -340,14 +349,15 @@ \chs\cwd \cHT\cht \advance\cHT\cdp % \iftdir - % \setbox\adjust@box\hbox{\tbaselineshift\z@ M}% + % \setbox0\hbox{\tate\ltjsetparameter{tjabaselineshift=\z@}あ}% + % \setbox\adjust@box\hbox{\tate\ltjsetparameter{talbaselineshift=\z@}M}% % \adjust@dimen\ht\adjust@box % \advance\adjust@dimen\dp\adjust@box - % \advance\adjust@dimen-\cHT + % \advance\adjust@dimen-\ht0 % \divide\adjust@dimen\tw@ - % \advance\adjust@dimen\cdp + % \advance\adjust@dimen0.5\dp0 % \advance\adjust@dimen-\dp\adjust@box - % \tbaselineshift\adjust@dimen + % \ltjsetparameter{talbaselineshift=\adjust@dimen} % \fi } \DeclareRobustCommand\romanencoding[1]{% @@ -630,7 +640,7 @@ \ifx\ltj@temp\empty\ltj@tempcntb="10FFFF\else\ltj@tempcntb=#2\fi\relax%" \fi \directlua{luatexja.jfont.set_alt_font_latex( - \the\ltj@tempcnta,\the\ltj@tempcntb, + \the\ltj@tempcnta,\the\ltj@tempcntb, '\luatexluaescapestring{\ltj@temp@afont}', '\luatexluaescapestring{\ltj@temp@bfont}')}% } |