From 5539e90b9707a375e00782a39510a63435afd840 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 14 Mar 2020 20:59:17 +0000 Subject: luatexko (14mar20) git-svn-id: svn://tug.org/texlive/trunk@54301 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/luatex/luatexko/luatexko-normalize.lua | 4 +- .../tex/luatex/luatexko/luatexko-uhc2utf8.lua | 4 +- Master/texmf-dist/tex/luatex/luatexko/luatexko.lua | 83 +++++++++++++--------- Master/texmf-dist/tex/luatex/luatexko/luatexko.sty | 2 +- 4 files changed, 54 insertions(+), 39 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/luatexko') diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua index 41e5d3498d6..0b4553f18f8 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua @@ -13,8 +13,8 @@ luatexbase.provides_module({ name = "luatexko-normalize", - version = "2.6", - date = "2020/02/17", + version = "2.7", + date = "2020/03/14", author = "Dohyun Kim, Soojin Nam", description = "Hangul normalization", license = "LPPL v1.3+", diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua index df71e43f9dd..70b30b96e33 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua @@ -13,8 +13,8 @@ luatexbase.provides_module({ name = "luatexko-uhc2utf8", - version = "2.6", - date = "2020/02/17", + version = "2.7", + date = "2020/03/14", author = "Dohyun Kim, Soojin Nam", description = "UHC (CP949) input encoding", license = "LPPL v1.3+", diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua index 3f21e7c970e..0720a4ecd9c 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua @@ -13,8 +13,8 @@ luatexbase.provides_module { name = 'luatexko', - date = '2020/02/17', - version = '2.6', + date = '2020/03/14', + version = '2.7', description = 'typesetting Korean with LuaTeX', author = 'Dohyun Kim, Soojin Nam', license = 'LPPL v1.3+', @@ -36,11 +36,9 @@ local insert_before = node.insert_before local nodecopy = node.copy local nodecount = node.count local nodefree = node.free -local nodeid = node.id local nodenew = node.new local noderemove = node.remove local nodeslide = node.slide -local nodesubtype = node.subtype local nodewrite = node.write local rangedimensions = node.rangedimensions local setglue = node.setglue @@ -83,19 +81,19 @@ local function warning (...) return module_warning("luatexko", stringformat(...)) end -local dirid = nodeid"dir" -local discid = nodeid"disc" -local glueid = nodeid"glue" -local glyphid = nodeid"glyph" -local hlistid = nodeid"hlist" -local kernid = nodeid"kern" -local mathid = nodeid"math" -local penaltyid = nodeid"penalty" -local ruleid = nodeid"rule" -local vlistid = nodeid"vlist" -local whatsitid = nodeid"whatsit" -local literal_whatsit = nodesubtype"pdf_literal" -local user_whatsit = nodesubtype"user_defined" +local dirid = node.id"dir" +local discid = node.id"disc" +local glueid = node.id"glue" +local glyphid = node.id"glyph" +local hlistid = node.id"hlist" +local kernid = node.id"kern" +local mathid = node.id"math" +local penaltyid = node.id"penalty" +local ruleid = node.id"rule" +local vlistid = node.id"vlist" +local whatsitid = node.id"whatsit" +local literal_whatsit = node.subtype"pdf_literal" +local user_whatsit = node.subtype"user_defined" local directmode = 2 local fontkern = 0 local userkern = 1 @@ -1125,10 +1123,8 @@ local josa_code = setmetatable({ end end }) -local ignore_parens = false - -local function prevjosacode (n, parenlevel) - local parenlevel, josacode = parenlevel or 0 +local function prevjosacode (n, parenlevel, ignore_parens) + local josacode while n do local id = n.id if id == glyphid then @@ -1144,7 +1140,7 @@ local function prevjosacode (n, parenlevel) elseif id == hlistid or id == vlistid then local list = n.list if list then - josacode, parenlevel = prevjosacode(nodeslide(list), parenlevel) + josacode, parenlevel = prevjosacode(nodeslide(list), parenlevel, ignore_parens) if josacode then break end end end @@ -1170,8 +1166,7 @@ local function process_josa (head) end local t = josa_table[cc] if t then - ignore_parens = autojosaattr > 0 - cc = t[prevjosacode(getprev(curr)) or 3] + cc = t[prevjosacode(getprev(curr), 0, autojosaattr > 0) or 3] if cc then curr.char = cc else @@ -1976,13 +1971,33 @@ local font_opt_procs = { } local font_opt_procs_single = { - expansion = function() + expansion = function(fontdata) + if is_harf(fontdata) then -- for now, no support in harf mode + local val = option_in_font(fontdata, "expansion") + local setup = fonts.expansions.setups[val] or {} + fontdata.stretch = fontdata.stretch or (setup.stretch or 2)*10 + fontdata.shrink = fontdata.shrink or (setup.shrink or 2)*10 + fontdata.step = fontdata.step or (setup.step or .5)*10 + end if tex.adjustspacing == 0 then texset("global", "adjustspacing", 2) end end, protrusion = function(fontdata) + if is_harf(fontdata) then -- for now, no support in harf mode + local val = option_in_font(fontdata, "protrusion") + local setup = fonts.protrusions.setups[val] or {} + local quad = fontdata.parameters.quad + for i, v in pairs(setup) do + local chr = fontdata.characters[i] + if chr then + local wdq = chr.width/quad + chr.left_protruding = chr.left_protruding or wdq*v[1]*1000 + chr.right_protruding = chr.right_protruding or wdq*v[2]*1000 + end + end + end if tex.protrudechars == 0 then texset("global", "protrudechars", 2) end @@ -2043,17 +2058,17 @@ add_to_callback("luaotfload.patch_font_unsafe", process_patch_font, local auxiliary_procs = { dotemph = { - hpack_filter = process_dotemph, - vpack_filter = process_dotemph, + hpack_filter = process_dotemph, + post_linebreak_filter = process_dotemph, }, uline = { - hpack_filter = process_uline, - vpack_filter = process_uline, + hpack_filter = process_uline, + post_linebreak_filter = process_uline, }, ruby = { - pre_linebreak_filter = process_ruby_pre_linebreak, - hpack_filter = process_ruby_post_linebreak, - vpack_filter = process_ruby_post_linebreak, + pre_linebreak_filter = process_ruby_pre_linebreak, + hpack_filter = process_ruby_post_linebreak, + post_linebreak_filter = process_ruby_post_linebreak, }, autojosa = { luatexko_hpack_first = process_josa, @@ -2070,7 +2085,7 @@ local function activate (name) local fun if cbnam == "hpack_filter" then fun = function(h, gc) - if gc == "align_set" then + if gc == "hbox" or gc == "adjusted_hbox" or gc == "align_set" then h = cbfun(h) end return h @@ -2118,7 +2133,7 @@ local function deactivate_all (str) luatexko.deactivated = {} for _, name in ipairs{ "hpack_filter", "pre_linebreak_filter", - "vpack_filter", + "post_linebreak_filter", "hyphenate", "luaotfload.patch_font_unsafe", -- added for harf "luaotfload.patch_font" } do diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty index 61835450fb6..dd25d17b77c 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty @@ -14,7 +14,7 @@ \ifdefined\luatexkohangulfontattr \endinput\fi \ifdefined\selectfont \NeedsTeXFormat{LaTeX2e}[2020/02/02] - \ProvidesPackage{luatexko}[2020/02/17 v2.6 typesetting Korean with LuaTeX] + \ProvidesPackage{luatexko}[2020/03/14 v2.7 typesetting Korean with LuaTeX] \RequirePackage{luatexbase} \RequirePackage{fontspec}[2020/02/03] \else -- cgit v1.2.3