diff options
Diffstat (limited to 'macros/luatex/generic/luatexko/luatexko.sty')
-rw-r--r-- | macros/luatex/generic/luatexko/luatexko.sty | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/macros/luatex/generic/luatexko/luatexko.sty b/macros/luatex/generic/luatexko/luatexko.sty index 7599a0977b..76bb940fe8 100644 --- a/macros/luatex/generic/luatexko/luatexko.sty +++ b/macros/luatex/generic/luatexko/luatexko.sty @@ -13,7 +13,7 @@ \ifdefined\luatexkohangulfontattr \endinput\fi \ifdefined\selectfont - \ProvidesPackage{luatexko}[2019/08/01 v2.4 typesetting Korean with LuaTeX] + \ProvidesPackage{luatexko}[2019/12/01 v2.5 typesetting Korean with LuaTeX] \RequirePackage{luatexbase} \RequirePackage{fontspec} \else @@ -149,7 +149,8 @@ \directlua{ if \the\luatexkoulinecount == 1 then luatexko.activate("uline") end luatexko.ulboundary(\the\count@, tex.box[0].list, \luatexkoleaderstype) - }#2\directlua{ + }#2\relax + \directlua{ luatexko.ulboundary(\the\count@) }\endgroup } \protected\def\uline{\markoverwith{% @@ -309,8 +310,10 @@ \else \directlua{ luatexko.uhc2utf8.startconvert() }% \fi} % actualtext not provided -\protected\def\actualtext#1#{\luatexkoactualtext} -\def\luatexkoactualtext#1{#1} +\ifdefined\actualtext\else + \protected\def\actualtext#1#{\luatexkoactualtext} + \def\luatexkoactualtext#1{#1} +\fi % math hangul \def\setmathhangulblock#1#2{% \count@="#1 @@ -369,8 +372,8 @@ \afterassignment\luatexkosetmathhangulfonts\font\textmathhangul} \def\luatexkosetmathhangulfonts{% \toks@\expandafter{\directlua{ - local n = string.gsub("\fontname\textmathhangul", " at .+", "") - tex.sprint(n) }}% + local n = tex.fontname(font.id"textmathhangul"):gsub(" at .+", "") + tex.sprint(string.unquoted(n)) }}% \dimen@\fontdimen 6 \textmathhangul \font\scriptmathhangul= {\the\toks@} at .7\dimen@ \font\scriptscriptmathhangul = {\the\toks@} at .5\dimen@ @@ -407,11 +410,11 @@ \DeclareDocumentCommand \setmainhangulfont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkomainhangulfamily { Ligatures=TeX, #1, #3 } { #2 } - \DeclareRobustCommand \luatexkomainhangulfont + \cs_set_protected_nopar:Npn \luatexkomainhangulfont { \fontfamily \luatexkomainhangulfamily \selectfont } - \str_if_eq_x:nnT \familydefault \rmdefault + \str_if_eq:eeT \familydefault \rmdefault { \cs_set_eq:NN \luatexkohangulfont \luatexkomainhangulfont \luatexkohangulselectfont @@ -421,11 +424,11 @@ \DeclareDocumentCommand \setsanshangulfont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkosanshangulfamily { Ligatures=TeX, #1, #3 } { #2 } - \DeclareRobustCommand \luatexkosanshangulfont + \cs_set_protected_nopar:Npn \luatexkosanshangulfont { \fontfamily \luatexkosanshangulfamily \selectfont } - \str_if_eq_x:nnT \familydefault \sfdefault + \str_if_eq:eeT \familydefault \sfdefault { \cs_set_eq:NN \luatexkohangulfont \luatexkosanshangulfont \luatexkohangulselectfont @@ -435,11 +438,11 @@ \DeclareDocumentCommand \setmonohangulfont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkomonohangulfamily { #1, #3 } { #2 } - \DeclareRobustCommand \luatexkomonohangulfont + \cs_set_protected_nopar:Npn \luatexkomonohangulfont { \fontfamily \luatexkomonohangulfamily \selectfont } - \str_if_eq_x:nnT \familydefault \ttdefault + \str_if_eq:eeT \familydefault \ttdefault { \cs_set_eq:NN \luatexkohangulfont \luatexkomonohangulfont \luatexkohangulselectfont @@ -449,9 +452,9 @@ \DeclareDocumentCommand \newhangulfontfamily { m O{} m O{} } { \fontspec_set_family:cnn { luatexko_user_family_ \cs_to_str:N #1 } { #2, #4 } { #3 } - \DeclareRobustCommand #1 + \cs_set_protected_nopar:Npn #1 { - \tl_set:Nn \luatexkohangulfont + \cs_set_nopar:Npn \luatexkohangulfont { \exp_args:Nc \fontfamily { luatexko_user_family_ \cs_to_str:N #1 } \selectfont } @@ -466,7 +469,7 @@ \DeclareDocumentCommand \hangulfontspec { O{} m O{} } { \fontspec_set_family:Nnn \luatexkohangulfontfamily { #1, #3 } { #2 } - \tl_set:Nn \luatexkohangulfont + \cs_set_nopar:Npn \luatexkohangulfont { \fontfamily \luatexkohangulfontfamily \selectfont } @@ -476,11 +479,11 @@ \DeclareDocumentCommand \setmainhanjafont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkomainhanjafamily { Ligatures=TeX, #1, #3 } { #2 } - \DeclareRobustCommand \luatexkomainhanjafont + \cs_set_protected_nopar:Npn \luatexkomainhanjafont { \fontfamily \luatexkomainhanjafamily \selectfont } - \str_if_eq_x:nnT \familydefault \rmdefault + \str_if_eq:eeT \familydefault \rmdefault { \cs_set_eq:NN \luatexkohanjafont \luatexkomainhanjafont \luatexkohanjaselectfont @@ -490,11 +493,11 @@ \DeclareDocumentCommand \setsanshanjafont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkosanshanjafamily { Ligatures=TeX, #1, #3 } { #2 } - \DeclareRobustCommand \luatexkosanshanjafont + \cs_set_protected_nopar:Npn \luatexkosanshanjafont { \fontfamily \luatexkosanshanjafamily \selectfont } - \str_if_eq_x:nnT \familydefault \sfdefault + \str_if_eq:eeT \familydefault \sfdefault { \cs_set_eq:NN \luatexkohanjafont \luatexkosanshanjafont \luatexkohanjaselectfont @@ -504,11 +507,11 @@ \DeclareDocumentCommand \setmonohanjafont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkomonohanjafamily { #1, #3 } { #2 } - \DeclareRobustCommand \luatexkomonohanjafont + \cs_set_protected_nopar:Npn \luatexkomonohanjafont { \fontfamily \luatexkomonohanjafamily \selectfont } - \str_if_eq_x:nnT \familydefault \ttdefault + \str_if_eq:eeT \familydefault \ttdefault { \cs_set_eq:NN \luatexkohanjafont \luatexkomonohanjafont \luatexkohanjaselectfont @@ -518,9 +521,9 @@ \DeclareDocumentCommand \newhanjafontfamily { m O{} m O{} } { \fontspec_set_family:cnn { luatexko_user_family_ \cs_to_str:N #1 } { #2, #4 } { #3 } - \DeclareRobustCommand #1 + \cs_set_protected_nopar:Npn #1 { - \tl_set:Nn \luatexkohanjafont + \cs_set_nopar:Npn \luatexkohanjafont { \exp_args:Nc \fontfamily { luatexko_user_family_ \cs_to_str:N #1 } \selectfont } @@ -535,7 +538,7 @@ \DeclareDocumentCommand \hanjafontspec { O{} m O{} } { \fontspec_set_family:Nnn \luatexkohanjafontfamily { #1, #3 } { #2 } - \tl_set:Nn \luatexkohanjafont + \cs_set_nopar:Npn \luatexkohanjafont { \fontfamily \luatexkohanjafontfamily \selectfont } @@ -546,11 +549,11 @@ \DeclareDocumentCommand \setmainfallbackfont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkomainfallbackfamily { Ligatures=TeX, #1, #3 } { #2 } - \DeclareRobustCommand \luatexkomainfallbackfont + \cs_set_protected_nopar:Npn \luatexkomainfallbackfont { \fontfamily \luatexkomainfallbackfamily \selectfont } - \str_if_eq_x:nnT \familydefault \rmdefault + \str_if_eq:eeT \familydefault \rmdefault { \cs_set_eq:NN \luatexkofallbackfont \luatexkomainfallbackfont \luatexkofallbackselectfont @@ -560,11 +563,11 @@ \DeclareDocumentCommand \setsansfallbackfont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkosansfallbackfamily { Ligatures=TeX, #1, #3 } { #2 } - \DeclareRobustCommand \luatexkosansfallbackfont + \cs_set_protected_nopar:Npn \luatexkosansfallbackfont { \fontfamily \luatexkosansfallbackfamily \selectfont } - \str_if_eq_x:nnT \familydefault \sfdefault + \str_if_eq:eeT \familydefault \sfdefault { \cs_set_eq:NN \luatexkofallbackfont \luatexkosansfallbackfont \luatexkofallbackselectfont @@ -574,11 +577,11 @@ \DeclareDocumentCommand \setmonofallbackfont { O{} m O{} } { \fontspec_set_family:Nnn \luatexkomonofallbackfamily { #1, #3 } { #2 } - \DeclareRobustCommand \luatexkomonofallbackfont + \cs_set_protected_nopar:Npn \luatexkomonofallbackfont { \fontfamily \luatexkomonofallbackfamily \selectfont } - \str_if_eq_x:nnT \familydefault \ttdefault + \str_if_eq:eeT \familydefault \ttdefault { \cs_set_eq:NN \luatexkofallbackfont \luatexkomonofallbackfont \luatexkofallbackselectfont @@ -588,9 +591,9 @@ \DeclareDocumentCommand \newfallbackfontfamily { m O{} m O{} } { \fontspec_set_family:cnn { luatexko_user_family_ \cs_to_str:N #1 } { #2, #4 } { #3 } - \DeclareRobustCommand #1 + \cs_set_protected_nopar:Npn #1 { - \tl_set:Nn \luatexkofallbackfont + \cs_set_nopar:Npn \luatexkofallbackfont { \exp_args:Nc \fontfamily { luatexko_user_family_ \cs_to_str:N #1 } \selectfont } @@ -605,7 +608,7 @@ \DeclareDocumentCommand \fallbackfontspec { O{} m O{} } { \fontspec_set_family:Nnn \luatexkofallbackfontfamily { #1, #3 } { #2 } - \tl_set:Nn \luatexkofallbackfont + \cs_set_nopar:Npn \luatexkofallbackfont { \fontfamily \luatexkofallbackfontfamily \selectfont } |