summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-08-07 21:47:05 +0000
committerKarl Berry <karl@freefriends.org>2014-08-07 21:47:05 +0000
commitd6158a3c4bae59f230a930d040c88f709a8154ee (patch)
tree0bf994ee1e94e7d46dec59a98136188000e6e956 /Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty
parentdc9e42687472cf7aec8823cdc0eb95d03e6da5d2 (diff)
xetexko (7aug14)
git-svn-id: svn://tug.org/texlive/trunk@34864 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty')
-rw-r--r--Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty86
1 files changed, 71 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty
index 1bc55c448c7..0e12c811e06 100644
--- a/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty
+++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty
@@ -10,7 +10,7 @@
% and version 1.3c or later is part of all distributions of LaTeX
% version 2006/05/20 or later.
-\ProvidesPackage{xetexko-font}[2014/07/27 v2.8 LaTeX Font commands for XeTeX-ko]
+\ProvidesPackage{xetexko-font}[2014/08/04 v2.9 LaTeX Font commands for XeTeX-ko]
\let\xetexko@f@size\f@size
\RequirePackage{fontspec}[2014/05/25]
@@ -28,7 +28,6 @@
\tl_set:Nn \l_xtxko_font_opts_init_tl
{
\tl_clear:N \xetexkointerhchar
- \tl_clear:N \xetexkointerhchar
\tl_clear:N \xetexkolowerexclamation
\tl_clear:N \xetexkolowerperiod
\tl_clear:N \xetexkolowercomma
@@ -423,17 +422,6 @@
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%
-% for lazy font setting
-\AtBeginDocument{%
- \ifdefined\kormainfont\else \let\kormainfont\relax \fi
- \ifdefined\korsansfont\else \let\korsansfont\kormainfont \fi
- \ifdefined\kormonofont\else \let\kormonofont\korsansfont \fi
- \ifdefined\hnjmainfont\else \let\hnjmainfont\kormainfont \fi
- \ifdefined\hnjsansfont\else \let\hnjsansfont\korsansfont \fi
- \ifdefined\hnjmonofont\else \let\hnjmonofont\kormonofont \fi
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%
% font switching for latex
\def\XKstoreprevfont{%
\ifx\f@family\XKcjkprevfont\let\f@family\XKltnprevfont\fi
@@ -515,9 +503,77 @@
\fi\fi
\let\reset@font\normalfont
-%%%%%%%%%%%%%%%%%%%%%
-% hangul in math mode
+% for default font loading
+\def\XKiffontisaccessible#1#2#3{%
+ \begingroup
+ \suppressfontnotfounderror\@ne
+ \font\x="#1" at 10pt
+ \expandafter
+ \endgroup
+ \ifx\x\nullfont #3\else #2\fi
+}
+\def\XKiffonthasunichar#1#2#3#4{%
+ \begingroup #1\expandafter\endgroup
+ \iffontchar\font"#2\relax #3\else #4\fi
+}
+
\AtBeginDocument{%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%
+ % default main hangul: nanummyeongjo, batang if absent
+ \ifdefined\kormainfont\else
+ \XKiffonthasunichar{\fontfamily\rmdefault\selectfont}{AC00}
+ {\let\kormainfont\relax}
+ {\XKiffontisaccessible{NanumMyeongjoExtraBold}
+ {\setmainhangulfont{NanumMyeongjo}[BoldFont=*ExtraBold]}
+ {\XKiffontisaccessible{NanumMyeongjo}
+ {\setmainhangulfont{NanumMyeongjo}}
+ {\XKiffontisaccessible{Batang}
+ {\setmainhangulfont{Batang}[AutoFakeBold]}
+ {\let\kormainfont\relax}%
+ }%
+ }%
+ }%
+ \fi
+ % default main hanja: nanumgothic, batang if absent
+ \ifdefined\hnjmainfont\else
+ \XKiffonthasunichar{\kormainfont}{4E00}
+ {\let\hnjmainfont\kormainfont}
+ {\XKiffontisaccessible{NanumGothic}
+ {\setmainhanjafont{NanumGothic}}
+ {\XKiffontisaccessible{Batang}
+ {\setmainhanjafont{Batang}[AutoFakeBold]}
+ {\let\hnjmainfont\kormainfont}%
+ }%
+ }%
+ \fi
+ % default sans hangul: nanumgothic, dotum if absent
+ \ifdefined\korsansfont\else
+ \XKiffonthasunichar{\fontfamily\sfdefault\selectfont}{AC00}
+ {\let\korsansfont\relax}
+ {\XKiffontisaccessible{NanumGothic}
+ {\setsanshangulfont{NanumGothic}}
+ {\XKiffontisaccessible{Dotum}
+ {\setsanshangulfont{Dotum}[AutoFakeBold]}
+ {\let\korsansfont\relax}%
+ }%
+ }%
+ \fi
+ % default sans hanja: nanumgothic, dotum if absent
+ \ifdefined\hnjsansfont\else
+ \XKiffonthasunichar{\korsansfont}{4E00}
+ {\let\hnjsansfont\korsansfont}
+ {\XKiffontisaccessible{NanumGothic}
+ {\setsanshanjafont{NanumGothic}}
+ {\XKiffontisaccessible{Dotum}
+ {\setsanshanjafont{Dotum}[AutoFakeBold]}
+ {\let\hnjsansfont\korsansfont}%
+ }%
+ }%
+ \fi
+ \ifdefined\kormonofont\else \let\kormonofont\korsansfont \fi
+ \ifdefined\hnjmonofont\else \let\hnjmonofont\kormonofont \fi
+ %%%%%%%%%%%%%%%%%%%%%
+ % hangul in math mode
\begingroup
\ifx\xetexko@math@hangul@family\undefined
\edef\@tempb{\sfdefault}\edef\@tempc{\ttdefault}%