From 64ee5cd9481d22bac2c5e7ba9f89ea86527a352e Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Fri, 29 Dec 2023 20:46:51 +0900 Subject: [PATCH] ltj-setwidth.lua: better? criteria for rotating glyphs --- doc/luatexja.dtx | 12 +++--------- src/ltj-setwidth.lua | 10 ++++++++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index b621f9b..2be57d0 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -675,11 +675,10 @@ CTAN (in the \texttt{macros/luatex/generic/luatexja} directory), and the following distributions: \begin{itemize} \item \href{https://www.tug.org/texlive/}{\TeX~Live} (in \texttt{texmf-dist/tex/luatex/luatexja}) - \item \href{http://w32tex.org/}{W32\TeX}\ (in \texttt{luatexja.tar.xz}) \item MiK\TeX\ (in \texttt{luatexja.tar.xz}) \end{itemize} Harano Aji fonts are also available in these distributions -(\texttt{haranoaji} in \TeX~Live and MiK\TeX, and \texttt{luatexja.tar.xz} in W32\TeX). +(\texttt{haranoaji} in \TeX~Live and MiK\TeX). % %<*ja> 現在,\LuaTeX-jaはCTAN (\texttt{macros/luatex/generic/luatexja})に収録されている他, @@ -687,10 +686,9 @@ Harano Aji fonts are also available in these distributions \begin{itemize} \item MiK\TeX\ (\texttt{luatexja.tar.lzma}) \item \TeX~Live (\texttt{texmf-dist/tex/luatex/luatexja}) - \item W32\TeX\ (\texttt{luatexja.tar.xz}) \end{itemize} これらのディストリビューションは原ノ味フォントも収録している -(\TeX~Live, MiK\TeX では\texttt{haranoaji},W32\TeX では\texttt{luatexja.tar.xz}). +(\TeX~Live, MiK\TeX では\texttt{haranoaji}). % %<*en> @@ -3979,9 +3977,6 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont In this situation, \LuaTeX-ja performs all replacements which is defined in~\texttt{vert} feature for \emph{some} scripts for \emph{some} languages. - \item Furthermore, a glyph is automatically rotated 90~degrees, - if it is not replaced by \texttt{vert} feature for \emph{any} script - for \emph{any} language, and if it is marked as `r''~or~``Tr'' in UAX~\#50. \item \cs{tfont} uses a vertical JFM instead of a horizontal JFM. \LuaTeX-ja ships following vertical JFMs: \begin{description} @@ -4042,8 +4037,7 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont このscript,~languageの組み合わせを指定することはできないので, \Pkg{luaotfload}そのままでは\texttt{vert}を適用させることはできない. }. - \item さらに,「いかなるscript,~languageでも\texttt{vert}により置換されない」グリフ - のうち,UAX~\#50で``r''もしくは``Tr''と指定されているものは90度自動回転させる. + \item さらに,置換前と置換後のグリフがどちらも「UAX~\#50で``r''もしくは``Tr''と指定されている」ものは90度自動回転させる. \item \ref{ssec:math}節で述べる,数式中の和文フォントには縦組用和文フォントは指定できない. \item \meta{JFM name}には縦組用JFMを指定する. 以下の縦組用JFMが\LuaTeX-jaには同梱されている.%おり,違いを\autoref{tab-difjfm-tate}に示した. diff --git a/src/ltj-setwidth.lua b/src/ltj-setwidth.lua index 6b163ab..5878595 100644 --- a/src/ltj-setwidth.lua +++ b/src/ltj-setwidth.lua @@ -193,8 +193,14 @@ local function capsule_glyph_tate(p, met, char_data, head, dir) if met.rotation and met.vert_activated then local f = font_getfont(pf) local pco = ltjs_orig_char_table[p] or pc - local r, l = (pco==pc) and met.rotation[pc], f.properties and f.properties.language - if ((r==true) or (type(r)=="table" and not r[l])) and (get_attr(p, attr_vert_ori) or 0)<=0 then + local r = met.rotation[pco] + local l = f.properties and f.properties.language + r = (r==true) or (type(r)=="table" and not r[l]) + if r then + r = met.rotation[pc] + r = (r==true) or (type(r)=="table" and not r[l]) + end + if r and (get_attr(p, attr_vert_ori) or 0)<=0 then return capsule_glyph_tate_rot(p, met, char_data, head, dir, 0.5*(get_ascender(pf)-get_descender(pf))) end -- 2.11.0