Forums: 公開討議/質問 (Thread #42059)

luatexja-presetの更新の影響? (2020-03-22 12:52 by ぐっち #84598)

2019年5月の末頃(「\setmonojfontの定義 2019-05-14」のスレッド)は簡単に源ノ○フォントで多フェイス化できて喜んでいたのですが,先日ふとTeX Liveを最新(2019 frozen)にしてみたら,思ったように行かなくなっていました。
厳密に動作するように修正を進めているのが波及してきたのかなと想像していますが,どう対処したら簡単な多フェイス化できそうでしょうか。


後のソースのようにすると(丸ゴシック和文に源柔ゴシック,丸ゴシック英文にNunitoを指定)
2019年5月末頃
明朝細〜明朝極太,ゴシック細〜ゴシック極太,丸ゴシック細〜丸ゴシック極太と揃えられた

2019frozenにしてみたら
明朝・ゴシック・丸ゴシックの標準・太,明朝・ゴシック・丸ゴシック(細を除く)の英文のイタリック(slantはitの置換え)全ては希望通り。
細・極太が(英文イタ)以外効かなくなった

文章のソースは以下のような感じです。


\documentclass[a4paper]{ltjsarticle}
\usepackage[match, deluxe, sourcehan]{luatexja-preset} %ltseriesなど定義に必要?

\setmainjfont{SourceHanSerifJP}[
FontFace = {l}{\updefault}{* Light},
UprightFont = {* Regular}, % for \mdseries
BoldFont = {* Bold}, % for \bfseries
FontFace = {eb}{\updefault}{* Heavy},
]
\setsansjfont{SourceHanSansJP}[
(内容は上と同じなので略)
]
\setmonofont{SourceHanCodeJP}[ %これを入れないとtextttがうまく行かなかった?
FontFace = {l}{\updefault}{* Light},
UprightFont = {* Regular}, % for \mdseries
BoldFont = {* Bold}, % for \bfseries
FontFace = {eb}{\updefault}{* Heavy},
FontFace = {l}{it}{* LightIt},
ItalicFont = {* RegularIt},
BoldItalicFont = {* BoldIt},
FontFace = {eb}{it}{* HeavyIt},
]
\setmonojfont{SourceHanCodeJP}[
(内容はsetmainjfontと同じなので略)
]
\setjfontfamily \mgfamily [
(内容はsetmainjfontと同じなので略)
]{GenJyuuGothic}
\newfontfamily \mrgfamily [
FontFace = {l}{\updefault}{Nunito-Light},
UprightFont = {Nunito-Regular}, % for \mdseries
BoldFont = {Nunito-Bold}, % for \bfseries
FontFace = {eb}{\updefault}{Nunito-Black},
FontFace = {l}{it}{Nunito-LightItalic},
ItalicFont = {Nunito-Italic},
BoldItalicFont = {Nunito-BoldItalic},
FontFace = {eb}{it}{Nunito-BlackItalic},
]{Nunito}
\renewcommand\textmg{\mrgfamily \mgfamily} %厳密にはこれだとダメ?

\begin{document}
{ \rmfamily 明朝\\
\ltseries 細明朝\\
test 012 test 012 てすと\\
\textrm{rm test 012 test 012 てすと}\\
\textsf{sf test 012 test 012 てすと}\\
\texttt{tt test 012 test 012 てすと}\\
\textbf{bf test 012 test 012 てすと}\\
\textit{it test 012 test 012 てすと}\\
\textsl{sl test 012 test 012 てすと}\\

\mdseries 明朝
(上と同じなので略)

\bfseries 太明朝
(上と同じなので略)

\ebseries 極太明朝
(上と同じなので略)
}

{ \sffamily ゴシック\\
\ltseries 細ゴシック\\
(上の明朝と同じことを記述なので略)
}

{ \textmg 丸ゴシック\\ %\mgfamily \mrgfamily
\ltseries 細丸ゴシック\\
(上の明朝と同じことを記述なので略)
}

\end{document}

Reply to #84598×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: luatexja-presetの更新の影響? (2020-03-22 14:54 by h7k #84599)

> 2019frozenにしてみたら
> 明朝・ゴシック・丸ゴシックの標準・太,明朝・ゴシック・丸ゴシック(細を除く)の英文のイタリック(slantはitの置換え)全ては希望通り。
> 細・極太が(英文イタ)以外効かなくなった
>

2019 frozen では LaTeX 2020-02-02 における大規模な NFSS 改修が入っており,
\updefault が n ではなく up に変更されています.
\updefault を全部 \shapedefault にしてみるとどうでしょうか?

また,「和文フォントを全部再定義してしまうのに \ltseries などのためだけに luatexja-preset を呼ぶ」のは得策ではなく,プリアンブルに

\makeatletter %%%
\def\ltdefault{l}
\DeclareRobustCommand\ltseries {\not@math@alphabet\ltseries\relax\fontseries\ltdefault\selectfont}
\def\ebdefault{eb}
\DeclareRobustCommand\ebseries{\not@math@alphabet\ebseries\relax\fontseries\ebdefault\selectfont}
\DeclareTextFontCommand{\textmg}{\mgfamily}
\makeatother %%%

と,luatexja-preset から該当部分をコピーしただけの方がよいです.
Reply to #84598

Reply to #84599×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: luatexja-presetの更新の影響? (2020-03-22 17:12 by ぐっち #84600)

早速の返信ありがとうございます。

> \updefault を全部 \shapedefault にしてみるとどうでしょうか?

これで解決しました。

> また,「和文フォントを全部再定義してしまうのに \ltseries などのためだけに luatexja-preset を呼ぶ」のは得策ではなく,プリアンブルに
>
> \makeatletter %%%
> \def\ltdefault{l}
> \DeclareRobustCommand\ltseries {\not@math@alphabet\ltseries\relax\fontseries\ltdefault\selectfont}
> \def\ebdefault{eb}
> \DeclareRobustCommand\ebseries{\not@math@alphabet\ebseries\relax\fontseries\ebdefault\selectfont}
> \DeclareTextFontCommand{\textmg}{\mgfamily}
> \makeatother %%%
>
> と,luatexja-preset から該当部分をコピーしただけの方がよいです.

\usepackage[match,deluxe]{luatexja-fontspec}
の後に上の\makeatletter以下を入れて,引き続き
\setmainfont,\setmainjfont,\setsansfont,\setsnasjfont,
\setmonofont,\setmonojfont,丸ゴシック関係のフォント設定をすることで
細〜極太まで出るようになりました。
Reply to #84599

Reply to #84600×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login