• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ソースコードの管理場所


Commit MetaInfo

修订版5b1b236a2d586ae8121b953fec9d3714527aa7dd (tree)
时间2016-02-07 15:57:24
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

lltjfont.sty: \adjustbaseline is re-implemented by luafunction

更改概述

差异

--- a/doc/luatexja.dtx
+++ b/doc/luatexja.dtx
@@ -24,6 +24,7 @@
2424
2525 %%%%%%%% fonts
2626 \usepackage{luatexja-otf}
27+\directlua{luatexja.otf.enable_ivs()}
2728 \usepackage[no-math]{fontspec}
2829 \setmainfont[Ligatures=TeX]{Linux Libertine O}
2930 \setmonofont[Scale=MatchLowercase, ItalicFont=lmmono10-italic.otf,
@@ -5240,11 +5241,11 @@ in \pTeX, and symbols beside each parameter has the following meaning:
52405241 %</ja>
52415242 \begin{itemize}
52425243 %<*en>
5243-\item ``\ast'' : values at the end of a paragraph or a hbox are
5244+\item ``$\ast$'' : values at the end of a paragraph or a hbox are
52445245 adopted in the whole paragraph or the whole hbox.
52455246 %</en>
52465247 %<*ja>
5247-\item ``\ast'':段落やhboxの終端での値がその段落/hbox全体で用いられる.
5248+\item ``$\ast$'':段落やhboxの終端での値がその段落/hbox全体で用いられる.
52485249 %</ja>
52495250 %<*en>
52505251 \item ``\dagger'': assignments are always global.
@@ -6159,8 +6160,10 @@ to match the vertical center of ``M'' and that of ``あ'' in vertical typesetti
61596160 + d_{\text{あ}} - d_{\text{M}},
61606161 \]
61616162 where $h_{a}$~and~$d_{a}$ denote the height of ``$a$'' and the depth, respectively.
6162-In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the
6163+In \LuaTeX-ja, this \cs{adjustbaseline} does similar task, namely setting the
61636164 \Param{talbaselineshift} parameter.
6165+If the \LaTeX\ is 2015/10/01 release or later, \LuaTeX-ja use a Japanese
6166+character whose character class is zero, instead of `あ'.
61646167 %</en>
61656168 %<*ja>
61666169 \pLaTeXe では,\cs{adjustbaseline} は縦組時に「M」と「あ」の中心線を一致させるために,
@@ -6174,8 +6177,12 @@ In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the
61746177 \LuaTeX-jaにおいても\cs{adjustbaseline} は同様に\Param{talbaselineshift}パラメータの調整処
61756178 理を行っている.
61766179
6177-同時に,これも\pLaTeXe の \cs{adjustbaseline} で行われていたが,
6178-「漢」の寸法を元に,(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd} といった長さ変数を設定する.
6180+同時に,これも\pLaTeXe の \cs{adjustbaseline} で同様の処理が行われていたが,
6181+「漢」の寸法を元に(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd}
6182+といった長さ変数を設定する.
6183+
6184+なお,\LaTeX が2015/10/01 版以降の場合は,「あ」「漢」の代わりに
6185+「文字クラス0の和文文字」を用いる.
61796186 %</ja>
61806187
61816188 \item[\cs{fontfamily}\{<family>\}]
@@ -6774,16 +6781,13 @@ JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形
67746781 正しく半角幅で組むために利用されている.
67756782 %</ja>
67766783
6777-\directlua{luatexja.otf.enable_ivs()}
67786784 %<*en>
67796785 \paragraph{IVS support}
67806786 Recent fonts support Ideographic Variation Selector (IVS).
67816787 It seems that \Pkg{luaotfload} and \Pkg{fontspec} packages do not support
67826788 IVS, so we implemented IVS support in \Pkg{luatexja-otf}.
67836789 \emph{IVS support by the \Pkg{luatexja-otf} package is experimental.
6784-If this feature is enabled with current \LuaTeX\ (not with LuaJIT\TeX),
6785-we cannot use any OpenType feature, including {\tt vert}~and~{\tt vrt2},
6786-in vertical writing mode. If you want to enable IVS support nevertheless, load
6790+If you want to enable IVS support, load
67876791 \Pkg{luatexja-otf} and execute the following:}
67886792 %</en>
67896793 %<*ja>
@@ -6798,14 +6802,10 @@ IVSに対応してはいないようである.これらのパッケージで
67986802
67996803 \medskip
68006804
6801-\emph{\Pkg{luatexja-otf}によるIVS対応は試験的なものである.現行の\LuaTeX
6802-でIVS対応を一旦有効にすると,縦組時に句読点などが横組用字形のままで組版されたり,
6803-\Pkg{luaotfload}によるOpenType
6804-featureが(\texttt{vert},~\texttt{vrt2}を含め)一切効かないといった
6805-不具合がある\footnote{なぜかLuaJIT\TeX では大丈夫である.}.}
6806-そのような不具合を知りながら有効にするには,
6805+\emph{\Pkg{luatexja-otf}によるIVS対応は試験的なものである.
6806+有効にするには,
68076807 \Pkg{luatexja-otf}パッケージを読み込んだ上で以下の命令を実行する%
6808-\footnote{この命令を2回以上実行しても意味がない.}:
6808+\footnote{この命令を2回以上実行しても意味がない.}:}
68096809 %</ja>
68106810 \begin{lstlisting}
68116811 \directlua{luatexja.otf.enable_ivs()}
--- a/src/patches/lltjfont.sty
+++ b/src/patches/lltjfont.sty
@@ -3,7 +3,7 @@
33 %
44
55 \NeedsTeXFormat{LaTeX2e}
6-\ProvidesPackage{lltjfont}[2015/08/28 Patch to NFSS2 for LuaTeX-ja]
6+\ProvidesPackage{lltjfont}[2016/02/07 Patch to NFSS2 for LuaTeX-ja]
77
88 \let\k@encoding\@empty
99 \let\ck@encoding\@empty
@@ -368,22 +368,52 @@
368368
369369 \ifdefined\newluafunction
370370 \newluafunction\ltj@@adjust@baseline@inner
371+ \begingroup\catcode`\~=12
371372 \directlua{%
373+ local nulltable = {}
372374 local t = lua.get_functions_table()
375+ local getfont, dir_tate = font.getfont, luatexja.dir_table.dir_tate
376+ local fmt, get_attr = luatexja.jfont.font_metric_table, tex.getattribute
377+ local setdimen, set_attr = tex.setdimen, tex.setattribute
378+ local dir = luatexja.unary_pars.direction
373379 t[\the\ltj@@adjust@baseline@inner] = function()
374- local ft = luatexja.jfont.font_metric_table[
375- tex.getattribute('ltj@curtfnt')] or {}
376- ft = ft and ft.char_type or {}
377- ft = ft and ft[0] or {}
378- local fm = font.getfont(font.current()).characters[77] or {} %% 'M'
379- tex.setattribute('ltj@tablshift',
380- 0.5*((fm.height or 0)- (fm.depth or 0)
381- - (ft.height or 0)+ (ft.depth or 0)))
380+ local ft = fmt[get_attr('ltj@curtfnt')] or nulltable
381+ ft = ft and ft.char_type or nulltable
382+ local fk = ft and ft[0] or nulltable
383+ local ht, dp, wd = fk.height or 0, fk.depth or 0,
384+ fk.width or ft.zw or 0
385+ local fm
386+ = ((getfont(font.current()) or nulltable)
387+ .characters or nulltable)[77] or nulltable %% 'M'
388+ set_attr('ltj@tablshift',
389+ 0.5*((fm.height or 0)- (fm.depth or 0) - ht+ dp))
390+ if dir() ~= dir_tate then
391+ ft = fmt[get_attr('ltj@curjfnt')] or nulltable
392+ ft = ft and ft.char_type or nulltable
393+ fk = ft and ft[0] or nulltable
394+ ht, dp, wd = fk.height or 0, fk.depth or 0,
395+ fk.width or ft.zw or 0
396+ end
397+ setdimen('cht', ht); setdimen('cdp', dp)
398+ setdimen('cwd', wd); setdimen('chs', wd)
399+ setdimen('cHT', ht+dp)
382400 end
383- }
384- \def\ltj@@adjust@baseline{\luafunction\ltj@@adjust@baseline@inner}
401+ }\endgroup
402+ \def\adjustbaseline{\luafunction\ltj@@adjust@baseline@inner
403+ \cvs\normalbaselineskip}
385404 \else
386- \def\ltj@@adjust@baseline{%
405+ \newbox\adjust@box
406+ \newbox\adjust@box@aux
407+ \newdimen\adjust@dimen
408+ \def\adjustbaseline{%
409+ \setbox\adjust@box\hbox{%
410+ \ltj@ykblshift\z@\ltj@tkblshift\z@ 漢}%
411+ \cht\ht\adjust@box
412+ \cdp\dp\adjust@box
413+ \cwd\wd\adjust@box
414+ \cvs\normalbaselineskip
415+ \chs\cwd
416+ \cHT\cht \advance\cHT\cdp
387417 \setbox\adjust@box@aux\hbox{\tate\ltj@tkblshift\z@ 漢}%
388418 \setbox\adjust@box\hbox{\tate\ltj@tablshift\z@ M}%
389419 \adjust@dimen\ht\adjust@box
@@ -395,20 +425,6 @@
395425 \ltj@tablshift=\adjust@dimen
396426 }
397427 \fi
398-\newbox\adjust@box
399-\newbox\adjust@box@aux
400-\newdimen\adjust@dimen
401-\def\adjustbaseline{%
402- \setbox\adjust@box\hbox{%
403- \ltj@ykblshift\z@\ltj@tkblshift\z@ 漢}%
404- \cht\ht\adjust@box
405- \cdp\dp\adjust@box
406- \cwd\wd\adjust@box
407- \cvs\normalbaselineskip
408- \chs\cwd
409- \cHT\cht \advance\cHT\cdp
410- \ltj@@adjust@baseline
411-}
412428 \DeclareRobustCommand\romanencoding[1]{%
413429 \expandafter\ifx\csname T@#1\endcsname\relax
414430 \@latex@error{Encoding scheme `#1' unknown}\@eha
--- a/src/patches/lltjp-listings.sty
+++ b/src/patches/lltjp-listings.sty
@@ -3,7 +3,7 @@
33 %
44
55 \NeedsTeXFormat{LaTeX2e}
6-\ProvidesPackage{lltjp-listings}[2015/12/11 Patch to listings for LuaTeX-ja]
6+\ProvidesPackage{lltjp-listings}[2016/02/07 Patch to listings for LuaTeX-ja]
77 \RequirePackage{listings,luatexbase-cctb}
88
99 %%%%%%%%%%%%%%%% Japanese support
@@ -286,7 +286,7 @@
286286 \else
287287 \lst@lExtend\lst@arg{\lst@temp~}%
288288 \expandafter\lst@InsideConvert@
289- \fi #2}
289+ \fi#2}
290290 }\endgroup
291291
292292 \lst@AddToHook{ExitVars}{%
@@ -344,7 +344,7 @@
344344
345345 %%%%%%%%%%%%%%%% escape to \LaTeX
346346 \lstloadaspects{escape}
347-\gdef\lst@Escape#1#2#3#4{
347+\gdef\lst@Escape#1#2#3#4{%
348348 \lst@CArgX #1\relax\lst@CDefX
349349 {}%
350350 {\lst@ifdropinput\else