diff options
author | Karl Berry <karl@freefriends.org> | 2014-05-13 22:10:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-05-13 22:10:13 +0000 |
commit | 965a87a0387a9b227aca0cf47913062116a7d735 (patch) | |
tree | c6397cb81089a980f530226d090b049ffa660173 /Master/texmf-dist/tex | |
parent | 96ae66c3ffba17421aa8dafe928f185b0b23e372 (diff) |
xetexko (13may14)
git-svn-id: svn://tug.org/texlive/trunk@34013 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
6 files changed, 335 insertions, 331 deletions
diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty index e61331944e8..a959de576e4 100644 --- a/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty +++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko-font.sty @@ -10,264 +10,309 @@ % and version 1.3c or later is part of all distributions of LaTeX % version 2006/05/20 or later. -\ProvidesPackage{xetexko-font}[2014/03/28 v2.5 Font commands for XeTeX-ko] +\ProvidesPackage{xetexko-font}[2014/05/11 v2.6 Font commands for XeTeX-ko] \let\xetexko@f@size\f@size \RequirePackage{fontspec} \let\f@size\xetexko@f@size -\RequirePackage{xkeyval} %%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% for old hangul rendering -\ExplSyntaxOn -\fontspec_define_font_feature:n {YetHangul} -\keys_define:nn {fontspec} - { - YetHangul .default:n = {On} , - YetHangul / On .code:n = { - \fontspec_update_fontid:n {yethangul:on} - \fontspec_update_featstr:n {script=hang} - } , - YetHangul / Off .code:n = { - \fontspec_update_fontid:n {yethangul:off} - \fontspec_update_featstr:n {-ljmo;-vjmo;-tjmo} - } - } -\ExplSyntaxOff +\newfontfeature{YetHangul}{script=hang} +\ExplSyntaxOn %%%%%%%%%%%%%%%%%%%%% % hangul font options -\newtoks\XK@font@options\XK@font@options{} -\define@key[xtxko]{font}{hu}{\addto@hook\XK@font@options{\def\xetexkohu{#1}}} -\define@key[xtxko]{font}{interhchar}{\addto@hook\XK@font@options{\def\xetexkointerhchar{#1}}} -\define@key[xtxko]{font}{lowerexclamation}{\addto@hook\XK@font@options{\def\xetexkolowerexclamation{#1}}} -\define@key[xtxko]{font}{lowerperiod}{\addto@hook\XK@font@options{\def\xetexkolowerperiod{#1}}} -\define@key[xtxko]{font}{lowerquestion}{\addto@hook\XK@font@options{\def\xetexkolowerquestion{#1}}} -\define@key[xtxko]{font}{lowercomma}{\addto@hook\XK@font@options{\def\xetexkolowercomma{#1}}} -\define@key[xtxko]{font}{postexclamationkern}{\addto@hook\XK@font@options{\def\xetexkopostexclamationkern{#1}}} -\define@key[xtxko]{font}{postmathskip}{\addto@hook\XK@font@options{\def\xetexkopostmathskip{#1}}} -\define@key[xtxko]{font}{postperiodkern}{\addto@hook\XK@font@options{\def\xetexkopostperiodkern{#1}}} -\define@key[xtxko]{font}{postquestionkern}{\addto@hook\XK@font@options{\def\xetexkopostquestionkern{#1}}} -\define@key[xtxko]{font}{postcommakern}{\addto@hook\XK@font@options{\def\xetexkopostcommakern{#1}}} -\define@key[xtxko]{font}{preexclamationkern}{\addto@hook\XK@font@options{\def\xetexkopreexclamationkern{#1}}} -\define@key[xtxko]{font}{preperiodkern}{\addto@hook\XK@font@options{\def\xetexkopreperiodkern{#1}}} -\define@key[xtxko]{font}{prequestionkern}{\addto@hook\XK@font@options{\def\xetexkoprequestionkern{#1}}} -\define@key[xtxko]{font}{precommakern}{\addto@hook\XK@font@options{\def\xetexkoprecommakern{#1}}} -\define@key[xtxko]{font}{quoteraise}{\addto@hook\XK@font@options{\def\xetexkoquoteraise{#1}}} -\define@key[xtxko]{font}{quotewidth}{\addto@hook\XK@font@options{\def\xetexkoquotewidth{#1}}} -\define@key[xtxko]{font}{charraise}{\addto@hook\XK@font@options{\def\xetexkocharraise{#1}}} - -\presetkeys[xtxko]{font}{ - hu=0.06em, - interhchar={}, - lowerexclamation={}, - lowerperiod={}, - lowercomma={}, - lowerquestion={}, - postexclamationkern={}, - postmathskip=\dimexpr\xetexkohu*\tw@\relax, - postperiodkern={}, - postcommakern={}, - postquestionkern={}, - preexclamationkern={}, - preperiodkern={}, - precommakern={}, - prequestionkern={}, - quoteraise={}, - quotewidth={}, - charraise={} -}{} - +\tl_new:N \l_xtxko_font_opts_tl +\tl_new:N \l_xtxko_font_opts_init_tl +\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 + \tl_clear:N \xetexkolowerquestion + \tl_clear:N \xetexkopostexclamationkern + \tl_clear:N \xetexkopostperiodkern + \tl_clear:N \xetexkopostcommakern + \tl_clear:N \xetexkopostquestionkern + \tl_clear:N \xetexkopreexclamationkern + \tl_clear:N \xetexkopreperiodkern + \tl_clear:N \xetexkoprecommakern + \tl_clear:N \xetexkoprequestionkern + \tl_clear:N \xetexkoquoteraise + \tl_clear:N \xetexkoquotewidth + \tl_clear:N \xetexkocharraise + \tl_set:Nn \xetexkohu {0.06em} + \tl_set:Nn \xetexkopostmathskip {\dim_eval:n {\xetexkohu*2}} + } +\cs_new:Nn \__xtxko_add_font_opt:Nn + { + \tl_put_right:Nn \l_xtxko_font_opts_tl { \tl_set:Nn #1 {#2} } + } +\keys_define:nn { xtxko-font } + { + hu .code:n = + { \__xtxko_add_font_opt:Nn \xetexkohu {#1} } , + interhchar .code:n = + { \__xtxko_add_font_opt:Nn \xetexkointerhchar {#1} } , + lowerexclamation .code:n = + { \__xtxko_add_font_opt:Nn \xetexkolowerexclamation {#1} } , + lowerperiod .code:n = + { \__xtxko_add_font_opt:Nn \xetexkolowerperiod {#1} } , + lowercomma .code:n = + { \__xtxko_add_font_opt:Nn \xetexkolowercomma {#1} } , + lowerquestion .code:n = + { \__xtxko_add_font_opt:Nn \xetexkolowerquestion {#1} } , + postexclamationkern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopostexclamationkern {#1} } , + postmathskip .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopostmathskip {#1} } , + postperiodkern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopostperiodkern {#1} } , + postcommakern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopostcommakern {#1} } , + postquestionkern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopostquestionkern {#1} } , + preexclamationkern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopreexclamationkern {#1} } , + preperiodkern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkopreperiodkern {#1} } , + precommakern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkoprecommakern {#1} } , + prequestionkern .code:n = + { \__xtxko_add_font_opt:Nn \xetexkoprequestionkern {#1} } , + quoteraise .code:n = + { \__xtxko_add_font_opt:Nn \xetexkoquoteraise {#1} } , + quotewidth .code:n = + { \__xtxko_add_font_opt:Nn \xetexkoquotewidth {#1} } , + charraise .code:n = + { \__xtxko_add_font_opt:Nn \xetexkocharraise {#1} } , + InterLatinCJK .code:n = + { \keys_set:nn { xtxko-font } { hu = {#1} } } , + InterHangul .code:n = + { \keys_set:nn { xtxko-font } { interhchar = {#1} } } , + PunctRaise .code:n = + { \keys_set:nn { xtxko-font } { lowerperiod = { \dim_eval:n {-#1} } } } , + CharRaise .code:n = + { \keys_set:nn { xtxko-font } { charraise = {#1} } } , + } +\tl_new:N \l_xtxko_rem_tl +\cs_new:Nn \__xtxko_assign_font_opts:Nn + { + \tl_set_eq:NN \l_xtxko_font_opts_tl \l_xtxko_font_opts_init_tl + \keys_set_known:nxN { xtxko-font } {#2} \l_xtxko_rem_tl + \tl_set_eq:NN #1 \l_xtxko_font_opts_tl + } +\cs_generate_variant:Nn \__xtxko_assign_font_opts:Nn { c } %%%%%%%%%%%%%%%%%%%% % user font commands -\protected\def\setmainhangulfont - {\@ifnextchar[\@setmainhangulfont{\@setmainhangulfont[]}} -\def\@setmainhangulfont[#1]{% - \def\kormainfont{\XK@main@hangul@font\XK@main@hangul@options}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \edef\XK@main@hangul@options{\the\XK@font@options}% - \expandafter\newfontfamily\expandafter\XK@main@hangul@font\expandafter[\XKV@rm]} - -\protected\def\setsanshangulfont - {\@ifnextchar[\@setsanshangulfont{\@setsanshangulfont[]}} -\def\@setsanshangulfont[#1]{% - \def\korsansfont{\XK@sans@hangul@font\XK@sans@hangul@options}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \edef\XK@sans@hangul@options{\the\XK@font@options}% - \expandafter\newfontfamily\expandafter\XK@sans@hangul@font\expandafter[\XKV@rm]} - -\protected\def\setmonohangulfont{\newfontfamily\kormonofont} - -\protected\def\setmainhanjafont - {\@ifnextchar[\@setmainhanjafont{\@setmainhanjafont[]}} -\def\@setmainhanjafont[#1]{% - \def\hnjmainfont{\XK@main@hanja@font\XK@main@hanja@options}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \edef\XK@main@hanja@options{\the\XK@font@options}% - \expandafter\newfontfamily\expandafter\XK@main@hanja@font\expandafter[\XKV@rm]} - -\protected\def\setsanshanjafont - {\@ifnextchar[\@setsanshanjafont{\@setsanshanjafont[]}} -\def\@setsanshanjafont[#1]{% - \def\hnjsansfont{\XK@sans@hanja@font\XK@sans@hanja@options}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \edef\XK@sans@hanja@options{\the\XK@font@options}% - \expandafter\newfontfamily\expandafter\XK@sans@hanja@font\expandafter[\XKV@rm]} - -\protected\def\setmonohanjafont {\newfontfamily\hnjmonofont} - -% adhochangulfont/adhochanjafont, hangulfontspec/hanjafontspec -\protected\def\adhochangulfont{\@ifnextchar[\@adhochangulfont{\@adhochangulfont[]}} -\def\@adhochangulfont[#1]{% - \def\XKhangulfont{% - \XK@storeltnfont\chardef\XKcurrentfont\@ne - \XK@adhoc@hangul@font\XK@adhoc@hangul@options - \XK@storecjkfont - }% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \edef\XK@adhoc@hangul@options{\the\XK@font@options}% - \expandafter\newfontfamily\expandafter\XK@adhoc@hangul@font\expandafter[\XKV@rm]} -\let\hangulfontspec\adhochangulfont - -\protected\def\adhochanjafont{\@ifnextchar[\@adhochanjafont{\@adhochanjafont[]}} -\def\@adhochanjafont[#1]{% - \def\XKhanjafont{% - \XK@storeltnfont\chardef\XKcurrentfont\tw@ - \XK@adhoc@hanja@font\XK@adhoc@hanja@options - \XK@storecjkfont - }% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \edef\XK@adhoc@hanja@options{\the\XK@font@options}% - \expandafter\newfontfamily\expandafter\XK@adhoc@hanja@font\expandafter[\XKV@rm]} -\let\hanjafontspec\adhochanjafont - -% newhangulfontfamily/newhanjafontfamily -\def\XK@newfont@family{XK@newfont@family} -\def\XK@newfont@options{XK@newfont@options} - -\protected\def\newhangulfontfamily#1{% - \@ifnextchar[{\@newhangulfontfamily#1}{\@newhangulfontfamily#1[]}} -\def\@newhangulfontfamily#1[#2]{% - \protected\def#1{\def\XKhangulfont{% - \XK@storeltnfont\chardef\XKcurrentfont\@ne - \csname\XK@newfont@family \string#1\endcsname - \csname\XK@newfont@options\string#1\endcsname - \XK@storecjkfont - }}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#2}% - \expandafter\edef\csname\XK@newfont@options\string#1\endcsname - {\the\XK@font@options}% - \expandafter\expandafter\expandafter\newfontfamily\expandafter - \csname\expandafter\XK@newfont@family\expandafter - \string\expandafter#1\expandafter\endcsname\expandafter[\XKV@rm]} - -\protected\def\newhanjafontfamily#1{% - \@ifnextchar[{\@newhanjafontfamily#1}{\@newhanjafontfamily#1[]}} -\def\@newhanjafontfamily#1[#2]{% - \protected\def#1{\def\XKhanjafont{% - \XK@storeltnfont\chardef\XKcurrentfont\tw@ - \csname\XK@newfont@family\string#1\endcsname - \csname\XK@newfont@options\string#1\endcsname - \XK@storecjkfont - }}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#2}% - \expandafter\edef\csname\XK@newfont@options\string#1\endcsname - {\the\XK@font@options}% - \expandafter\expandafter\expandafter\newfontfamily\expandafter - \csname\expandafter\XK@newfont@family\expandafter - \string\expandafter#1\expandafter\endcsname\expandafter[\XKV@rm]} - -% newhangulfontface/newhanjafontface -\protected\def\newhangulfontface#1{% - \@ifnextchar[{\@newhangulfontface#1}{\@newhangulfontface#1[]}} -\def\@newhangulfontface#1[#2]{% - \protected\def#1{\def\XKhangulfont{% - \XK@storeltnfont\chardef\XKcurrentfont\@ne - \csname\XK@newfont@family\string#1\endcsname - \csname\XK@newfont@options\string#1\endcsname - \XK@storecjkfont - }}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#2}% - \expandafter\edef\csname\XK@newfont@options\string#1\endcsname - {\the\XK@font@options}% - \expandafter\expandafter\expandafter\newfontface\expandafter - \csname\expandafter\XK@newfont@family\expandafter - \string\expandafter#1\expandafter\endcsname\expandafter[\XKV@rm]} - -\protected\def\newhanjafontface#1{% - \@ifnextchar[{\@newhanjafontface#1}{\@newhanjafontface#1[]}} -\def\@newhanjafontface#1[#2]{% - \protected\def#1{\def\XKhanjafont{% - \XK@storeltnfont - \chardef\XKcurrentfont\tw@ - \csname\XK@newfont@family\string#1\endcsname - \csname\XK@newfont@options\string#1\endcsname - \XK@storecjkfont - }}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#2}% - \expandafter\edef\csname\XK@newfont@options\string#1\endcsname - {\the\XK@font@options}% - \expandafter\expandafter\expandafter\newfontface\expandafter - \csname\expandafter\XK@newfont@family\expandafter - \string\expandafter#1\expandafter\endcsname\expandafter[\XKV@rm]} - -% addhangulfontfeature/addhanjafontfeature -\protected\def\addhangulfontfeature#1{% - \begingroup - \XKhangulfont - \unpresetkeys[xtxko]{font}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \global\toks@\expandafter{\the\XK@font@options}% - \addfontfeature{\XKV@rm}% - \global\let\XK@curr@family\f@family - \endgroup - \edef\XKhangulfont{\unexpanded\expandafter{\XKhangulfont\fontfamily}{\XK@curr@family}% - \noexpand\selectfont\the\toks@}% -} -\let\addhangulfontfeatures\addhangulfontfeature - -\protected\def\addhanjafontfeature#1{% - \begingroup - \XKhanjafont - \unpresetkeys[xtxko]{font}% - \XK@font@options{}% - \setkeys*[xtxko]{font}{#1}% - \global\toks@\expandafter{\the\XK@font@options}% - \addfontfeature{\XKV@rm}% - \global\let\XK@curr@family\f@family - \endgroup - \edef\XKhanjafont{\unexpanded\expandafter{\XKhanjafont\fontfamily}{\XK@curr@family}% - \noexpand\selectfont\the\toks@}% -} -\let\addhanjafontfeatures\addhanjafontfeature - +\DeclareDocumentCommand \setmainhangulfont { O{} m } + { + \__xtxko_assign_font_opts:Nn \XK@main@hangul@options {#1} + \newfontfamily \XK@main@hangul@font [\l_xtxko_rem_tl] {#2} + \tl_set:Nn \kormainfont {\XK@main@hangul@font \XK@main@hangul@options} + \ignorespaces + } +\DeclareDocumentCommand \setsanshangulfont { O{} m } + { + \__xtxko_assign_font_opts:Nn \XK@sans@hangul@options {#1} + \newfontfamily \XK@sans@hangul@font [\l_xtxko_rem_tl] {#2} + \tl_set:Nn \korsansfont {\XK@sans@hangul@font \XK@sans@hangul@options} + \ignorespaces + } +\DeclareDocumentCommand \setmonohangulfont { O{} m } + { + \newfontfamily \kormonofont [#1] {#2} + \ignorespaces + } +\DeclareDocumentCommand \setmainhanjafont { O{} m } + { + \__xtxko_assign_font_opts:Nn \XK@main@hanja@options {#1} + \newfontfamily \XK@main@hanja@font [\l_xtxko_rem_tl] {#2} + \tl_set:Nn \hnjmainfont {\XK@main@hanja@font \XK@main@hanja@options} + \ignorespaces + } +\DeclareDocumentCommand \setsanshanjafont { O{} m } + { + \__xtxko_assign_font_opts:Nn \XK@sans@hanja@options {#1} + \newfontfamily \XK@sans@hanja@font [\l_xtxko_rem_tl] {#2} + \tl_set:Nn \hnjsansfont {\XK@sans@hanja@font \XK@sans@hanja@options} + \ignorespaces + } +\DeclareDocumentCommand \setmonohanjafont { O{} m } + { + \newfontfamily \hnjmonofont [#1] {#2} + \ignorespaces + } +%% {hangul,hanja}fontspec = adhoc{hangul,hanja}font +\DeclareDocumentCommand \adhochangulfont { O{} m } + { + \__xtxko_assign_font_opts:Nn \XK@adhoc@hangul@options {#1} + \newfontfamily \XK@adhoc@hangul@font [\l_xtxko_rem_tl] {#2} + \tl_set:Nn \XKhangulfont + { + \XK@storeltnfont + \tl_set_eq:NN \XKcurrentfont \c_one + \XK@adhoc@hangul@font \XK@adhoc@hangul@options + \XK@storecjkfont + } + \ignorespaces + } +\cs_set_eq:NN \hangulfontspec \adhochangulfont +\DeclareDocumentCommand \adhochanjafont { O{} m } + { + \__xtxko_assign_font_opts:Nn \XK@adhoc@hanja@options {#1} + \newfontfamily \XK@adhoc@hanja@font [\l_xtxko_rem_tl] {#2} + \tl_set:Nn \XKhanjafont + { + \XK@storeltnfont + \tl_set_eq:NN \XKcurrentfont \c_two + \XK@adhoc@hanja@font \XK@adhoc@hanja@options + \XK@storecjkfont + } + \ignorespaces + } +\cs_set_eq:NN \hanjafontspec \adhochanjafont +%% new{hangul,hanja}font{family,face} +\DeclareDocumentCommand \newhangulfontfamily { m O{} m } + { + \__xtxko_assign_font_opts:cn { XK@newfont@options \token_to_str:N #1 } {#2} + \exp_after:wN \newfontfamily + \cs:w XK@newfont@family \token_to_str:N #1 \cs_end: [\l_xtxko_rem_tl] {#3} + \DeclareRobustCommand #1 + { + \tl_set:Nn \XKhangulfont + { + \XK@storeltnfont + \tl_set_eq:NN \XKcurrentfont \c_one + \use:c { XK@newfont@family \token_to_str:N #1 } + \use:c { XK@newfont@options \token_to_str:N #1 } + \XK@storecjkfont + } + } + } +\DeclareDocumentCommand \newhanjafontfamily { m O{} m } + { + \__xtxko_assign_font_opts:cn { XK@newfont@options \token_to_str:N #1 } {#2} + \exp_after:wN \newfontfamily + \cs:w XK@newfont@family \token_to_str:N #1 \cs_end: [\l_xtxko_rem_tl] {#3} + \DeclareRobustCommand #1 + { + \tl_set:Nn \XKhanjafont + { + \XK@storeltnfont + \tl_set_eq:NN \XKcurrentfont \c_two + \use:c { XK@newfont@family \token_to_str:N #1 } + \use:c { XK@newfont@options \token_to_str:N #1 } + \XK@storecjkfont + } + } + } +\DeclareDocumentCommand \newhangulfontface { m O{} m } + { + \__xtxko_assign_font_opts:cn { XK@newfont@options \token_to_str:N #1 } {#2} + \exp_after:wN \newfontface + \cs:w XK@newfont@family \token_to_str:N #1 \cs_end: [\l_xtxko_rem_tl] {#3} + \DeclareRobustCommand #1 + { + \tl_set:Nn \XKhangulfont + { + \XK@storeltnfont + \tl_set_eq:NN \XKcurrentfont \c_one + \use:c { XK@newfont@family \token_to_str:N #1 } + \use:c { XK@newfont@options \token_to_str:N #1 } + \XK@storecjkfont + } + } + } +\DeclareDocumentCommand \newhanjafontface { m O{} m } + { + \__xtxko_assign_font_opts:cn { XK@newfont@options \token_to_str:N #1 } {#2} + \exp_after:wN \newfontface + \cs:w XK@newfont@family \token_to_str:N #1 \cs_end: [\l_xtxko_rem_tl] {#3} + \DeclareRobustCommand #1 + { + \tl_set:Nn \XKhanjafont + { + \XK@storeltnfont + \tl_set_eq:NN \XKcurrentfont \c_two + \use:c { XK@newfont@family \token_to_str:N #1 } + \use:c { XK@newfont@options \token_to_str:N #1 } + \XK@storecjkfont + } + } + } +%% add{hangul,hanja}fontfeature[s] +\DeclareDocumentCommand \addhangulfontfeature { m } + { + \group_begin: + \XKhangulfont + \tl_clear:N \l_xtxko_font_opts_tl + \keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rem_tl + \addfontfeature {\l_xtxko_rem_tl} + \use:x + { + \group_end: + \exp_not:N \tl_set:Nn \exp_not:N \XKhangulfont + { + \exp_not:N \XK@storeltnfont + \exp_not:N \tl_set_eq:NN \exp_not:N \XKcurrentfont \exp_not:N \c_one + \exp_not:N \fontfamily { \f@family } \exp_not:N \selectfont + \exp_not:V \l_xtxko_font_opts_tl + \exp_not:N \XK@storecjkfont + } + } + \ignorespaces + } +\cs_set_eq:NN \addhangulfontfeatures \addhangulfontfeature +\DeclareDocumentCommand \addhanjafontfeature { m } + { + \group_begin: + \XKhanjafont + \tl_clear:N \l_xtxko_font_opts_tl + \keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rem_tl + \addfontfeature {\l_xtxko_rem_tl} + \use:x + { + \group_end: + \exp_not:N \tl_set:Nn \exp_not:N \XKhanjafont + { + \exp_not:N \XK@storeltnfont + \exp_not:N \tl_set_eq:NN \exp_not:N \XKcurrentfont \exp_not:N \c_two + \exp_not:N \fontfamily { \f@family } \exp_not:N \selectfont + \exp_not:V \l_xtxko_font_opts_tl + \exp_not:N \XK@storecjkfont + } + } + \ignorespaces + } +\cs_set_eq:NN \addhanjafontfeatures \addhanjafontfeature +%% math hangul font +\DeclareDocumentCommand \setmathhangulfont { O{} m } + { + \fontspec_set_family:Nnn \xetexko@math@hangul@family {#1} {#2} + } %%%%%%%%%%%%%%%%%%%% %% xetexkofontregime -\define@key[xtxko]{char}{alphs}{\csname #1alphs\endcsname} -\define@key[xtxko]{char}{nums}{\csname #1nums\endcsname} -\define@key[xtxko]{char}{parens}{\csname #1parens\endcsname} -\define@key[xtxko]{char}{quotes}{\csname #1quotes\endcsname} -\define@key[xtxko]{char}{puncts}{\csname #1puncts\endcsname} -\define@key[xtxko]{char}{colons}{\csname #1colons\endcsname} -\define@key[xtxko]{char}{hyphens}{\csname #1hyphens\endcsname} -\define@key[xtxko]{char}{cjksymbols}{\csname #1cjksymbols\endcsname} - -\protected\def\xetexkofontregime{% - \@ifnextchar[\@xetexkofontregime{\@xetexkofontregime[]}} -\def\@xetexkofontregime[#1]#2{% - \csname #2marks\endcsname - \setkeys*[xtxko]{char}{#1}} +\keys_define:nn { xtxko-char } + { + alphs .code:n = \use:c { #1alphs } , + nums .code:n = \use:c { #1nums } , + parens .code:n = \use:c { #1parens } , + quotes .code:n = \use:c { #1quotes } , + puncts .code:n = \use:c { #1puncts } , + colons .code:n = \use:c { #1colons } , + hyphens .code:n = \use:c { #1hyphens } , + cjksymbols .code:n = \use:c { #1cjksymbols } , + } +\DeclareDocumentCommand \xetexkofontregime { O{} m } + { + \use:c { #2marks } + \keys_set:nn { xtxko-char } { #1 } + } +\ExplSyntaxOff %%%%%%%%%%%%%%%%%%%%%%%%%% % set unfonts if [unfonts] @@ -319,8 +364,12 @@ %%%%%%%%%%%%%%%%%%%%%%%%%% % font switching for latex -\def\XKstoreprevfont{\ifx\f@family\XKcjkprevfont\let\f@family\XKltnprevfont\fi} -\def\XK@storeltnfont{\ifx\f@family\XKcjkprevfont\else\let\XKltnprevfont\f@family\fi} +\def\XKstoreprevfont{% + \ifx\f@family\XKcjkprevfont\let\f@family\XKltnprevfont\fi +} +\def\XK@storeltnfont{% + \ifx\f@family\XKcjkprevfont\else\let\XKltnprevfont\f@family\fi +} \def\XK@storecjkfont{% \let\XKcjkprevfont\f@family \edef\XKplaincjkprevfont{\the\font}% @@ -372,7 +421,9 @@ \edef\rmfamily{\unexpanded\expandafter{\rmfamily\XK@rm@korean@font}} \edef\sffamily{\unexpanded\expandafter{\sffamily\XK@sf@korean@font}} -\edef\ttfamily{\unexpanded\expandafter{\ttfamily\XK@tt@korean@font\disablehangulspacing}} +\edef\ttfamily{\unexpanded\expandafter{\ttfamily + \XK@tt@korean@font\disablehangulspacing +}} \edef\verbatim@font{\unexpanded\expandafter{\verbatim@font \disablehangulspacingandlinebreak \let\XKstoreprevfont\XKlatinfont @@ -380,23 +431,21 @@ \expandafter\ifx\familydefault\rmdefault \XK@rm@korean@font - \protected\edef\normalfont{\unexpanded\expandafter{\normalfont\XK@rm@korean@font}} + \protected\edef\normalfont{\unexpanded\expandafter{\normalfont + \XK@rm@korean@font}} \else \expandafter\ifx\familydefault\sfdefault \XK@sf@korean@font - \protected\edef\normalfont{\unexpanded\expandafter{\normalfont\XK@sf@korean@font}} + \protected\edef\normalfont{\unexpanded\expandafter{\normalfont + \XK@sf@korean@font}} \else \XK@tt@korean@font - \protected\edef\normalfont{\unexpanded\expandafter{\normalfont\XK@tt@korean@font}} + \protected\edef\normalfont{\unexpanded\expandafter{\normalfont + \XK@tt@korean@font}} \fi\fi \let\reset@font\normalfont %%%%%%%%%%%%%%%%%%%%% % hangul in math mode -\def\setmathhangulfont{% - \@ifnextchar[{\setmathhangulfont@}{\setmathhangulfont@[]}} -\def\setmathhangulfont@[#1]#2{% - \zf@fontspec{#1}{#2}% - \xdef\xetexko@math@hangul@family{\zf@family}} \AtBeginDocument{% \begingroup \ifx\xetexko@math@hangul@family\undefined diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko-hanging.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko-hanging.sty index e6794ab5625..e079a7aa1ec 100644 --- a/Master/texmf-dist/tex/xetex/xetexko/xetexko-hanging.sty +++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko-hanging.sty @@ -13,7 +13,7 @@ \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax\else \ProvidesPackage{xetexko-hanging} - [2014/03/28 v2.5 Hanging punctuations for XeTeX-ko] + [2014/05/11 v2.6 Hanging punctuations for XeTeX-ko] \fi \chardef\catcodeofATcharacter\catcode`@ diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko-josa.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko-josa.sty index 3f6a81bb3aa..a78fa8a511a 100644 --- a/Master/texmf-dist/tex/xetex/xetexko/xetexko-josa.sty +++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko-josa.sty @@ -12,7 +12,7 @@ \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax\else - \ProvidesPackage{xetexko-josa}[2014/03/28 v2.5 Auto-josa for XeTeX-ko] + \ProvidesPackage{xetexko-josa}[2014/05/11 v2.6 Auto-josa for XeTeX-ko] \fi \unless\ifcsname @tempcnta\endcsname\newcount\@tempcnta\fi diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko-space.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko-space.sty index 2b285822e5a..87ba623421c 100644 --- a/Master/texmf-dist/tex/xetex/xetexko/xetexko-space.sty +++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko-space.sty @@ -13,7 +13,7 @@ \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax\else \ProvidesPackage{xetexko-space} - [2014/03/28 v2.5 Spacings and fonts for XeTeX-ko] + [2014/05/11 v2.6 Spacings and fonts for XeTeX-ko] \fi %%% we need XeTeX > 0.997 @@ -33,6 +33,14 @@ %%%%%%%%%%%%%%%%%%%%% % assign char classes +\def\XK@assign@char@class#1#2#3{% + \count@=#1\relax + \loop + \XeTeXcharclass\count@ = #3\relax + \ifnum\count@<#2\relax \advance\count@\@ne + \repeat +} + %%% default assignments (see unicode-letters.tex) % CJK hanja = class 1 % CJK openings = class 2 @@ -70,12 +78,8 @@ \XeTeXcharclass "30F5 = \XKsmallkana \XeTeXcharclass "30F6 = \XKsmallkana \XeTeXcharclass "30FC = \XKsmallkana -\count@="31F0 \loop - \XeTeXcharclass\count@ = \XKsmallkana - \ifnum\count@<"31FF \advance\count@\@ne \repeat -\count@="FF67 \loop - \XeTeXcharclass\count@ = \XKsmallkana - \ifnum\count@<"FF70 \advance\count@\@ne \repeat +\XK@assign@char@class{"31F0}{"31FF}\XKsmallkana +\XK@assign@char@class{"FF67}{"FF70}\XKsmallkana %%% \XeTeXcharclass "25A1 = \XKhanja % □ @@ -179,22 +183,10 @@ \XeTeXcharclass "215C = \XKcjksymbol % ⅜ \XeTeXcharclass "215D = \XKcjksymbol % ⅝ \XeTeXcharclass "215E = \XKcjksymbol % ⅞ -\count@ "2160 % Ⅰ -\loop - \XeTeXcharclass\count@\XKcjksymbol - \ifnum\count@ < "216B % Ⅻ - \advance\count@\@ne \repeat -\count@ "2170 % ⅰ -\loop - \XeTeXcharclass\count@\XKcjksymbol - \ifnum\count@ < "217B % ⅻ - \advance\count@\@ne \repeat +\XK@assign@char@class{"2160}{"216B}\XKcjksymbol % Ⅰ .. Ⅻ +\XK@assign@char@class{"2170}{"217B}\XKcjksymbol % ⅰ .. ⅻ %% math symbols (?) -\count@ "2190 % ← -\loop - \XeTeXcharclass\count@\XKcjksymbol - \ifnum\count@ < "2199 % ↙ - \advance\count@\@ne \repeat +\XK@assign@char@class{"2190}{"2199}\XKcjksymbol % ← .. ↙ \XeTeXcharclass "21D2 = \XKcjksymbol % ⇒ \XeTeXcharclass "21D4 = \XKcjksymbol % ⇔ \XeTeXcharclass "2200 = \XKcjksymbol % ∀ @@ -234,20 +226,12 @@ \XeTeXcharclass "2299 = \XKcjksymbol % ⊙ \XeTeXcharclass "22A5 = \XKcjksymbol % ⊥ \XeTeXcharclass "2312 = \XKcjksymbol % ⌒ -\count@ "2460 % ① -\loop - \XeTeXcharclass\count@\XKcjksymbol - \ifnum\count@ < "24EA % ⓪ - \advance\count@\@ne \repeat +\XK@assign@char@class{"2460}{"24EA}\XKcjksymbol % ① .. ⓪ \XeTeXcharclass "2500 = \XKcjksymbol % ─ \XeTeXcharclass "2501 = \XKcjksymbol % ━ \XeTeXcharclass "2502 = \XKcjksymbol % │ \XeTeXcharclass "2503 = \XKcjksymbol % ┃ -\count@ "250C % ─ -\loop - \XeTeXcharclass\count@\XKcjksymbol - \ifnum\count@ < "254B % ╋ - \advance\count@\@ne \repeat +\XK@assign@char@class{"250C}{"254B}\XKcjksymbol % ─ .. ╋ \XeTeXcharclass "2592 = \XKcjksymbol % ▒ \XeTeXcharclass "25A0 = \XKcjksymbol % ■ %\XeTeXcharclass "25A1 = \XKcjksymbol % □ @@ -305,40 +289,17 @@ %%% hangul syllables \newXeTeXintercharclass \XKhangulsyllable -\count@ "AC00 -\loop - \XeTeXcharclass\count@\XKhangulsyllable - \ifnum\count@ < "D7A3 - \advance\count@\@ne \repeat -\count@ "3131 % treat compatibility jamo as hangul syllable -\loop - \XeTeXcharclass\count@\XKhangulsyllable - \ifnum\count@ < "318E - \advance\count@\@ne \repeat -%%% leading consonants jamo as well -\count@ "1100 -\loop - \XeTeXcharclass\count@\XKhangulsyllable - \ifnum\count@ < "115F - \advance\count@\@ne \repeat -\count@ "A960 -\loop - \XeTeXcharclass\count@\XKhangulsyllable - \ifnum\count@ < "A97C - \advance\count@\@ne \repeat +\XK@assign@char@class{"AC00}{"D7A3}\XKhangulsyllable +% treat compatibility jamo as hangul syllable +\XK@assign@char@class{"3131}{"318E}\XKhangulsyllable +% leading consonants jamo as well +\XK@assign@char@class{"1100}{"115F}\XKhangulsyllable +\XK@assign@char@class{"A960}{"A97C}\XKhangulsyllable %%% jungseong/jongseong jamo including tone marks \newXeTeXintercharclass \XKhanguljungjong -\count@ "1160 -\loop - \XeTeXcharclass\count@\XKhanguljungjong - \ifnum\count@ < "11FF - \advance\count@\@ne \repeat -\count@ "D7B0 -\loop - \XeTeXcharclass\count@\XKhanguljungjong - \ifnum\count@ < "D7FB - \advance\count@\@ne \repeat +\XK@assign@char@class{"1160}{"11FF}\XKhanguljungjong +\XK@assign@char@class{"D7B0}{"D7FB}\XKhanguljungjong \XeTeXcharclass "302E = \XKhanguljungjong \XeTeXcharclass "302F = \XKhanguljungjong @@ -391,18 +352,12 @@ %%% latin numbers \newXeTeXintercharclass \XKlatinnumber -\count@ `0 -\loop - \XeTeXcharclass\count@\XKlatinnumber - \ifnum\count@ < `9 - \advance\count@\@ne \repeat +\XK@assign@char@class{`0}{`9}\XKlatinnumber %%% variation selectors \newXeTeXintercharclass \XKhanjacombining -\count@="E0100 \loop - \XeTeXcharclass\count@ = \XKhanjacombining - \ifnum\count@<"E01EF \advance\count@\@ne \repeat - +\XK@assign@char@class{"FE00}{"FE0F}\XKhanjacombining +\XK@assign@char@class{"E0100}{"E01EF}\XKhanjacombining %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% define inter char tokes diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko-vertical.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko-vertical.sty index 2bc1c8a512d..d29ad6b6e0e 100644 --- a/Master/texmf-dist/tex/xetex/xetexko/xetexko-vertical.sty +++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko-vertical.sty @@ -13,7 +13,7 @@ \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax\else \ProvidesPackage{xetexko-vertical} - [2014/03/28 v2.5 Vertical environment for XeTeX-ko] + [2014/05/11 v2.6 Vertical environment for XeTeX-ko] \fi \unless\ifcsname @tempdima\endcsname\newdimen\@tempdima\fi diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty index 7f25fae6146..6b006a773f9 100644 --- a/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty +++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty @@ -42,7 +42,7 @@ \expandafter\endinput \fi -\ProvidesPackage{xetexko}[2014/03/28 v2.5 Typesetting Korean with XeLaTeX] +\ProvidesPackage{xetexko}[2014/05/11 v2.6 Typesetting Korean with XeLaTeX] \newif\if@hangul \newif\if@hanja |