texjporg / japanese-otf-mirror

Unofficial mirror of japanese-otf(-uptex) and hiraprop
Other
4 stars 1 forks source link

Relation font: Computer Modern -> Latin Modern when loading lmodern package #10

Open munepi opened 5 years ago

munepi commented 5 years ago

lmodern パッケージが読み込まれていたら、和文書体の従属欧文書体をLatin Modernに置き換えたらどうかというPRです。

独り言:ただ…、実用上では、おそらくこれでは不十分で、 \ltseries, \ebseries を考慮していないですね。場当たり的にやると、下記のように上書きしちゃう手もあるかもです。

\RequirePackage{lmodern}
\input t1lmr.fd
\input t1lmss.fd
\DeclareFontShape{T1}{lmr}{l}{n}{<->sub*lmr/m/n}{}
\DeclareFontShape{T1}{lmss}{eb}{n}{<->sub*lmss/bx/n}{}

\RequirePackage[deluxe,jis2004]{otf}
\DeclareRobustCommand\ltseries{\not@math@alphabet\ltseries\relax
  \romanseries\ltdefault\kanjiseries\ltdefault\selectfont}
\DeclareRobustCommand\ebseries{\not@math@alphabet\ebseries\relax
  \romanseries\ebdefault\kanjiseries\ebdefault\selectfont}
\DeclareRobustCommand\mgfamily{\not@math@alphabet\mgfamily\mathmg\relax
  \romanfamily\sfdefault\kanjifamily\mgdefault\selectfont}
\DeclareRobustCommand\textmc[1]{%
    \relax\ifmmode \expandafter\nfss@text \fi{\mcfamily #1}}
\DeclareRobustCommand\textgt[1]{%
    \relax\ifmmode \expandafter\nfss@text \fi{\gtfamily\sffamily #1}}
\DeclareTextFontCommand{\textlt}{\mcfamily\ltseries}%%<- otfパッケージ利用のみ前提で、mc以外を考慮していない
\DeclareTextFontCommand{\texteb}{\gtfamily\sffamily\ebseries}%%<- otfパッケージ利用のみ前提で、gt以外を考慮していない
\DeclareRelationFont{\otf@JYn}{hmc}{l}{}{\otf@OTorT1}{lmr}{l}{}
\DeclareRelationFont{\otf@JTn}{hmc}{l}{}{\otf@OTorT1}{lmr}{l}{}
\DeclareRelationFont{\otf@JYn}{hmc}{m}{}{\otf@OTorT1}{lmr}{m}{}
\DeclareRelationFont{\otf@JTn}{hmc}{m}{}{\otf@OTorT1}{lmr}{m}{}
\DeclareRelationFont{\otf@JYn}{hmc}{bx}{}{\otf@OTorT1}{lmr}{bx}{}
\DeclareRelationFont{\otf@JTn}{hmc}{bx}{}{\otf@OTorT1}{lmr}{bx}{}
\DeclareRelationFont{\otf@JYn}{hgt}{m}{}{\otf@OTorT1}{lmss}{m}{}
\DeclareRelationFont{\otf@JTn}{hgt}{m}{}{\otf@OTorT1}{lmss}{m}{}
\DeclareRelationFont{\otf@JYn}{hgt}{bx}{}{\otf@OTorT1}{lmss}{bx}{}
\DeclareRelationFont{\otf@JTn}{hgt}{bx}{}{\otf@OTorT1}{lmss}{bx}{}
\DeclareRelationFont{\otf@JYn}{hgt}{eb}{}{\otf@OTorT1}{lmss}{bx}{}
\DeclareRelationFont{\otf@JTn}{hgt}{eb}{}{\otf@OTorT1}{lmss}{bx}{}
\DeclareRelationFont{\otf@JYn}{mg}{m}{}{\otf@OTorT1}{lmss}{m}{}
\DeclareRelationFont{\otf@JTn}{mg}{m}{}{\otf@OTorT1}{lmss}{m}{}