summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-10 23:27:36 +0000
committerKarl Berry <karl@freefriends.org>2021-06-10 23:27:36 +0000
commit43da258b5bc79c87791b5909e50c30f02d7d72b6 (patch)
treee86e53ed30dab8fdabcd49fc91b48071f57fd26d /Master/texmf-dist/tex
parent9e6a83ac8fd75c415c29905fc4bf917c354a49ed (diff)
xetexko (11jun21)
git-svn-id: svn://tug.org/texlive/trunk@59546 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/xetex/xetexko/xetexko.sty177
1 files changed, 87 insertions, 90 deletions
diff --git a/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty b/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty
index ce95a1488b2..e82c85aabdd 100644
--- a/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty
+++ b/Master/texmf-dist/tex/xetex/xetexko/xetexko.sty
@@ -15,8 +15,8 @@
\catcode`@=11
\ifdefined\ProvidesPackage
- \NeedsTeXFormat{LaTeX2e}[2020/10/01]
- \ProvidesPackage{xetexko}[2021/05/20 v3.5 typesetting Korean with XeTeX]
+ \NeedsTeXFormat{LaTeX2e}[2021/06/01]
+ \ProvidesPackage{xetexko}[2021/06/10 v3.6 typesetting Korean with XeTeX]
\else
\ifdefined\@tempcnta\else \newcount\@tempcnta \fi
\ifdefined\@sptoken \else
@@ -393,9 +393,12 @@
}
\protected\def\vertical#1{%
\leavevmode
- \setbox\z@\vbox\bgroup
- \hsize#1\relax
- \typesetvertical
+ \ifx\empty#1\empty
+ \setbox\z@\hbox\bgroup
+ \else
+ \setbox\z@\vbox\bgroup \hsize#1\relax
+ \fi
+ \typesetvertical
}
\protected\def\endvertical{%
\egroup
@@ -404,65 +407,50 @@
}
\protected\def\horizontal#1{%
\leavevmode
- \setbox\z@\vbox\bgroup
- \hsize#1\relax
- \typesethorizontal
+ \ifx\empty#1\empty
+ \setbox\z@\hbox\bgroup
+ \else
+ \setbox\z@\vbox\bgroup \hsize#1\relax
+ \fi
+ \typesethorizontal
}
\protected\def\endhorizontal{%
\egroup
\XeKo@unrotatebox\z@
- \lower\dimexpr.5\ht\z@\ifdefined\xetexkocharraise-\xetexkocharraise\fi\relax
+ \ifdefined\xetexkocharraise \raise\xetexkocharraise \fi
\box\z@
}
\def\XeKo@rotatebox#1{%
- \setbox#1\hbox to\dimexpr\ht#1+\dp#1\bgroup
+ \dimen@\dimexpr\ht#1+\dp#1\relax
+ \setbox#1\hbox to\dimen@\bgroup
\hfil
\vbox to\wd#1\bgroup
- \wd#1\z@ \ht#1\z@ \dp#1\z@
- \special{x:gsave}\special{x:rotate -90}\box#1\special{x:grestore}%
+ \wd#1\z@
+ \special{x:gsave}\relax
+ \special{x:rotate -90}\relax
+ \box#1\relax
+ \kern-\dimen@
+ \special{x:grestore}\relax
\vfil
\egroup
\kern-.5ex
\egroup
}
\def\XeKo@unrotatebox#1{%
- \setbox#1\hbox to\dimexpr\ht#1+\dp#1\bgroup
- \vbox to\wd#1\bgroup
+ \dimen@\dimexpr\ht#1+\dp#1\relax
+ \setbox#1\hbox to\dimen@\bgroup
+ \lower.5\wd#1\vbox to\wd#1\bgroup
\vfil
- \wd#1\z@ \ht#1\z@ \dp#1\z@
- \special{x:gsave}\special{x:rotate 90}\box#1\special{x:grestore}%
+ \wd#1\z@
+ \special{x:gsave}\relax
+ \special{x:rotate 90}\relax
+ \box#1\relax
+ \kern-\dimen@
+ \special{x:grestore}\relax
\egroup
\hfil
\egroup
}
-\ifcsname ver@xetexko.sty\endcsname
- \IfFormatAtLeastTF{2021/06/01}{
- \def\verticaltypesetting{%
- \maxdepth\z@ \typesetvertical
- \dimen@\textwidth \textwidth\textheight \textheight\dimen@
- \AddToHook{cmd/@outputpage/before}{\XeKo@rotatebox\@outputbox \textwidth\textheight}%
- \let\verticaltypesetting\relax % prevent multiple running
- }
- }{
- \def\verticaltypesetting{%
- \maxdepth\z@ \typesetvertical
- \dimen@\textwidth \textwidth\textheight \textheight\dimen@
- \edef\@outputpage{\unexpanded{\XeKo@rotatebox\@outputbox
- \textwidth\textheight}\unexpanded\expandafter{\@outputpage}}%
- \let\verticaltypesetting\relax % prevent multiple running
- }
- }
-\else
- \def\verticaltypesetting{%
- \dimen@\hsize \hsize\vsize \vsize\dimen@
- \edef\plainoutput{\unexpanded{\dimen@\hsize \hsize\vsize \vsize\dimen@}%
- \unexpanded\expandafter{\plainoutput}}%
- \def\pagebody{\setbox\z@\vbox to\hsize{\boxmaxdepth=\maxdepth
- \pagecontents}\XeKo@rotatebox\z@\box\z@}%
- \maxdepth\z@ \typesetvertical
- \let\verticaltypesetting\relax % prevent multiple running
- }
-\fi
\protected\def\vertlatin#1{\leavevmode\lower.5ex\hbox{\latinmarks #1}} % compat
@@ -1835,6 +1823,18 @@
%%% plain
\ifcsname ver@xetexko.sty\endcsname \else
+ \def\verticaltypesetting{%
+ \dimen@\hsize \hsize\vsize \vsize\dimen@
+ \edef\plainoutput{\dimen@\hsize \hsize\vsize \vsize\dimen@
+ \unexpanded\expandafter{\plainoutput}}%
+ \def\pagebody{\setbox\z@\vbox to\hsize{\boxmaxdepth=\maxdepth \pagecontents}%
+ \XeKo@rotatebox\z@\box\z@}%
+ \maxdepth\z@ \typesetvertical
+ \let\verticaltypesetting\relax % prevent multiple running
+ }
+ \def\beginverticaltypesetting{\vfill\supereject \begingroup \verticaltypesetting}
+ \def\endverticaltypesetting{\vfill\supereject \endgroup}
+ % hangul fonts
\protected\def\hangulfont{%
\afterassignment\XeKo@hangulfont@setup\font\XeKo@hangul@font
}
@@ -1895,9 +1895,9 @@
}
\protected\def\hanjabyhangulfont{\let\XeKo@hanja@font\XeKo@hangul@font }
% math hangul
- \newfam\symmathhangul
\protected\def\setmathhangulfonts#1#2#3{% font identifiers
\ifnum\Umathcodenum"AC00="AC00\relax
+ \csname newfam\endcsname\symmathhangul
\setmathhangulblock{AC00}{D7A3}%
\fi
\textfont\symmathhangul=#1\relax
@@ -1926,6 +1926,37 @@
\endinput\fi
%%% latex
+
+\def\verticaltypesetting{%
+ \ifx\@nodocument\relax % not in the preamble
+ \clearpage
+ \begingroup
+ \fi
+ \hsize\textheight \vsize\textwidth
+ \textwidth\hsize \textheight\vsize
+ \@colroom\vsize \@colht\vsize
+ \if@twocolumn
+ \columnwidth=.5\dimexpr\textwidth-\columnsep\relax
+ \linewidth\columnwidth \hsize\columnwidth
+ \else
+ \linewidth\hsize \columnwidth\hsize
+ \fi
+ \expandafter\def\expandafter\@outputpage\expandafter{%
+ \expandafter\XeKo@rotatebox\expandafter\@outputbox
+ \expandafter\textwidth\expandafter\textheight
+ \@outputpage
+ }%
+ \maxdepth\z@ \typesetvertical
+ \let\verticaltypesetting\relax % prevent multiple running
+}
+\def\endverticaltypesetting{%
+ \clearpage
+ \endgroup
+ \global\@colroom\textheight
+ \global\@colht\textheight
+ \global\vsize\textheight
+}
+
\RequirePackage{fontspec}[2020/02/03]
\AddToHook{rmfamily}{%
\let \xetexkohangulfont \xetexkomainhangulfont
@@ -1947,19 +1978,10 @@
\latinalphs\latinparens\latinpuncts\latincolons\latinhyphens
\disablehangulspacing
}
-\IfFormatAtLeastTF{2021/06/01}{
- \AddToHook{cmd/verbatim@font/after}{%
- \disablehangulspacingandlinebreak
- \aftergroup\enablehangulspacingandlinebreak
- }
-}{
- \edef\verbatim@font{%
- \unexpanded\expandafter{%
- \verbatim@font
- \disablehangulspacingandlinebreak
- \aftergroup\enablehangulspacingandlinebreak
- }}
-}
+\AddToHook{cmd/verbatim@font/after}{%
+ \disablehangulspacingandlinebreak
+ \aftergroup\enablehangulspacingandlinebreak
+ }
\AddToHook{normalfont}{%
\let \xetexkohangulfont \xetexkodefaulthangulfont
\let \xetexkohanguloption \xetexkodefaulthanguloption
@@ -1969,19 +1991,10 @@
\AddToHook{env/picture/begin}{%
\latinalphs\latinparens\latinpuncts\latincolons\latinhyphens
}
-
-\IfHookExistsTF{selectfont}{
- \AddToHook{selectfont}{%
- \XeKo@hanja@selectfont
- \XeKo@hangul@selectfont
- }
-}{
- \RequirePackage{everysel}
- \EverySelectfont{%
- \XeKo@hanja@selectfont
- \XeKo@hangul@selectfont
- }
-}
+\AddToHook{selectfont}{%
+ \XeKo@hanja@selectfont
+ \XeKo@hangul@selectfont
+ }
\def\XeKo@hangul@selectfont{%
\ifdefined\XeKo@in@selectfont\else
\ifdefined\xetexkohangulfont
@@ -2051,21 +2064,6 @@
\tl_clear:N \l_xtxko_font_opts_tl
\keys_set_known:nxN { xtxko-font } {#1} \l_xtxko_rest_opts_tl
}
-% suppress upshape font warnings
-\cs_new_nopar:Npn \l_xetexko_pacify_upshape {
- \tl_map_inline:nn { \mddefault \bfdefault }
- {
- \cs_if_exist:cF { \g_fontspec_encoding_tl/\l_fontspec_family_tl/##1/\updefault }
- {
- \cs_if_exist:cT { \g_fontspec_encoding_tl/\l_fontspec_family_tl/##1/\shapedefault }
- {
- \cs_set_eq:cc
- { \g_fontspec_encoding_tl/\l_fontspec_family_tl/##1/\updefault }
- { \g_fontspec_encoding_tl/\l_fontspec_family_tl/##1/\shapedefault }
- }
- }
- }
-}
\DeclareDocumentCommand \setmainhangulfont { O{} m O{} }
{
\__xtxko_assign_font_opts:n { #1, #3 }
@@ -2168,7 +2166,7 @@
\DeclareDocumentCommand \addhangulfontfeature { m }
{
\group_begin:
- \fontseries\mddefault\fontshape\shapedefault \xetexkohangulfont
+ \fontseries\seriesdefault\fontshape\shapedefault \xetexkohangulfont
\cs_set_eq:NN \l_xtxko_font_opts_tl \xetexkohanguloption
\keys_set_known:nxN { xtxko-font } { #1 } \l_xtxko_rest_opts_tl
\addfontfeature { \l_xtxko_rest_opts_tl }
@@ -2292,7 +2290,7 @@
\DeclareDocumentCommand \addhanjafontfeature { m }
{
\group_begin:
- \fontseries\mddefault\fontshape\shapedefault \xetexkohanjafont
+ \fontseries\seriesdefault\fontshape\shapedefault \xetexkohanjafont
\cs_set_eq:NN \l_xtxko_font_opts_tl \xetexkohanjaoption
\keys_set_known:nxN { xtxko-font } { #1 } \l_xtxko_rest_opts_tl
\addfontfeature { \l_xtxko_rest_opts_tl }
@@ -2318,9 +2316,8 @@
\DeclareDocumentCommand \setmathhangulfont { O{} m O{} }
{
\fontspec_set_family:Nnn \xetexkomathhangulfamily { #1, #3 } { #2 }
- \l_xetexko_pacify_upshape
\DeclareSymbolFont { mathhangul }
- \g_fontspec_encoding_tl \xetexkomathhangulfamily \mddefault \updefault
+ \g_fontspec_encoding_tl \xetexkomathhangulfamily \seriesdefault \shapedefault
\int_compare:nNnT { \Umathcodenum"AC00 } = { "AC00 }
{
\setmathhangulblock{AC00}{D7A3}