XeLaTeX 에서 한글/한자/라틴/숫자 등에 굵은 글자, 기울임 글자 등을 적용하고 싶을 때 아래와 같이 사용해 보자.

% ---------------------------------------------------------------- 
% PDFLaTeX / XeLaTeX with koTeX for Nanum Fonts 
% made by Heesung Shin, ensual@gmail.com
% ---------------------------------------------------------------- 
\usepackage{iftex}

% ---------------------------------------------------------------- 
\ifPDFTeX

\PassOptionsToPackage{no-math}{fontspec}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[finemath, hangul]{kotex}
\usepackage{kotex-logo}

\usepackage{dhucs-nanumfont}    % Nanum 폰트 패키지
% \usepackage{tgtermes}           % TeX Gyre Termes (Times 계열)
% \usepackage{tgheros}            % TeX Gyre Heros (Helvetica 계열)
% \usepackage{tgcursor}           % TeX Gyre Cursor (Courier 계열)
% \usepackage[varqu,varl]{zi4}    % Inconsolata (현대적 코딩 폰트)

\usepackage{silence}
\WarningFilter{latexfont}{Font shape}

\fi

% ---------------------------------------------------------------- 
\ifXeTeX

\usepackage{xltxtra}
\usepackage[T1]{fontenc}

\usepackage[unfonts, hangul]{kotex}
\usepackage{kotex-logo}

\xetexkofontregime{latin}[puncts=prevfont, colons=prevfont, cjksymbols=hangul]

\IfFontExistsTF{TeX Gyre Termes}{\setmainfont{TeX Gyre Termes}}{} 
\IfFontExistsTF{TeX Gyre Heros}{\setsansfont{TeX Gyre Heros}}{}
% \IfFontExistsTF{TeX Gyre Cursor}{\setmonofont{TeX Gyre Cursor}}{}

\defaultfontfeatures+{
Ligatures          = TeX,
ItalicFont         = *,
ItalicFeatures     = {FakeSlant=.17}, 
BoldItalicFeatures = {FakeSlant=.17},
SmallCapsFont      = {UnGungseo},
}

% \IfFontExistsTF{Times New Roman}{\setmainfont{Times New Roman}}{}
% \IfFontExistsTF{Arial}{\setsansfont{Arial}}{}
\IfFontExistsTF{D2Coding}{\setmonofont{D2Coding}}{}

\IfFontExistsTF{NanumMyeongjo}{\setmainhangulfont{NanumMyeongjo}}{}
\IfFontExistsTF{NanumGothic}{\setsanshangulfont{NanumGothic}}{}
\IfFontExistsTF{NanumGothicCoding}{\setmonohangulfont{NanumGothicCoding}}{}

\IfFontExistsTF{UnBatang}{\setmainhanjafont{UnBatang}}{}
\IfFontExistsTF{UnDotum}{\setsanshanjafont{UnDotum}}{}
\IfFontExistsTF{UnTaza}{\setmonohanjafont{UnTaza}}{}

\fi

% ----------------------------------------------------------------

예제

\documentclass[11pt]{article}

% ---------------------------------------------------------------- 
% PDFLaTeX / XeLaTeX with koTeX for Nanum Fonts 
% made by Heesung Shin, ensual@gmail.com
% ---------------------------------------------------------------- 
\usepackage{iftex}

% ---------------------------------------------------------------- 
\ifPDFTeX

\PassOptionsToPackage{no-math}{fontspec}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[finemath, hangul]{kotex}
\usepackage{kotex-logo}

\usepackage{dhucs-nanumfont}    % Nanum 폰트 패키지
% \usepackage{tgtermes}           % TeX Gyre Termes (Times 계열)
% \usepackage{tgheros}            % TeX Gyre Heros (Helvetica 계열)
% \usepackage{tgcursor}           % TeX Gyre Cursor (Courier 계열)
% \usepackage[varqu,varl]{zi4}    % Inconsolata (현대적 코딩 폰트)

\usepackage{silence}
\WarningFilter{latexfont}{Font shape}

\fi

% ---------------------------------------------------------------- 
\ifXeTeX

\usepackage{xltxtra}
\usepackage[T1]{fontenc}

\usepackage[unfonts, hangul]{kotex}
\usepackage{kotex-logo}

\xetexkofontregime{latin}[puncts=prevfont, colons=prevfont, cjksymbols=hangul]

\IfFontExistsTF{TeX Gyre Termes}{\setmainfont{TeX Gyre Termes}}{} 
\IfFontExistsTF{TeX Gyre Heros}{\setsansfont{TeX Gyre Heros}}{}
% \IfFontExistsTF{TeX Gyre Cursor}{\setmonofont{TeX Gyre Cursor}}{}

\defaultfontfeatures+{
Ligatures          = TeX,
ItalicFont         = *,
ItalicFeatures     = {FakeSlant=.17}, 
BoldItalicFeatures = {FakeSlant=.17},
SmallCapsFont      = {UnGungseo},
}

% \IfFontExistsTF{Times New Roman}{\setmainfont{Times New Roman}}{}
% \IfFontExistsTF{Arial}{\setsansfont{Arial}}{}
\IfFontExistsTF{D2Coding}{\setmonofont{D2Coding}}{}

\IfFontExistsTF{NanumMyeongjo}{\setmainhangulfont{NanumMyeongjo}}{}
\IfFontExistsTF{NanumGothic}{\setsanshangulfont{NanumGothic}}{}
\IfFontExistsTF{NanumGothicCoding}{\setmonohangulfont{NanumGothicCoding}}{}

\IfFontExistsTF{UnBatang}{\setmainhanjafont{UnBatang}}{}
\IfFontExistsTF{UnDotum}{\setsanshanjafont{UnDotum}}{}
\IfFontExistsTF{UnTaza}{\setmonohanjafont{UnTaza}}{}

\fi

% ----------------------------------------------------------------
\def\example{한글 漢字 English 0123 ``---'' \koTeX \ 0O 1ijlI!?}

\def\show{%
\begin{tabular}{ll}
\textmd{Regular.}               & \textmd{\example}          \\ 
\textmd{\textit{Italic.}}       & \textmd{\textit{\example}} \\
\textmd{\textsl{Slanted.}}      & \textmd{\textsl{\example}} \\
\textbf{Bold.}                  & \textbf{\example}          \\
\textbf{\textit{Bold Italic.}}  & \textbf{\textit{\example}} \\
\textbf{\textsl{Bold Slanted.}} & \textbf{\textsl{\example}} \\
\textsc{Small Caps.}            & \textsc{\example}          \\ 
\end{tabular}
}

\begin{document}

\section*{\textrm{Serif 명조}}
\rmfamily
\show

\section*{\textsf{Sanserif 고딕}}
\sffamily
\show

\section*{\texttt{Sanserif Mono 고정폭}}
\ttfamily
\show

\end{document}
PDFLaTeX

XeLaTeX

 

AND