Skip to content

Instantly share code, notes, and snippets.

@h-kitagawa
Created April 4, 2020 03:18
Show Gist options
  • Save h-kitagawa/7e00d686de89ff26eb81c7607fd5c772 to your computer and use it in GitHub Desktop.
Save h-kitagawa/7e00d686de89ff26eb81c7607fd5c772 to your computer and use it in GitHub Desktop.
HaranoAji{Mincho,Gothic}.fontspec の実験
\documentclass{minimal}
\usepackage{luatexja-fontspec}
%\setsansjfont{HaranoAjiGothic-Medium} 単ウェイト
%\setsansjfont{HaranoAjiGothic} % 複数ウェイト
\setsansjfont[UprightFont=*-Medium]{HaranoAjiGothic}% 複数ウェイト, m->Medium
\setmainjfont{HaranoAjiMincho} % 複数ウェイト
\makeatletter
\def\testA#1{#1\selectfont[\f@series/\k@series]abcあいう}
\def\test#1{%
\rmfamily
\textup{\testA{#1}}\
\textit{\testA{#1}}\
\textsl{\testA{#1}}\
\textgt{\testA{#1}}\
\par}
\begin{document}
\test{\fontseries{l}}
\test{\mdseries}
\test{\bfseries}
\test{\fontseries{eb}}
% ↓ mincho extrabold is substituted by mincho medium (not bold)
\fontseries{eb}\testA{}\textgt{\testA{}}
% ↓ gothic light is substituted by gothic medium
\fontseries{l}\testA{}\textgt{\testA{}}
\end{document}
\defaultfontfeatures[HaranoAjiGothic]
{
Extension = .otf,
UprightFont = *-Regular,
BoldFont = *-Bold,
%%FontFace = {l}{\shapedefault}{ *-Light },
FontFace = {eb}{\shapedefault}{ *-Heavy }
}
\defaultfontfeatures[HaranoAjiMincho]
{
Extension = .otf,
UprightFont = *-Regular,
BoldFont = *-Bold,
FontFace = {l}{\shapedefault}{ Font=*-Light },
%%FontFace = {eb}{\shapedefault}{ *-Heavy },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment