texlive[68243] Master/texmf-dist: luatexko (11sep23)

commits+karl at tug.org commits+karl at tug.org
Mon Sep 11 23:18:31 CEST 2023


Revision: 68243
          http://tug.org/svn/texlive?view=revision&revision=68243
Author:   karl
Date:     2023-09-11 23:18:30 +0200 (Mon, 11 Sep 2023)
Log Message:
-----------
luatexko (11sep23)

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-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	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/ChangeLog	2023-09-11 21:18:30 UTC (rev 68243)
@@ -1,3 +1,11 @@
+2023-09-11	Dohyun Kim <nomos at ktug org>
+
+	Version 3.6
+
+	* luatexko.lua:
+	- prevent possible error in vertical writing mode
+	- more precise space_skip after hangul characters
+
 2022-11-01	Dohyun Kim <nomos at ktug org>
 
 	Version 3.5

Modified: trunk/Master/texmf-dist/doc/luatex/luatexko/README
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexko/README	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/README	2023-09-11 21:18:30 UTC (rev 68243)
@@ -1,4 +1,4 @@
-LuaTeX-ko Package version 3.5 (2022/11/01)
+LuaTeX-ko Package version 3.6 (2023/09/11)
 ===========================================
 
 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	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex	2023-09-11 21:18:30 UTC (rev 68243)
@@ -142,7 +142,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 3.5\quad 2022/11/01}
+\date{Version 3.6\quad 2023/09/11}
 \maketitle
 
 \begin{quote}

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua	2023-09-11 21:18:30 UTC (rev 68243)
@@ -1,6 +1,6 @@
 -- luatexko-normalize.lua
 --
--- Copyright (c) 2013-2022  Dohyun Kim  <nomos at ktug org>
+-- Copyright (c) 2013-2023  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     = "3.5",
-  date        = "2022/11/01",
+  version     = "3.6",
+  date        = "2023/09/11",
   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	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua	2023-09-11 21:18:30 UTC (rev 68243)
@@ -1,6 +1,6 @@
 -- luatexko-uhc2utf8.lua
 --
--- Copyright (c) 2013-2022  Dohyun Kim  <nomos at ktug org>
+-- Copyright (c) 2013-2023  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     = "3.5",
-  date        = "2022/11/01",
+  version     = "3.6",
+  date        = "2023/09/11",
   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	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua	2023-09-11 21:18:30 UTC (rev 68243)
@@ -1,6 +1,6 @@
 -- luatexko.lua
 --
--- Copyright (c) 2013-2022 Dohyun Kim <nomos at ktug org>
+-- Copyright (c) 2013-2023 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        = '2022/11/01',
-  version     = '3.5',
+  date        = '2023/09/11',
+  version     = '3.6',
   description = 'typesetting Korean with LuaTeX',
   author      = 'Dohyun Kim, Soojin Nam',
   license     = 'LPPL v1.3+',
@@ -304,7 +304,7 @@
       if has_harf_data(fid) then
         newwd = getparameters(fid) or false
         if newwd then
-          newwd = { newwd.space, newwd.space_stretch, newwd.space_shrink }
+          newwd = { newwd.space, newwd.space_stretch, newwd.space_shrink, newwd.extra_space }
         end
       else
         local newsp = nodenew(glyphid)
@@ -312,7 +312,7 @@
         newsp = nodes.simple_font_handler(newsp)
         newwd = newsp and newsp.width or false
         if newwd then
-          newwd = { texsp(newwd), texsp(newwd/2), texsp(newwd/3) }
+          newwd = { texsp(newwd), texsp(newwd/2), texsp(newwd/3), texsp(newwd/3) }
         end
         if newsp then nodefree(newsp) end
       end
@@ -668,40 +668,12 @@
   nodewrite(what)
 end
 
-local function hangul_space_skip (curr, newfont)
-  if curr.lang ~= nohyphen and curr.font ~= newfont then
-    -- fontloader's "node" mode sets space_stretch to zero
-    -- when the font is a monospaced font (fontspec's \setmonofont
-    -- command does the same thing), which we will bypass here
-    -- for alignment of CJK and Latin glyphs in verbatim environment.
-    -- See http://www.ktug.org/xe/index.php?document_srl=249772
-    if not fontoptions.monospaced[curr.font] then
-      local n = getnext(curr)
-      if n and n.id == glueid and n.subtype == spaceskip then
-        local params = getparameters(curr.font)
-        local oldwd, oldst, oldsh, oldsto, oldsho = getglue(n)
-        if params
-          and oldwd == params.space
-          and oldst == params.space_stretch
-          and oldsh == params.space_shrink
-          and oldsto == 0
-          and oldsho == 0 then -- not user's spaceskip
-
-          local newwd = fontoptions.hangulspaceskip[newfont]
-          if newwd then
-            setglue(n, newwd[1], newwd[2], newwd[3])
-          end
-        end
-      end
-    end
-  end
-end
-
 local function process_fonts (head)
-  local curr = head
+  local curr, currfont, currlang, newfont = head, 0, nohyphen, 0
   while curr do
     local id = curr.id
     if id == glyphid then
+      currfont, currlang = curr.font, curr.lang
       if curr.font ~= 0 -- exclude nullfont
         and not has_attribute(curr, unicodeattr) then
 
@@ -712,7 +684,6 @@
           local p = getprev(curr)
           if p and p.id == glyphid then
             if curr.font ~= p.font then
-              hangul_space_skip(curr, p.font)
               curr.font = p.font
             end
             curr.lang = p.lang
@@ -747,16 +718,13 @@
             then
             curr.font = hf
           elseif hf and has_attribute(curr, hangulbyhangulattr) and is_hangul_jamo(c) then
-            hangul_space_skip(curr, hf)
             curr.font = hf
           elseif hjf and has_attribute(curr, hanjabyhanjaattr) and is_hanja(c) then
-            hangul_space_skip(curr, hjf)
             curr.font = hjf
           elseif not char_in_font(curr.font, c) then
             local fbf = has_attribute(curr, fallbackfontattr) or false
             for _,f in ipairs{ hf, hjf, fbf } do
               if f and char_in_font(f, c) then
-                hangul_space_skip(curr, f)
                 curr.font = f
                 break
               end
@@ -765,6 +733,46 @@
           set_attribute(curr, unicodeattr, c)
         end
       end
+      newfont = curr.font
+    elseif id == glueid
+      and currfont ~= 0
+      and currfont ~= newfont
+      and currlang ~= nohyphen
+      and curr.subtype == spaceskip
+      -- fontloader's "node" mode sets space_stretch to zero
+      -- when the font is a monospaced font (fontspec's \setmonofont
+      -- command does the same thing), which we will bypass here
+      -- for alignment of CJK and Latin glyphs in verbatim environment.
+      -- See http://www.ktug.org/xe/index.php?document_srl=249772
+      and not fontoptions.monospaced[currfont] then
+
+      local params = getparameters(currfont)
+      local oldwd, oldst, oldsh, oldsto, oldsho = getglue(curr)
+      if params and oldsto == 0 and oldsho == 0 then
+        local p = getprev(curr)
+        local sf = p and p.char and tex.getsfcode(p.char) or 1000
+        if sf == 0 or sf > 1000 then
+          local p, pf = getprev(p), 0
+          while p and pf == 0 do
+            pf = p.char and tex.getsfcode(p.char) or 1000
+            p = getprev(p)
+          end
+          if sf == 0 then sf = pf end
+          if pf < 1000 then sf = 1000 end
+        end
+        if oldwd == (sf < 2000 and params.space or params.space+params.extra_space)
+          and oldst == texsp(params.space_stretch * (sf/1000))
+          and oldsh == texsp(params.space_shrink * (1000/sf)) then
+
+          local newwd = fontoptions.hangulspaceskip[newfont]
+          if newwd then
+            setglue(curr,
+                    sf < 2000 and newwd[1] or newwd[1]+newwd[4],
+                    texsp(newwd[2] * (sf/1000)),
+                    texsp(newwd[3] * (1000/sf)))
+          end
+        end
+      end
     elseif id == discid then
       process_fonts(curr.pre)
       process_fonts(curr.post)
@@ -1911,7 +1919,7 @@
     local voff = goffset - (v.width or 0)/2
     local bbox = descriptions[i] and descriptions[i].boundingbox or {0,0,0,0}
     local gid  = v.index
-    local tsb  = tsb_tab[gid].tsb
+    local tsb  = tsb_tab[gid] and tsb_tab[gid].tsb
     local hoff = tsb and (bbox[4] + tsb) * scale or ascender
     v.commands = {
       { "down", -voff },
@@ -1922,7 +1930,7 @@
       { "pop" },
       { "pdf", "Q" },
     }
-    local vw = tsb_tab[gid].ht
+    local vw = tsb_tab[gid] and tsb_tab[gid].ht
     v.width  = vw and vw * scale or quad
     local ht = bbox[3] * scale + voff
     local dp = bbox[1] * scale + voff

Modified: trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty	2023-09-11 21:18:21 UTC (rev 68242)
+++ trunk/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty	2023-09-11 21:18:30 UTC (rev 68243)
@@ -1,6 +1,6 @@
 % luatexko.sty
 %
-% Copyright (c) 2013-2022 Dohyun Kim <nomos at ktug org>
+% Copyright (c) 2013-2023 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 @@
 
 \ifdefined\luatexkohangulfontattr \endinput\fi
 \ifdefined\ProvidesPackage
-  \NeedsTeXFormat{LaTeX2e}[2021/06/01]
-  \ProvidesPackage{luatexko}[2022/11/01 v3.5 typesetting Korean with LuaTeX]
+  \NeedsTeXFormat{LaTeX2e}[2021/11/15]
+  \ProvidesPackage{luatexko}[2023/09/11 v3.6 typesetting Korean with LuaTeX]
   \RequirePackage{luatexbase}
   \RequirePackage{fontspec}[2020/02/03]
   \let\luatexkoselectfont\selectfont
@@ -229,6 +229,9 @@
   \global\advance\luatexkoulinecount\@ne
   \ifnum\luatexkoulinecount=\@ne \directlua{ luatexko.activate"uline" }\fi
   \begingroup
+  \ifx\luatexko at prev@ulinedown\ulinedown
+    \edef\ulinedown{\dimexpr\ulinedown+\ulinewidth+.15ex\relax}\fi
+  \let\luatexko at prev@ulinedown\ulinedown
   \count@=\luatexkoulinecount
   \leavevmode
   \setbox\z@\hbox{#1}%
@@ -933,8 +936,9 @@
     \let\luatexkodefaulthanjafont   \luatexkomainhanjafont
     \let\luatexkodefaultfallbackfont\luatexkomainfallbackfont
   \fi\fi
-  % hyperref
-  \@ifpackageloaded{hyperref}{\pdfstringdefDisableCommands{%
+}
+% hyperref
+\AddToHook{package/hyperref/after}{\pdfstringdefDisableCommands{%
     \let\ruby\@firstoftwo
     \let\xxruby\@firstoftwo
     \let\dotemph\@firstofone
@@ -966,9 +970,8 @@
     \let\addfallbackfontfeatures\@gobble
     \def\는{는}\def\은{은}\def\을{을}\def\를{를}\def\와{와}\def\과{과}%
     \def\가{가}\def\이{이}\def\라{라}\def\으{으}\def\로{로}%
-    \def\hellipsis{...}}}{}
-  \@ifpackageloaded{pxrubrica}{\let\ruby\jruby}{}
-}
+    \def\hellipsis{...}}}
+\AddToHook{package/pxrubrica/after}{\let\ruby\jruby}
 % misc
 \RequirePackage{kolabels-utf}
 \protected\def\hellipsis{\char"2026\char"2026 }



More information about the tex-live-commits mailing list.