texlive[48334] Master/texmf-dist: luatexko (2aug18)

commits+karl at tug.org commits+karl at tug.org
Thu Aug 2 22:32:09 CEST 2018


Revision: 48334
          http://tug.org/svn/texlive?view=revision&revision=48334
Author:   karl
Date:     2018-08-02 22:32:09 +0200 (Thu, 02 Aug 2018)
Log Message:
-----------
luatexko (2aug18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
    trunk/Master/texmf-dist/doc/luatex/luatexko/README
    trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
    trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
    trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty

Modified: trunk/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexko/ChangeLog	2018-08-02 20:31:55 UTC (rev 48333)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/ChangeLog	2018-08-02 20:32:09 UTC (rev 48334)
@@ -1,3 +1,10 @@
+2018-08-02      Dohyun Kim <nomos at ktug org>
+
+	Version 1.21
+
+	* luatexko.sty: adapt to the fontspec v2.6h
+	* luatexko.lua: font substitution for disc node as well
+
 2018-04-19      Dohyun Kim <nomos at ktug org>
 
 	Version 1.20

Modified: trunk/Master/texmf-dist/doc/luatex/luatexko/README
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexko/README	2018-08-02 20:31:55 UTC (rev 48333)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/README	2018-08-02 20:32:09 UTC (rev 48334)
@@ -1,4 +1,4 @@
-LuaTeX-ko Package version 1.20 (2018/04/19)
+LuaTeX-ko Package version 1.21 (2018/08/02)
 ===========================================
 
 This is a Lua(La)TeX macro package that supports typesetting Korean

Modified: trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex	2018-08-02 20:31:55 UTC (rev 48333)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex	2018-08-02 20:32:09 UTC (rev 48334)
@@ -62,7 +62,7 @@
 \author{Dohyun Kim \normalsize |<nomos at ktug org>| \and
         Soojin Nam \normalsize |<jsunam at gmail com>| \and
   \normalsize <\url{http://github.com/dohyunkim/luatexko}>}
-\date{Version 1.20\quad 2018/04/19}
+\date{Version 1.21\quad 2018/08/02}
 \maketitle
 
 \begin{quote}\small

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua	2018-08-02 20:31:55 UTC (rev 48333)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua	2018-08-02 20:32:09 UTC (rev 48334)
@@ -74,6 +74,7 @@
 local glue_type_space = 13
 local kern_type_itlc  = 3
 
+local discnode        = node.id("disc")
 local gluenode        = node.id("glue")
 local glyphnode       = node.id("glyph")
 local mathnode        = node.id("math")
@@ -87,6 +88,7 @@
 local n_copy_list     = node.copy_list
 
 local nodedirect        = node.direct
+local d_getdisc         = nodedirect.getdisc
 local d_todirect        = nodedirect.todirect
 local d_tonode          = nodedirect.tonode
 local d_has_field       = nodedirect.has_field
@@ -488,7 +490,7 @@
   or (c >= 0xFE10  and c <= 0xFE1F )
   or (c >= 0xFE30  and c <= 0xFE4F )
   or (c >= 0xFF00  and c <= 0xFFEF )
-  or (c >= 0x20000 and c <= 0x2FA1F)
+  or (c >= 0x20000 and c <= 0x2FFFD)
   or  c == 0x00B0  or  c == 0x2015
   --  or  c == 0x2018  or  c == 0x2019
   --  or  c == 0x201C  or  c == 0x201D
@@ -499,7 +501,7 @@
 local function is_hanja (c)
   return (c >= 0x3400 and c <= 0x9FFF )
   or (c >= 0xF900 and c <= 0xFAFF )
-  or (c >= 0x20000 and c <= 0x2FA1F)
+  or (c >= 0x20000 and c <= 0x2FFFD)
 end
 
 local function is_hangul (c)
@@ -1501,9 +1503,7 @@
   local curr = head
   while curr do
     local currid = d_getid(curr)
-    if currid == mathnode and d_getsubtype(curr) == 0 then
-      curr = d_end_of_math(curr)
-    elseif currid == glyphnode then
+    if currid == glyphnode then
       local currchar, currfont = d_getchar(curr), d_getfont(curr)
       if currchar then
         if is_unicode_vs(currchar) then -- ideograph variation selectors
@@ -1589,6 +1589,15 @@
           end
         end
       end
+    elseif currid == mathnode then
+      if d_getsubtype(curr) == 0 then
+        curr = d_end_of_math(curr)
+      end
+    elseif currid == discnode then
+      local pre, post, replace = d_getdisc(curr)
+      if pre     then font_substitute(pre)     end
+      if post    then font_substitute(post)    end
+      if replace then font_substitute(replace) end
     end
     curr = d_getnext(curr)
   end

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty	2018-08-02 20:31:55 UTC (rev 48333)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty	2018-08-02 20:32:09 UTC (rev 48334)
@@ -23,7 +23,7 @@
   \expandafter\endinput
 \fi
 
-\ProvidesPackage{luatexko}[2018/04/19 v1.20 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2018/08/02 v1.21 Typesetting Korean with LuaLaTeX]
 
 \ifdefined\adjustspacing\else % luatex < 0.87
   \let\adjustspacing\pdfadjustspacing
@@ -41,10 +41,7 @@
 \ProcessOptions\relax
 
 \if at luatexko@loadfontspec
-  %% euenc redefines \f at size by \DeclareErrorFont. sigh
-  \let\luatexko at f@size\f at size
-  \RequirePackage{fontspec}[2014/05/25]
-  \let\f at size\luatexko at f@size
+  \RequirePackage{fontspec}[2018/07/30]
 \fi
 
 \RequirePackage{luatexko-core}
@@ -89,7 +86,7 @@
   %% macros for Korean fonts
   \DeclareDocumentCommand \setmainhangulfont { O{} m O{} }
     {
-      \newfontfamily \serifhangul at font [#1,#3] {#2}
+      \setfontfamily \serifhangul at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \rmdefault
         {
           \cs_set_eq:NN \hangul at font \serifhangul at font
@@ -99,7 +96,7 @@
     }
   \DeclareDocumentCommand \setmainhanjafont { O{} m O{} }
     {
-      \newfontfamily \serifhanja at font [#1,#3] {#2}
+      \setfontfamily \serifhanja at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \rmdefault
         {
           \cs_set_eq:NN \hanja at font \serifhanja at font
@@ -109,7 +106,7 @@
     }
   \DeclareDocumentCommand \setmainfallbackfont { O{} m O{} }
     {
-      \newfontfamily \seriffallback at font [#1,#3] {#2}
+      \setfontfamily \seriffallback at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \rmdefault
         {
           \cs_set_eq:NN \fallback at font \seriffallback at font
@@ -119,7 +116,7 @@
     }
   \DeclareDocumentCommand \setsanshangulfont { O{} m O{} }
     {
-      \newfontfamily \sanshangul at font [#1,#3] {#2}
+      \setfontfamily \sanshangul at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \sfdefault
         {
           \cs_set_eq:NN \hangul at font \sanshangul at font
@@ -129,7 +126,7 @@
     }
   \DeclareDocumentCommand \setsanshanjafont { O{} m O{} }
     {
-      \newfontfamily \sanshanja at font [#1,#3] {#2}
+      \setfontfamily \sanshanja at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \sfdefault
         {
           \cs_set_eq:NN \hanja at font \sanshanja at font
@@ -139,7 +136,7 @@
     }
   \DeclareDocumentCommand \setsansfallbackfont { O{} m O{} }
     {
-      \newfontfamily \sansfallback at font [#1,#3] {#2}
+      \setfontfamily \sansfallback at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \sfdefault
         {
           \cs_set_eq:NN \fallback at font \sansfallback at font
@@ -149,7 +146,7 @@
     }
   \DeclareDocumentCommand \setmonohangulfont { O{} m O{} }
     {
-      \newfontfamily \monohangul at font [#1,#3] {#2}
+      \setfontfamily \monohangul at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \ttdefault
         {
           \cs_set_eq:NN \hangul at font \monohangul at font
@@ -159,7 +156,7 @@
     }
   \DeclareDocumentCommand \setmonohanjafont { O{} m O{} }
     {
-      \newfontfamily \monohanja at font [#1,#3] {#2}
+      \setfontfamily \monohanja at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \ttdefault
         {
           \cs_set_eq:NN \hanja at font \monohanja at font
@@ -169,7 +166,7 @@
     }
   \DeclareDocumentCommand \setmonofallbackfont { O{} m O{} }
     {
-      \newfontfamily \monofallback at font [#1,#3] {#2}
+      \setfontfamily \monofallback at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \ttdefault
         {
           \cs_set_eq:NN \fallback at font \monofallback at font
@@ -179,7 +176,7 @@
     }
   \DeclareDocumentCommand \newhangulfontfamily { m O{} m O{} }
     {
-      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
+      \exp_args:Nc \setfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \hangul at font { luatexkofont@ \token_to_str:N #1 }
@@ -188,7 +185,7 @@
     }
   \DeclareDocumentCommand \newhanjafontfamily { m O{} m O{} }
     {
-      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
+      \exp_args:Nc \setfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \hanja at font { luatexkofont@ \token_to_str:N #1 }
@@ -197,7 +194,7 @@
     }
   \DeclareDocumentCommand \newfallbackfontfamily { m O{} m O{} }
     {
-      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
+      \exp_args:Nc \setfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \fallback at font { luatexkofont@ \token_to_str:N #1 }
@@ -233,7 +230,7 @@
     }
   \DeclareDocumentCommand \hangulfontspec { O{} m O{} }
     {
-      \newfontfamily \hangul at font [#1,#3] {#2}
+      \setfontfamily \hangul at font [#1,#3] {#2}
       \luatexko at hangul@selectfont
       \ignorespaces
     }
@@ -240,7 +237,7 @@
   \cs_set_eq:NN \adhochangulfont \hangulfontspec
   \DeclareDocumentCommand \hanjafontspec { O{} m O{} }
     {
-      \newfontfamily \hanja at font [#1,#3] {#2}
+      \setfontfamily \hanja at font [#1,#3] {#2}
       \luatexko at hanja@selectfont
       \ignorespaces
     }
@@ -247,7 +244,7 @@
   \cs_set_eq:NN \adhochanjafont \hanjafontspec
   \DeclareDocumentCommand \fallbackfontspec { O{} m O{} }
     {
-      \newfontfamily \fallback at font [#1,#3] {#2}
+      \setfontfamily \fallback at font [#1,#3] {#2}
       \luatexko at fallback@selectfont
       \ignorespaces
     }
@@ -308,58 +305,34 @@
     {
       \fontspec_set_family:Nnn \luatexko at math@hangul at family {#1,#3} {#2}
     }
-% fontspec 2017
+%% fontspec 2018
 \RenewDocumentCommand \setmainfont { O{} m O{} }
- {
-  \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1,#3} {#2}
-  \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
-   {
-    \exp_not:N \luatexko at serif@fonts
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_rmfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \__fontspec_main_setmainfont:nn {#1,#3} {#2}
+    \protected\edef\rmfamily{
+      \unexpanded{\luatexko at serif@fonts}
+      \unexpanded\expandafter{\rmfamily}
+    }
+    \ignorespaces
   }
-  \str_if_eq_x:nnT {\familydefault} {\rmdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \normalfont
-  \ignorespaces
- }
 \RenewDocumentCommand \setsansfont { O{} m O{} }
- {
-  \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1,#3} {#2}
-  \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
-   {
-    \exp_not:N \luatexko at sans@fonts
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_sffamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \__fontspec_main_setsansfont:nn {#1,#3} {#2}
+    \protected\edef\sffamily{
+      \unexpanded{\luatexko at sans@fonts}
+      \unexpanded\expandafter{\sffamily}
+    }
+    \ignorespaces
   }
-  \str_if_eq_x:nnT {\familydefault} {\sfdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \normalfont
-  \ignorespaces
- }
 \RenewDocumentCommand \setmonofont { O{} m O{} }
- {
-  \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1,#3} {#2}
-  \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
-   {
-    \exp_not:N \luatexko at mono@fonts
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_ttfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \__fontspec_main_setmonofont:nn {#1,#3} {#2}
+    \protected\edef\ttfamily{
+      \unexpanded{\luatexko at mono@fonts}
+      \unexpanded\expandafter{\ttfamily}
+    }
+    \ignorespaces
   }
-  \str_if_eq_x:nnT {\familydefault} {\ttdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \normalfont
-  \ignorespaces
- }
 \cs_set_eq:NN \setromanfont \setmainfont
   \ExplSyntaxOff
 \fi



More information about the tex-live-commits mailing list