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

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

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

\ifPDFTeX
\usepackage[finemath]{kotex}
%\usepackage{times}
\usepackage{dhucs-nanumfont}
\fi

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

\defaultfontfeatures+{
BoldFeatures={FakeBold=2}, 
ItalicFeatures={FakeSlant=0.17}, 
SlantedFeatures={FakeSlant=0.17}, 
BoldItalicFeatures={FakeBold=2,FakeSlant=0.17}, 
BoldSlantedFeatures={FakeBold=2,FakeSlant=0.17},
}

%\setmainfont{Times New Roman}
\setmainhangulfont{NanumMyeongjo}
\setsanshangulfont{NanumGothic}
\setmonohangulfont{NanumGothicCoding}
\fi

예제

\documentclass[12pt]{article}

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

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

\ifPDFTeX
\usepackage[finemath]{kotex}
\usepackage{dhucs-nanumfont}
\fi

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

\defaultfontfeatures+{
BoldFeatures={FakeBold=2}, 
ItalicFeatures={FakeSlant=.17}, 
SlantedFeatures={FakeSlant=.17}, 
BoldItalicFeatures={FakeBold=2,FakeSlant=.17}, 
BoldSlantedFeatures={FakeBold=2,FakeSlant=.17},
}

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

\begin{document}

\rmfamily
\mdseries 가나다 Abc 123 \textit{가나다 Abc 123} \textsc{가나다 Abc 123 \textit{가나다 Abc 123}}

\bfseries 가나다 Abc 123 \textit{가나다 Abc 123} \textsc{가나다 Abc 123 \textit{가나다 Abc 123}}

\sffamily
\mdseries 가나다 Abc 123 \textit{가나다 Abc 123} \textsc{가나다 Abc 123 \textit{가나다 Abc 123}}

\bfseries 가나다 Abc 123 \textit{가나다 Abc 123} \textsc{가나다 Abc 123 \textit{가나다 Abc 123}}

\ttfamily
\mdseries 가나다 Abc 123 \textit{가나다 Abc 123} \textsc{가나다 Abc 123 \textit{가나다 Abc 123}}

\bfseries 가나다 Abc 123 \textit{가나다 Abc 123} \textsc{가나다 Abc 123 \textit{가나다 Abc 123}}

\end{document}

PDFLaTeX

XeLaTeX

 

+ Recent posts