texlive[43172] Master/texmf-dist: luatexko (8feb17)

commits+karl at tug.org commits+karl at tug.org
Wed Feb 8 23:19:36 CET 2017


Revision: 43172
          http://tug.org/svn/texlive?view=revision&revision=43172
Author:   karl
Date:     2017-02-08 23:19:36 +0100 (Wed, 08 Feb 2017)
Log Message:
-----------
luatexko (8feb17)

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-core.sty
    trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
    trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
    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	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/ChangeLog	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,3 +1,9 @@
+2017-02-06      Dohyun Kim <nomos at ktug org>
+
+	Version 1.16
+
+	* luatexko.sty: patch {rm|sf|tt}family of fontspec 2017
+
 2016-05-14      Dohyun Kim <nomos at ktug org>
 
 	Version 1.15

Modified: trunk/Master/texmf-dist/doc/luatex/luatexko/README
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexko/README	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/README	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,4 +1,4 @@
-LuaTeX-ko Package version 1.15 (2016/05/14)
+LuaTeX-ko Package version 1.16 (2017/02/06)
 ===========================================
 
 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	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex	2017-02-08 22:19:36 UTC (rev 43172)
@@ -8,7 +8,7 @@
 %%
 %% public domain
 
-\RequirePackage{luatex85}
+%\RequirePackage{luatex85}
 \documentclass[a4paper]{article}
 \usepackage[hmargin=3.8cm]{geometry}
 \usepackage[hangul]{luatexko}
@@ -61,7 +61,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.15\quad 2016/05/14}
+\date{Version 1.16\quad 2017/02/06}
 \maketitle
 
 \begin{quote}\small
@@ -321,6 +321,7 @@
 \framebox[\linewidth]{\begin{vertical}{17em}
     \sffamily
     \addhangulfontfeature{Vertical=RotatedGlyphs,
+      RawFeature=vertical,
       CharacterWidth=Full, CharRaise=0.1ex, }
 \parindent-1em\leftskip1em \linespread{1.5}\selectfont
 \noindent 님의 침묵(The Silent Beloved)

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,6 +1,6 @@
 % luatexko-core.sty
 %
-% Copyright (c) 2013-2016 Dohyun Kim  <nomos at ktug org>
+% Copyright (c) 2013-2017 Dohyun Kim  <nomos at ktug org>
 %                         Soojin Nam  <jsunam at gmail com>
 %
 % This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
   \ifcsname ifpdf\endcsname\else \input ifpdf.sty \fi
   \catcode`@ = 11
 \else
-  \ProvidesPackage{luatexko-core}[2016/05/14 v1.15 Typesetting Korean with LuaTeX]
+  \ProvidesPackage{luatexko-core}[2017/02/06 v1.16 Typesetting Korean with LuaTeX]
   \RequirePackage{luaotfload}[2016/04/21]
   \RequirePackage{ifpdf}
 \fi
@@ -32,7 +32,11 @@
   \let\luaescapestring\luatexluaescapestring
 \fi
 \ifdefined\pdffontsize\else % luatex 0.87
-  \def\pdffontsize{\pdffeedback fontsize}
+  \ifpdf
+    \def\pdffontsize{\pdffeedback fontsize}
+  \else
+    \def\pdffontsize{\the\fontdimen6 }
+  \fi
   \protected\def\pdfliteral{\pdfextension literal}
 \fi
 
@@ -282,7 +286,7 @@
   \global\advance\luakoulineboxcnt\@ne
   \count@\luakoulineboxcnt
   \leavevmode}
-\protected\def\uline#1{%
+\protected\def\ulineluatexko#1{%
   \luako at uline@code at common
   \luako at nested@ulinedown
   \dimen@\dimexpr\ulinedown+\ulinewidth\relax
@@ -289,17 +293,18 @@
   \dimen at ii-\dimexpr\ulinedown\relax
   \setbox\z@\hbox{\vrule width\z@ height\dimen at ii depth\dimen@}%
   \directlua{ luatexko.uline_boundary(\the\count@,tex.box[0].head) }%
-  #1%
+  #1\relax
   \directlua{ luatexko.uline_boundary(\the\count@) }%
   \endgroup}
-\protected\def\sout#1{{\def\ulinedown{-0.5ex-\ulinewidth/2}\uline{#1}}}
-\protected\def\uuline#1{\uline{\uline{#1}}}
+\let\uline\ulineluatexko
+\protected\def\sout#1{{\def\ulinedown{-0.5ex-\ulinewidth/2}\ulineluatexko{#1}}}
+\protected\def\uuline#1{\ulineluatexko{\ulineluatexko{#1}}}
 % ulem with arbitray box
 \protected\def\markoverwith#1#2{%
   \luako at uline@code at common
   \setbox\z@\hbox{#1}%
   \directlua{ luatexko.uline_boundary(\the\count@,tex.box[0]) }%
-  #2%
+  #2\relax
   \directlua{ luatexko.uline_boundary(\the\count@) }%
   \endgroup}
 \protected\def\uwave{\ifx\ltxko at sixly\undefined \font\ltxko at sixly=lasy6 \fi

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,6 +1,6 @@
 -- luatexko-normalize.lua
 --
--- Copyright (c) 2013-2016  Dohyun Kim  <nomos at ktug org>
+-- Copyright (c) 2013-2017  Dohyun Kim  <nomos at ktug org>
 --                          Soojin Nam  <jsunam at gmail com>
 --
 -- This work may be distributed and/or modified under the
@@ -13,8 +13,8 @@
 
 luatexbase.provides_module({
   name        = "luatexko-normalize",
-  version     = "1.13",
-  date        = "2016/04/25",
+  version     = "1.16",
+  date        = "2017/02/06",
   author      = "Dohyun Kim, Soojin Nam",
   description = "Hangul normalization",
   license     = "LPPL v1.3+",

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,6 +1,6 @@
 -- luatexko-uhc2utf8.lua
 --
--- Copyright (c) 2013-2016  Dohyun Kim  <nomos at ktug org>
+-- Copyright (c) 2013-2017  Dohyun Kim  <nomos at ktug org>
 --                          Soojin Nam  <jsunam at gmail com>
 --
 -- This work may be distributed and/or modified under the
@@ -13,8 +13,8 @@
 
 luatexbase.provides_module({
   name        = "luatexko-uhc2utf8",
-  version     = "1.13",
-  date        = "2016/04/25",
+  version     = "1.16",
+  date        = "2017/02/06",
   author      = "Dohyun Kim, Soojin Nam",
   description = "UHC (CP949) input encoding",
   license     = "LPPL v1.3+",

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,6 +1,6 @@
 -- luatexko.lua
 --
--- Copyright (c) 2013-2016  Dohyun Kim  <nomos at ktug org>
+-- Copyright (c) 2013-2017  Dohyun Kim  <nomos at ktug org>
 --                          Soojin Nam  <jsunam at gmail com>
 --
 -- This work may be distributed and/or modified under the
@@ -13,8 +13,8 @@
 
 luatexbase.provides_module {
   name        = 'luatexko',
-  date        = '2016/05/14',
-  version     = '1.15',
+  date        = '2017/02/06',
+  version     = '1.16',
   description = 'Korean linebreaking and font-switching',
   author      = 'Dohyun Kim, Soojin Nam',
   license     = 'LPPL v1.3+',
@@ -129,135 +129,112 @@
 local cjkclass = {
   [0x2018] = 1, -- ‘
   [0x201C] = 1, -- “
-  [0xFF08] = 1, -- (
-  [0xFE35] = 1, -- ( vert
-  [0x3014] = 1, -- 〔
-  [0xFE39] = 1, -- 〔 vert
-  [0xFF3B] = 1, -- [
-  [0xFE47] = 1, -- [ vert
-  [0xFF5B] = 1, -- {
-  [0xFE37] = 1, -- { vert
+  [0x2329] = 1, -- 〈
   [0x3008] = 1, -- 〈
-  [0xFE3F] = 1, -- 〈 vert
   [0x300A] = 1, -- 《
-  [0xFE3D] = 1, -- 《 vert
   [0x300C] = 1, -- 「
-  [0xFE41] = 1, -- 「 vert
   [0x300E] = 1, -- 『
-  [0xFE43] = 1, -- 『 vert
   [0x3010] = 1, -- 【
-  [0xFE3B] = 1, -- 【 vert
-  [0x3001] = 2, -- 、
-  [0xFE11] = 2, -- 、 vert
-  [0xFF0C] = 2, -- ,
-  [0xFE10] = 2, -- , vert
+  [0x3014] = 1, -- 〔
+  [0x3016] = 1, -- 〖
+  [0x3018] = 1, -- 〘
+  [0x301A] = 1, -- 〚
+  [0x301D] = 1, -- 〝
+  [0xFE17] = 1, -- ︗
+  [0xFE35] = 1, -- ︵
+  [0xFE37] = 1, -- ︷
+  [0xFE39] = 1, -- ︹
+  [0xFE3B] = 1, -- ︻
+  [0xFE3D] = 1, -- ︽
+  [0xFE3F] = 1, -- ︿
+  [0xFE41] = 1, -- ﹁
+  [0xFE43] = 1, -- ﹃
+  [0xFE47] = 1, -- ﹇
+  [0xFF08] = 1, -- (
+  [0xFF3B] = 1, -- [
+  [0xFF5B] = 1, -- {
+  [0xFF5F] = 1, -- ⦅
+  [0xFF62] = 1, -- 「 half
   [0x2019] = 2, -- ’
   [0x201D] = 2, -- ”
-  [0xFF09] = 2, -- )
-  [0xFE36] = 2, -- ) vert
-  [0x3015] = 2, -- 〕
-  [0xFE3A] = 2, -- 〕 vert
-  [0xFF3D] = 2, -- ]
-  [0xFE48] = 2, -- ] vert
-  [0xFF5D] = 2, -- }
-  [0xFE38] = 2, -- } vert
+  [0x232A] = 2, -- 〉
+  [0x3001] = 2, -- 、
   [0x3009] = 2, -- 〉
-  [0xFE40] = 2, -- 〉 vert
   [0x300B] = 2, -- 》
-  [0xFE3E] = 2, -- 》 vert
   [0x300D] = 2, -- 」
-  [0xFE42] = 2, -- 」 vert
   [0x300F] = 2, -- 』
-  [0xFE44] = 2, -- 』 vert
   [0x3011] = 2, -- 】
-  [0xFE3C] = 2, -- 】 vert
+  [0x3015] = 2, -- 〕
+  [0x3017] = 2, -- 〗
+  [0x3019] = 2, -- 〙
+  [0x301B] = 2, -- 〛
+  [0x301E] = 2, -- 〞
+  [0x301F] = 2, -- 〟
+  [0xFE10] = 2, -- ︐
+  [0xFE11] = 2, -- ︑
+  [0xFE18] = 2, -- ︘
+  [0xFE36] = 2, -- ︶
+  [0xFE38] = 2, -- ︸
+  [0xFE3A] = 2, -- ︺
+  [0xFE3C] = 2, -- ︼
+  [0xFE3E] = 2, -- ︾
+  [0xFE40] = 2, -- ﹀
+  [0xFE42] = 2, -- ﹂
+  [0xFE44] = 2, -- ﹄
+  [0xFE48] = 2, -- ﹈
+  [0xFF09] = 2, -- )
+  [0xFF0C] = 2, -- ,
+  [0xFF3D] = 2, -- ]
+  [0xFF5D] = 2, -- }
+  [0xFF60] = 2, -- ⦆
+  [0xFF63] = 2, -- 」 half
+  [0xFF64] = 2, -- 、 half
   [0x00B7] = 3, -- ·
   [0x30FB] = 3, -- ・
   [0xFF1A] = 3, -- :
---  [0xFE13] = 3, -- : vert
   [0xFF1B] = 3, -- ;
---  [0xFE14] = 3, -- ; vert
+  [0xFF65] = 3, -- ・ half
   [0x3002] = 4, -- 。
-  [0xFE12] = 4, -- 。 vert
+  [0xFE12] = 4, -- ︒
   [0xFF0E] = 4, -- .
-  [0x2015] = 5, --  ―
+  [0xFF61] = 4, -- 。 half
+  [0x2015] = 5, -- ―
+  [0x2025] = 5, -- ‥
   [0x2026] = 5, -- …
-  [0xFE19] = 5, -- … vert
-  [0x2025] = 5, -- ‥
-  [0xFE30] = 5, -- ‥ vert
-  [0xFE31] = 5, -- ︱ vert
+  [0xFE19] = 5, -- ︙
+  [0xFE30] = 5, -- ︰
+  [0xFE31] = 5, -- ︱
+  [0xFE15] = 6, -- ︕
+  [0xFE16] = 6, -- ︖
+  [0xFF01] = 6, -- !
   [0xFF1F] = 6, -- ?
-  [0xFF01] = 6, -- !
-  [0xFE16] = 6, -- ︖ vert
-  [0xFE15] = 6, -- ︕ vert
 }
 
-local inhibitxspcode = {
+local inhibitxspcode = setmetatable({
   [0x002D] = 0, -- - hyphen minus
   [0x003C] = 0, -- <
   [0x003E] = 1, -- >
-  [0x00B0] = 1,
-  [0x2015] = 0,
-  [0x2018] = 2,
-  [0x2019] = 1,
-  [0x201C] = 2,
-  [0x201D] = 1,
-  [0x2026] = 0,
-  [0xFE19] = 0,
-  [0x2032] = 1,
-  [0x2033] = 1,
-  [0x3001] = 1,
-  [0xFE11] = 1,
-  [0x3002] = 1,
-  [0xFE12] = 1,
-  [0x3008] = 2,
-  [0xFE3F] = 2,
-  [0x3009] = 1,
-  [0xFE40] = 1,
-  [0x300A] = 2,
-  [0xFE3D] = 2,
-  [0x300B] = 1,
-  [0xFE3E] = 1,
-  [0x300C] = 2,
-  [0xFE41] = 2,
-  [0x300D] = 1,
-  [0xFE42] = 1,
-  [0x300E] = 2,
-  [0xFE43] = 2,
-  [0x300F] = 1,
-  [0xFE44] = 1,
-  [0x3010] = 2,
-  [0xFE3B] = 2,
-  [0x3011] = 1,
-  [0xFE3C] = 1,
+  [0x00B0] = 1, -- °
+  [0x2032] = 1, -- ′
+  [0x2033] = 1, -- ″
   [0x3012] = 2, -- 〒
-  [0x3014] = 2,
-  [0xFE39] = 2,
-  [0x3015] = 1,
-  [0xFE3A] = 1,
-  [0x301C] = 0,
-  [0xFF08] = 2,
-  [0xFE35] = 2,
-  [0xFF09] = 1,
-  [0xFE36] = 1,
-  [0xFF0C] = 1,
-  [0xFE10] = 1,
-  [0xFF0E] = 1,
-  [0xFF1B] = 1,
-  [0xFE14] = 1,
-  [0xFF1F] = 1,
-  [0xFF3B] = 2,
-  [0xFE47] = 2,
-  [0xFF3D] = 1,
-  [0xFE48] = 1,
-  [0xFF5B] = 2,
-  [0xFE37] = 2,
-  [0xFF5D] = 1,
-  [0xFE38] = 1,
-  [0xFFE5] = 0,
-}
+  [0x301C] = 0, -- 〜
+  [0xFE14] = 1, -- ︔
+  [0xFF1B] = 1, -- ;
+  [0xFFE5] = 0, -- ¥
+},{
+  __index = function (_,c)
+    if cjkclass[c] == 1 then
+      return 2
+    elseif cjkclass[c] == 2 or cjkclass[c] == 4 or cjkclass[c] == 6 then
+      return 1
+    elseif cjkclass[c] == 5 then
+      return 0
+    end
+  end
+})
 
-local postbreakpenalty = {
+local postbreakpenalty = setmetatable({
   [0x0023] = 500,
   [0x0024] = 500,
   [0x0025] = 500,
@@ -266,37 +243,24 @@
   [0x003C] = 10000, -- <
   [0x005B] = 10000,
   [0x0060] = 10000,
+  [0x007B] = 10000, -- {
+  [0x00AB] = 10000, -- «
   [0x2013] = 50, -- en-dash
   [0x2014] = 50, -- em-dash
-  [0x2018] = 10000,
-  [0x201C] = 10000,
-  [0x3008] = 10000,
-  [0xFE3F] = 10000,
-  [0x300A] = 10000,
-  [0xFE3D] = 10000,
-  [0x300C] = 10000,
-  [0xFE41] = 10000,
-  [0x300E] = 10000,
-  [0xFE43] = 10000,
-  [0x3010] = 10000,
-  [0xFE3B] = 10000,
-  [0x3014] = 10000,
-  [0xFE39] = 10000,
   [0xFF03] = 200,
   [0xFF04] = 200,
   [0xFF05] = 200,
   [0xFF06] = 200,
-  [0xFF08] = 10000,
-  [0xFE35] = 10000,
-  [0xFF3B] = 10000,
-  [0xFE47] = 10000,
-  [0xFF40] = 10000,
-  [0xFF5B] = 10000,
-  [0xFE37] = 10000,
-  [0xFF62] = 10000, -- 「
-}
+  [0xFF40] = 10000, -- `
+},{
+  __index = function (_,c)
+    if cjkclass[c] == 1 then
+      return 10000
+    end
+  end
+})
 
-local prebreakpenalty = {
+local prebreakpenalty = setmetatable({
   [0x0021] = 10000,
   [0x0022] = 10000,
   [0x0027] = 10000,
@@ -312,35 +276,18 @@
   [0x003E] = 10000, -- >
   [0x003F] = 10000,
   [0x005D] = 10000,
-  [0x00B4] = 10000,
-  [0x00B7] = 10000, -- ·
+  [0x007D] = 10000, -- }
+  [0x00B4] = 10000, -- ´
+  [0x00BB] = 10000, -- »
   [0x2013] = 10000, -- –
   [0x2014] = 10000, -- —
-  [0x2015] = 10000,
-  [0x2019] = 10000,
-  [0x201D] = 10000,
   [0x2025] = 5000, -- 250, -- ‥
-  [0xFE30] = 5000, -- 250, -- ︰
   [0x2026] = 5000, -- 250, -- …
-  [0xFE19] = 5000, -- 250, -- ︙
   [0x2212] = 5000, -- 200, -- −  minus sign
-  [0x3001] = 10000,
-  [0xFE11] = 10000,
-  [0x3002] = 10000,
-  [0xFE12] = 10000,
-  [0x3005] = 10000,
-  [0x3009] = 10000,
-  [0xFE40] = 10000,
-  [0x300B] = 10000,
-  [0xFE3E] = 10000,
-  [0x300D] = 10000,
-  [0xFE42] = 10000,
-  [0x300F] = 10000,
-  [0xFE44] = 10000,
-  [0x3011] = 10000,
-  [0xFE3C] = 10000,
-  [0x3015] = 10000,
-  [0xFE3A] = 10000,
+  [0x3005] = 10000, -- 々
+  [0x301C] = 10000, -- 〜
+  [0x3035] = 10000, -- 〵
+  [0x303B] = 10000, -- 〻
   [0x3041] = 150,
   [0x3043] = 150,
   [0x3045] = 150,
@@ -351,8 +298,13 @@
   [0x3085] = 150,
   [0x3087] = 150,
   [0x308E] = 150,
-  [0x309B] = 10000,
-  [0x309C] = 10000,
+  [0x3095] = 150,
+  [0x3096] = 150,
+  [0x309B] = 10000, -- ゛
+  [0x309C] = 10000, -- ゜
+  [0x309D] = 10000, -- ゝ
+  [0x309E] = 10000, -- ゞ
+  [0x30A0] = 10000, -- ゠
   [0x30A1] = 150,
   [0x30A3] = 150,
   [0x30A5] = 150,
@@ -365,27 +317,25 @@
   [0x30EE] = 150,
   [0x30F5] = 150,
   [0x30F6] = 150,
-  [0x30FB] = 10000,
-  [0x30FC] = 10000,
-  [0xFF01] = 10000,
-  [0xFF09] = 10000,
-  [0xFE36] = 10000,
+  [0x30FC] = 10000, -- ー
+  [0x30FD] = 10000, -- ヽ
+  [0x30FE] = 10000, -- ヾ
+  [0xFE13] = 10000, -- ︓
+  [0xFE14] = 10000, -- ︔
+  [0xFE19] = 5000, -- 250, -- ︙
+  [0xFE30] = 5000, -- 250, -- ︰
+  [0xFE32] = 10000, -- ︲
   [0xFF0B] = 5000, -- 200, -- +
-  [0xFF0C] = 10000,
-  [0xFE10] = 10000,
-  [0xFF0E] = 10000,
-  [0xFF1A] = 10000,
-  [0xFE13] = 10000,
-  [0xFF1B] = 10000,
-  [0xFE14] = 10000,
   [0xFF1D] = 5000, -- 200, -- =
-  [0xFF1F] = 10000,
-  [0xFF3D] = 10000,
-  [0xFE48] = 10000,
-  [0xFF5D] = 10000,
-  [0xFE38] = 10000,
-  [0xFF63] = 10000, -- 」
-}
+  [0xFF9E] = 10000, -- ゙
+  [0xFF9F] = 10000, -- ゚
+},{
+  __index = function (_,c)
+    if cjkclass[c] and cjkclass[c] > 1 then
+      return 10000
+    end
+  end
+})
 
 local xspcode = {
   [0x0027] = 2,
@@ -593,10 +543,14 @@
   end
 end
 
+local type1fonts = {}
+
 local function get_font_table (fid)
   if fid then
     if fontdata[fid] then
       return fontdata[fid]
+    elseif type1fonts[fid] then
+      return type1fonts[fid]
     else
       return font.fonts[fid]
     end
@@ -1479,11 +1433,37 @@
   esh = esh and tex_round(esh)
   if esp == gsp and est == gst and esh == gsh then else return end
   local hf = get_font_table(hfontid)
-  if hf and hf.encodingbytes == 2 then else return end
+--  if hf and hf.encodingbytes == 2 then else return end
   return gsp, hf
 end
 
-local type1fonts = {} -- due to too verbose log
+local function virtual_unifont (prefix,size)
+  local data = {
+    name       = prefix.."vf",
+    type       = "virtual",
+    fonts      = {},
+    characters = {},
+  }
+  local fonts = data.fonts
+  local chars = data.characters
+  for index = 0, 255 do
+    local name = string.format(prefix.."%02x", index)
+    if kpse_find_file(name,"tfm") then
+      local tfm = font.read_tfm(name, size)
+      data.parameters = data.parameters or tfm.parameters
+      fonts[#fonts+1] = { name=name, size=size }
+      local fid = #fonts
+      local zro = 256 * index
+      for i,v in pairs(tfm.characters) do
+        local slot = zro + i
+        chars[slot] = v
+        chars[slot].commands = { { "slot", fid, i } }
+      end
+    end
+  end
+  return data
+end
+
 local function nanumtype1font(curr)
   local currchar, currfont = d_getchar(curr), d_getfont(curr)
   if currchar > 0xFFFF then return end
@@ -1500,38 +1480,21 @@
     series = fnt_t.name:find("^cmb") and "b" or "m"
   end
   local shape  = fnt_t.parameters.slant > 0 and "o" or ""
-  local subfnt = stringformat("%s%s%s%02x",family,series,shape,currchar/256)
+  local prefix = stringformat("%s%s%s",family,series,shape)
   local fsize  = fnt_t.size or 655360
-  local fspec  = stringformat("%s@%d",subfnt,fsize)
-  local newfnt = type1fonts[fspec]
-  if newfnt == false then return end
-  local newchr = currchar % 256
-  local function ital_corr (curr,chr_t)
-    if shape ~= "o" then return end
-    local nxt = d_getnext(curr)
-    if nxt and d_getid(nxt) == kernnode and d_getsubtype(nxt) == kern_type_itlc and d_getfield(nxt,"kern") == 0 then
-      d_setfield(nxt,"kern", chr_t.italic or 0)
+  local fspec  = stringformat("%s@%d",prefix,fsize)
+  local fontid = type1fonts[fspec]
+  if fontid == nil then -- bypass false
+    local fontdata = virtual_unifont(prefix, fsize)
+    fontid = fontdata and fontdefine(fontdata)
+    if fontid then
+      type1fonts[fspec]  = fontid
+      type1fonts[fontid] = fontdata
+    else
+      type1fonts[fspec] = false
     end
   end
-  if newfnt then
-    local fntchr = get_font_char(newfnt,newchr)
-    if fntchr then
-      d_setfield(curr,"font", newfnt)
-      d_setchar(curr, newchr)
-      ital_corr(curr,fntchr)
-    end
-  elseif kpse_find_file(subfnt,"tfm") then
-    local ft, id = fonts.constructors.readanddefine(subfnt,fsize)
-    local fntchr = ft and ft.characters[newchr]
-    if id and fntchr then
-      type1fonts[fspec] = id
-      d_setfield(curr,"font", id)
-      d_setchar(curr, newchr)
-      ital_corr(curr,fntchr)
-    end
-  else
-    type1fonts[fspec] = false
-  end
+  return fontid
 end
 
 local function font_substitute(head)
@@ -1569,58 +1532,60 @@
               uni = uni and get_cjk_class(uni)
               if uni and uni < 7 then ftable = {hanja, hangul, fallback} end
             end
+            local fid
             for i = 1,3 do
-              local fid = ftable[i]
+              fid = ftable[i]
               myfontchar = fid and get_font_char(fid, currchar)
-              if myfontchar then
-                d_setfield(curr,"font",fid)
-                --- charraise option charraise
-                local charraise = get_font_feature(fid, "charraise")
-                if charraise then
-                  charraise = tex_sp(charraise)
-                  local curryoffset = d_getfield(curr,"yoffset") or 0
-                  d_setfield(curr,"yoffset", charraise + curryoffset)
-                end
-                ---
-                local nxt = d_getnext(curr)
-                local nxtid = nxt and d_getid(nxt)
-                if nxtid == glyphnode and is_unicode_vs(d_getchar(nxt)) then
-                  nxt = d_getnext(nxt)
-                  nxtid = nxt and d_getid(nxt)
-                end
-                if eng and nxtid then
-                  local nxtsubtype = d_getsubtype(nxt)
-                  -- adjust next glue by hangul font space
-                  if nxtid == gluenode and nxtsubtype == glue_type_space and get_font_char(fid,32) then
-                    local oldwd, ft = hangulspaceskip(eng, fid, nxt)
-                    if oldwd and ft then
-                      local newwd = ft.space_char_width
-                      if not newwd then
-                        local newsp = d_tonode(d_copy_node(curr))
-                        newsp.char = 32
-                        newsp = nodes.simple_font_handler(newsp)
-                        newwd = newsp and newsp.width
-                        ft.space_char_width = newwd
-                        node.free(newsp)
-                      end
-                      if newwd and oldwd ~= newwd then
-                        d_setglue(nxt, newwd, newwd/2, newwd/3)
-                      end
+              if myfontchar then break end
+            end
+            if not myfontchar and not hangulpunctuations[currchar] then
+              fid = nanumtype1font(curr)
+              myfontchar = fid and get_font_char(fid, currchar)
+            end
+            if myfontchar then
+              d_setfield(curr,"font",fid)
+              --- charraise option charraise
+              local charraise = get_font_feature(fid, "charraise")
+              if charraise then
+                charraise = tex_sp(charraise)
+                local curryoffset = d_getfield(curr,"yoffset") or 0
+                d_setfield(curr,"yoffset", charraise + curryoffset)
+              end
+              ---
+              local nxt = d_getnext(curr)
+              local nxtid = nxt and d_getid(nxt)
+              if nxtid == glyphnode and is_unicode_vs(d_getchar(nxt)) then
+                nxt = d_getnext(nxt)
+                nxtid = nxt and d_getid(nxt)
+              end
+              if eng and nxtid then
+                local nxtsubtype = d_getsubtype(nxt)
+                -- adjust next glue by hangul font space
+                if nxtid == gluenode and nxtsubtype == glue_type_space and get_font_char(fid,32) then
+                  local oldwd, ft = hangulspaceskip(eng, fid, nxt)
+                  if oldwd and ft then
+                    local newwd = ft.space_char_width
+                    if not newwd then
+                      local newsp = d_tonode(d_copy_node(curr))
+                      newsp.char = 32
+                      newsp = nodes.simple_font_handler(newsp)
+                      newwd = newsp and newsp.width
+                      ft.space_char_width = newwd
+                      node.free(newsp)
                     end
-                  -- adjust next italic correction kern
-                  elseif nxtid == kernnode and nxtsubtype == kern_type_itlc and d_getfield(nxt,"kern") == 0 then
-                    local ksl = get_font_table(fid).parameters.slant
-                    if ksl and ksl > 0 then
-                      d_setfield(nxt,"kern", myfontchar.italic or 0)
+                    if newwd and oldwd ~= newwd then
+                      d_setglue(nxt, newwd, newwd/2, newwd/3)
                     end
                   end
+                -- adjust next italic correction kern
+                elseif nxtid == kernnode and nxtsubtype == kern_type_itlc and d_getfield(nxt,"kern") == 0 then
+                  local ksl = get_font_table(fid).parameters.slant
+                  if ksl and ksl > 0 then
+                    d_setfield(nxt,"kern", myfontchar.italic or 0)
+                  end
                 end
-                break
               end
             end
-            if not myfontchar then
-              nanumtype1font(curr)
-            end
           end
         end
       end
@@ -1824,10 +1789,23 @@
 end
 luatexko.uline_boundary = uline_boundary
 
+local skippable = {
+  [gluenode   ] = true,
+  [penaltynode] = true,
+  [kernnode   ] = true,
+  [whatsitnode] = true,
+}
 local function draw_underline(head,curr,glueset,gluesign,glueorder,ubox,start)
-  if not start then
-    start = d_getid(head) == gluenode and d_getsubtype(head) < 100 and d_getnext(head) or head
+  start = start or head
+  while start do
+    if not skippable[d_getid(start)] then break end
+    start = d_getnext(start)
   end
+  while curr do
+    local p = d_getprev(curr)
+    if not skippable[d_getid(p)] then break end
+    curr = p
+  end
   local width = d_nodedimensions(glueset,gluesign,glueorder,start,curr)
   if width and width > 0 then
     local glue = d_get_gluenode(width)
@@ -2085,7 +2063,7 @@
   --- vertical gpos
   local res = vf.resources or {}
   if res.verticalgposhack then
-    return vf -- avoid multiple running
+    return -- avoid multiple running
   end
   local fea = shared.features or {}
   fea.kern = nil  -- only for horizontal typesetting
@@ -2120,7 +2098,6 @@
     end
   end
   res.verticalgposhack = true
-  return vf
 end
 
 local otffeatures = fonts.constructors.newfeatures("otf")
@@ -2159,11 +2136,6 @@
 -- italic correction for fake-slant font
 ------------------------------------
 local function fakeslant_itlc (tfmdata)
-  --[[ should be removed
-  if tfmdata.format == "unknown" then
-    tfmdata.name = tfmdata.name:gsub("^\"(.-)\"$","%1")
-  end
-  --]]
   local slfactor = tfmdata.parameters.slantfactor
   if slfactor and slfactor > 0 then else return end
   tfmdata.parameters.slant = slfactor * 65536

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty	2017-02-08 22:19:24 UTC (rev 43171)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty	2017-02-08 22:19:36 UTC (rev 43172)
@@ -1,6 +1,6 @@
 % luatexko.sty
 %
-% Copyright (c) 2013-2016 Dohyun Kim  <nomos at ktug org>
+% Copyright (c) 2013-2017 Dohyun Kim  <nomos at ktug org>
 %                         Soojin Nam  <jsunam at gmail com>
 %
 % This work may be distributed and/or modified under the
@@ -23,7 +23,7 @@
   \expandafter\endinput
 \fi
 
-\ProvidesPackage{luatexko}[2016/05/14 v1.15 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2017/02/06 v1.16 Typesetting Korean with LuaLaTeX]
 
 \ifdefined\adjustspacing\else % luatex < 0.87
   \let\adjustspacing\pdfadjustspacing
@@ -87,19 +87,9 @@
     ]
     {Ligatures=TeX}
   %% macros for Korean fonts
-  \cs_new:Nn \__luako_pass_args:nnn
+  \DeclareDocumentCommand \setmainhangulfont { O{} m O{} }
     {
-      \IfNoValueTF {#2}
-        { \__luako_post_args:w {#1} {#3} }
-        { #1 {#2} {#3} }
-    }
-  \NewDocumentCommand \__luako_post_args:w { m m O{} }
-    { #1 {#3} {#2} }
-  \DeclareDocumentCommand \setmainhangulfont { o m }
-    { \__luako_pass_args:nnn \__luako_setmainhangulfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmainhangulfont:nn
-    {
-      \newfontfamily \serifhangul at font [#1] {#2}
+      \newfontfamily \serifhangul at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \rmdefault
         {
           \cs_set_eq:NN \hangul at font \serifhangul at font
@@ -107,11 +97,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setmainhanjafont { o m }
-    { \__luako_pass_args:nnn \__luako_setmainhanjafont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmainhanjafont:nn
+  \DeclareDocumentCommand \setmainhanjafont { O{} m O{} }
     {
-      \newfontfamily \serifhanja at font [#1] {#2}
+      \newfontfamily \serifhanja at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \rmdefault
         {
           \cs_set_eq:NN \hanja at font \serifhanja at font
@@ -119,11 +107,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setmainfallbackfont { o m }
-    { \__luako_pass_args:nnn \__luako_setmainfallbackfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmainfallbackfont:nn
+  \DeclareDocumentCommand \setmainfallbackfont { O{} m O{} }
     {
-      \newfontfamily \seriffallback at font [#1] {#2}
+      \newfontfamily \seriffallback at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \rmdefault
         {
           \cs_set_eq:NN \fallback at font \seriffallback at font
@@ -131,11 +117,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setsanshangulfont { o m }
-    { \__luako_pass_args:nnn \__luako_setsanshangulfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setsanshangulfont:nn
+  \DeclareDocumentCommand \setsanshangulfont { O{} m O{} }
     {
-      \newfontfamily \sanshangul at font [#1] {#2}
+      \newfontfamily \sanshangul at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \sfdefault
         {
           \cs_set_eq:NN \hangul at font \sanshangul at font
@@ -143,11 +127,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setsanshanjafont { o m }
-    { \__luako_pass_args:nnn \__luako_setsanshanjafont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setsanshanjafont:nn
+  \DeclareDocumentCommand \setsanshanjafont { O{} m O{} }
     {
-      \newfontfamily \sanshanja at font [#1] {#2}
+      \newfontfamily \sanshanja at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \sfdefault
         {
           \cs_set_eq:NN \hanja at font \sanshanja at font
@@ -155,11 +137,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setsansfallbackfont { o m }
-    { \__luako_pass_args:nnn \__luako_setsansfallbackfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setsansfallbackfont:nn
+  \DeclareDocumentCommand \setsansfallbackfont { O{} m O{} }
     {
-      \newfontfamily \sansfallback at font [#1] {#2}
+      \newfontfamily \sansfallback at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \sfdefault
         {
           \cs_set_eq:NN \fallback at font \sansfallback at font
@@ -167,11 +147,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setmonohangulfont { o m }
-    { \__luako_pass_args:nnn \__luako_setmonohangulfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmonohangulfont:nn
+  \DeclareDocumentCommand \setmonohangulfont { O{} m O{} }
     {
-      \newfontfamily \monohangul at font [#1] {#2}
+      \newfontfamily \monohangul at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \ttdefault
         {
           \cs_set_eq:NN \hangul at font \monohangul at font
@@ -179,11 +157,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setmonohanjafont { o m }
-    { \__luako_pass_args:nnn \__luako_setmonohanjafont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmonohanjafont:nn
+  \DeclareDocumentCommand \setmonohanjafont { O{} m O{} }
     {
-      \newfontfamily \monohanja at font [#1] {#2}
+      \newfontfamily \monohanja at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \ttdefault
         {
           \cs_set_eq:NN \hanja at font \monohanja at font
@@ -191,11 +167,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \setmonofallbackfont { o m }
-    { \__luako_pass_args:nnn \__luako_setmonofallbackfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmonofallbackfont:nn
+  \DeclareDocumentCommand \setmonofallbackfont { O{} m O{} }
     {
-      \newfontfamily \monofallback at font [#1] {#2}
+      \newfontfamily \monofallback at font [#1,#3] {#2}
       \str_if_eq_x:nnT \familydefault \ttdefault
         {
           \cs_set_eq:NN \fallback at font \monofallback at font
@@ -203,11 +177,9 @@
         }
       \ignorespaces
     }
-  \DeclareDocumentCommand \newhangulfontfamily { m o m }
-    { \__luako_pass_args:nnn { \__luako_newhangulfontfamily:Nnn #1 } {#2} {#3} }
-  \cs_new:Nn \__luako_newhangulfontfamily:Nnn
+  \DeclareDocumentCommand \newhangulfontfamily { m O{} m O{} }
     {
-      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
+      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \hangul at font { luatexkofont@ \token_to_str:N #1 }
@@ -214,11 +186,9 @@
           \luatexko at hangul@selectfont
         }
     }
-  \DeclareDocumentCommand \newhanjafontfamily { m o m }
-    { \__luako_pass_args:nnn { \__luako_newhanjafontfamily:Nnn #1 } {#2} {#3} }
-  \cs_new:Nn \__luako_newhanjafontfamily:Nnn
+  \DeclareDocumentCommand \newhanjafontfamily { m O{} m O{} }
     {
-      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
+      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \hanja at font { luatexkofont@ \token_to_str:N #1 }
@@ -225,11 +195,9 @@
           \luatexko at hanja@selectfont
         }
     }
-  \DeclareDocumentCommand \newfallbackfontfamily { m o m }
-    { \__luako_pass_args:nnn { \__luako_newfallbackfontfamily:Nnn #1 } {#2} {#3} }
-  \cs_new:Nn \__luako_newfallbackfontfamily:Nnn
+  \DeclareDocumentCommand \newfallbackfontfamily { m O{} m O{} }
     {
-      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
+      \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \fallback at font { luatexkofont@ \token_to_str:N #1 }
@@ -236,11 +204,9 @@
           \luatexko at fallback@selectfont
         }
     }
-  \DeclareDocumentCommand \newhangulfontface { m o m }
-    { \__luako_pass_args:nnn { \__luako_newhangulfontface:Nnn #1 } {#2} {#3} }
-  \cs_new:Nn \__luako_newhangulfontface:Nnn
+  \DeclareDocumentCommand \newhangulfontface { m O{} m O{} }
     {
-      \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
+      \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \hangul at font { luatexkofont@ \token_to_str:N #1 }
@@ -247,11 +213,9 @@
           \luatexko at hangul@selectfont
         }
     }
-  \DeclareDocumentCommand \newhanjafontface { m o m }
-    { \__luako_pass_args:nnn { \__luako_newhanjafontface:Nnn #1 } {#2} {#3} }
-  \cs_new:Nn \__luako_newhanjafontface:Nnn
+  \DeclareDocumentCommand \newhanjafontface { m O{} m O{} }
     {
-      \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
+      \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \hanja at font { luatexkofont@ \token_to_str:N #1 }
@@ -258,11 +222,9 @@
           \luatexko at hanja@selectfont
         }
     }
-  \DeclareDocumentCommand \newfallbackfontface { m o m }
-    { \__luako_pass_args:nnn { \__luako_newfallbackfontface:Nnn #1 } {#2} {#3} }
-  \cs_new:Nn \__luako_newfallbackfontface:Nnn
+  \DeclareDocumentCommand \newfallbackfontface { m O{} m O{} }
     {
-      \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
+      \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
       \DeclareRobustCommand #1
         {
           \cs_set_eq:Nc \fallback at font { luatexkofont@ \token_to_str:N #1 }
@@ -269,29 +231,23 @@
           \luatexko at fallback@selectfont
         }
     }
-  \DeclareDocumentCommand \hangulfontspec { o m }
-    { \__luako_pass_args:nnn \__luako_hangulfontspec:nn {#1} {#2} }
-  \cs_new:Nn \__luako_hangulfontspec:nn
+  \DeclareDocumentCommand \hangulfontspec { O{} m O{} }
     {
-      \newfontfamily \hangul at font [#1] {#2}
+      \newfontfamily \hangul at font [#1,#3] {#2}
       \luatexko at hangul@selectfont
       \ignorespaces
     }
   \cs_set_eq:NN \adhochangulfont \hangulfontspec
-  \DeclareDocumentCommand \hanjafontspec { o m }
-    { \__luako_pass_args:nnn \__luako_hanjafontspec:nn {#1} {#2} }
-  \cs_new:Nn \__luako_hanjafontspec:nn
+  \DeclareDocumentCommand \hanjafontspec { O{} m O{} }
     {
-      \newfontfamily \hanja at font [#1] {#2}
+      \newfontfamily \hanja at font [#1,#3] {#2}
       \luatexko at hanja@selectfont
       \ignorespaces
     }
   \cs_set_eq:NN \adhochanjafont \hanjafontspec
-  \DeclareDocumentCommand \fallbackfontspec { o m }
-    { \__luako_pass_args:nnn \__luako_fallbackfontspec:nn {#1} {#2} }
-  \cs_new:Nn \__luako_fallbackfontspec:nn
+  \DeclareDocumentCommand \fallbackfontspec { O{} m O{} }
     {
-      \newfontfamily \fallback at font [#1] {#2}
+      \newfontfamily \fallback at font [#1,#3] {#2}
       \luatexko at fallback@selectfont
       \ignorespaces
     }
@@ -348,12 +304,63 @@
     }
   \cs_set_eq:NN \addfallbackfontfeatures \addfallbackfontfeature
   % hangul math font command
-  \DeclareDocumentCommand \setmathhangulfont { o m }
-    { \__luako_pass_args:nnn \__luako_setmathhangulfont:nn {#1} {#2} }
-  \cs_new:Nn \__luako_setmathhangulfont:nn
+  \DeclareDocumentCommand \setmathhangulfont { O{} m O{} }
     {
-      \fontspec_set_family:Nnn \luatexko at math@hangul at family {#1} {#2}
+      \fontspec_set_family:Nnn \luatexko at math@hangul at family {#1,#3} {#2}
     }
+% fontspec 2017
+\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
+   }
+  }
+  \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
+   }
+  }
+  \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
+   }
+  }
+  \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