summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-14 22:11:33 +0000
committerKarl Berry <karl@freefriends.org>2016-05-14 22:11:33 +0000
commita250d691586dcb9dc789cd1c6b3a129ac4afc424 (patch)
tree38631e99016ad6201aec39a18aac75510e741487 /Master/texmf-dist
parent7018dd6ace780dbf792b16f2c70294d5363db14c (diff)
luatexko (14may16)
git-svn-id: svn://tug.org/texlive/trunk@41128 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/ChangeLog6
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/README2
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdfbin215106 -> 214189 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex4
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty58
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua43
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty2
7 files changed, 64 insertions, 51 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
index 7433a4e72e6..dd793e100f4 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
+++ b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-14 Dohyun Kim <nomos at ktug org>
+
+ Version 1.15
+
+ * luatexko-core.sty: allow nested underline emphasis
+
2016-05-08 Dohyun Kim <nomos at ktug org>
Version 1.14
diff --git a/Master/texmf-dist/doc/luatex/luatexko/README b/Master/texmf-dist/doc/luatex/luatexko/README
index 835a27262a5..c7d32742839 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/README
+++ b/Master/texmf-dist/doc/luatex/luatexko/README
@@ -1,4 +1,4 @@
-LuaTeX-ko Package version 1.14 (2016/05/08)
+LuaTeX-ko Package version 1.15 (2016/05/14)
===========================================
This is a Lua(La)TeX macro package that supports typesetting Korean
diff --git a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf
index 3738364e449..75eaa002f71 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
index e79c494dc81..0464cf01d03 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
+++ b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
@@ -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.14\quad 2016/05/08}
+\date{Version 1.15\quad 2016/05/14}
\maketitle
\begin{quote}\small
@@ -451,7 +451,7 @@ ulem 패키지가 \luatexko와 궁합이 잘 맞지 않아{\small (줄바꿈에
관련하여 다음 설정을 할 수 있다.
-①~|\def\ulinedown{0.25em}|: 밑줄을 베이스라인 아래로 끌어내리는 정도
+①~|\def\ulinedown{0.24em}|: 밑줄을 베이스라인 아래로 끌어내리는 정도
②~|\def\ulinewidth{0.04em}|: 밑줄의 굵기
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
index bec7d1206b2..06e7e1e65a0 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
@@ -17,7 +17,7 @@
\ifcsname ifpdf\endcsname\else \input ifpdf.sty \fi
\catcode`@ = 11
\else
- \ProvidesPackage{luatexko-core}[2016/05/08 v1.14 Typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko-core}[2016/05/14 v1.15 Typesetting Korean with LuaTeX]
\RequirePackage{luaotfload}[2016/04/21]
\RequirePackage{ifpdf}
\fi
@@ -268,47 +268,51 @@
%% ulem doesn't work well with luatexko;
%% especially linebreak does not occur inside cjk words.
\def\ulinewidth{0.04em }
-\def\ulinedown {0.25em }
+\def\ulinedown {0.24em }
\newcount\luakoulineboxcnt\luakoulineboxcnt\z@
-\protected\def\uline#1{%
+\chardef\luako@uline@level\z@ % for nested uline
+\def\luako@nested@ulinedown{% must be used in a group
+ \ifcase\luako@uline@level\else
+ \edef\ulinedown{\the\dimexpr\ulinedown+0.1em\relax}%
+ \fi
+ \chardef\luako@uline@level\@ne}
+\def\luako@uline@code@common{%
\begingroup
\ifnum\luakoulineboxcnt > 65535 \luakoulineboxcnt\z@ \fi
\global\advance\luakoulineboxcnt\@ne
- \edef\luako@temp@{\the\luakoulineboxcnt}%
- \leavevmode
+ \count@\luakoulineboxcnt
+ \leavevmode}
+\protected\def\uline#1{%
+ \luako@uline@code@common
+ \luako@nested@ulinedown
\dimen@\dimexpr\ulinedown+\ulinewidth\relax
\dimen@ii-\dimexpr\ulinedown\relax
- \setbox\z@\hbox{\vrule width0pt height\dimen@ii depth\dimen@}%
- \directlua{ luatexko.ulinebox[\luako@temp@]=node.copy_list(tex.box[0].head)
- luatexko.uline_boundary(\luako@temp@,true) }%
+ \setbox\z@\hbox{\vrule width\z@ height\dimen@ii depth\dimen@}%
+ \directlua{ luatexko.uline_boundary(\the\count@,tex.box[0].head) }%
#1%
- \directlua{ luatexko.uline_boundary(\luako@temp@,false) }%
+ \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}}}
% ulem with arbitray box
\protected\def\markoverwith#1#2{%
- \begingroup
- \ifnum\luakoulineboxcnt > 65535 \luakoulineboxcnt\z@ \fi
- \global\advance\luakoulineboxcnt\@ne
- \edef\luako@temp@{\the\luakoulineboxcnt}%
- \leavevmode
+ \luako@uline@code@common
\setbox\z@\hbox{#1}%
- \directlua{ luatexko.ulinebox[\luako@temp@]=node.copy_list(tex.box[0])
- luatexko.uline_boundary(\luako@temp@,true) }%
+ \directlua{ luatexko.uline_boundary(\the\count@,tex.box[0]) }%
#2%
- \directlua{ luatexko.uline_boundary(\luako@temp@,false) }%
+ \directlua{ luatexko.uline_boundary(\the\count@) }%
\endgroup}
-\protected\def\uuline{\dimen@ii-\dimexpr\ulinedown\relax
- \dimen@\dimexpr\ulinedown+\ulinewidth\relax
- \markoverwith{\vtop{\hrule width.1em height\dimen@ii depth\dimen@
- \kern.1em\hrule height\dimen@ii depth\dimen@}}}
-\protected\def\uwave {\ifx\ltxko@sixly\undefined \font\ltxko@sixly=lasy6 \fi
+\protected\def\uwave{\ifx\ltxko@sixly\undefined \font\ltxko@sixly=lasy6 \fi
\markoverwith{\lower4\p@\hbox{\ltxko@sixly\char58}}}
-\protected\def\xout {\markoverwith{\hbox to.35em{/\hss}}}
-\protected\def\dashuline{\markoverwith{\kern.125em\vtop{\kern\ulinedown
- \hrule width.3em height\z@ depth\ulinewidth}\kern.125em}}
-\protected\def\dotuline{\dimen@\dimexpr\ulinedown+0.1ex\relax
- \markoverwith{\lower\dimen@\hbox{\kern.1em .\kern.04em}}}
+\protected\def\xout {\markoverwith{\hbox to.35em{/\hss}}}
+\protected\def\dashuline#1{\begingroup
+ \luako@nested@ulinedown
+ \markoverwith{\kern.125em\vtop{\kern\ulinedown
+ \hrule width.3em height\z@ depth\ulinewidth}\kern.125em}{#1}\endgroup}
+\protected\def\dotuline#1{\begingroup
+ \luako@nested@ulinedown
+ \dimen@\dimexpr\ulinedown+0.1ex\relax
+ \markoverwith{\lower\dimen@\hbox{\kern.1em .\kern.04em}}{#1}\endgroup}
%% hangul font -- core
\def\luatexko@hangul@selectfont{%
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index 0be96ddbd0d..0888aec134a 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 = '2016/05/08',
- version = '1.14',
+ date = '2016/05/14',
+ version = '1.15',
description = 'Korean linebreaking and font-switching',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -23,10 +23,9 @@ luatexbase.provides_module {
luatexko = luatexko or {}
local luatexko = luatexko
-local dotemphnode,rubynode,ulinebox = {},{},{}
+local dotemphnode,rubynode = {},{}
luatexko.dotemphnode = dotemphnode
luatexko.rubynode = rubynode
-luatexko.ulinebox = ulinebox
local stringbyte = string.byte
local stringchar = string.char
@@ -52,6 +51,7 @@ local fallbackfntattr = luatexbase.attributes.fallbackfntattr
local hangulpunctsattr = luatexbase.attributes.hangulpunctsattr
local luakoglueattr = luatexbase.new_attribute("luakoglueattr")
local luakounicodeattr = luatexbase.new_attribute("luakounicodeattr")
+local luakoulineattr = luatexbase.new_attribute("luakoulineattr")
local function warn (...)
return luatexbase.module_warning("luatexko", stringformat(...))
@@ -84,6 +84,7 @@ local penaltynode = node.id("penalty")
local rulenode = node.id("rule")
local whatsitnode = node.id("whatsit")
local user_whatsit = node.subtype("user_defined")
+local n_copy_list = node.copy_list
local nodedirect = node.direct
local d_todirect = nodedirect.todirect
@@ -1487,6 +1488,7 @@ local function nanumtype1font(curr)
local currchar, currfont = d_getchar(curr), d_getfont(curr)
if currchar > 0xFFFF then return end
local fnt_t = get_font_table(currfont)
+ if not fnt_t then return end
local family = (d_has_attribute(curr,finemathattr) or 0) > 1 and not is_hanja(currchar) and "nanummj" or "nanumgt"
local series = fnt_t.shared and
fnt_t.shared.rawdata and
@@ -1812,11 +1814,12 @@ end
local uline_start_id = luatexbase.new_whatsit("luako_uline_start")
local uline_stop_id = luatexbase.new_whatsit("luako_uline_stop")
-local function uline_boundary (num, start)
- local n = d_nodenew(whatsitnode, user_whatsit) -- todo: use node list
- d_setfield(n, "user_id", start and uline_start_id or uline_stop_id)
- d_setfield(n, "type", 100)
- d_setfield(n, "value", num)
+local function uline_boundary (num, list)
+ local n = d_nodenew(whatsitnode, user_whatsit)
+ d_setfield(n, "user_id", list and uline_start_id or uline_stop_id)
+ d_setfield(n, "type", 110) -- node list
+ d_setfield(n, "value", n_copy_list(list))
+ d_set_attribute(n, luakoulineattr, num)
d_nodewrite(n)
end
luatexko.uline_boundary = uline_boundary
@@ -1852,17 +1855,17 @@ local function after_linebreak_underline(head,glueorder,glueset,gluesign,ulstart
level+1)
d_setlist(curr, newhead)
elseif currid == whatsitnode and d_getsubtype(curr) == user_whatsit then
- local user_id = d_getfield(curr, "user_id")
+ local attr = d_has_attribute(curr, luakoulineattr)
local whatsit_type = d_getfield(curr, "type")
- local num = d_getfield(curr, "value")
- if num and ulinebox[num] and whatsit_type == 100 then
+ if attr and whatsit_type == 110 then
+ local user_id = d_getfield(curr, "user_id")
if user_id == uline_start_id then
- ulstart[num] = { start = curr, level = level }
- elseif user_id == uline_stop_id and ulstart[num] then
- local ubox = d_todirect(ulinebox[num])
- head = draw_underline(head,curr,glueset,gluesign,glueorder,ubox,ulstart[num].start)
- d_nodefree(ubox)
- ulinebox[num], ulstart[num] = nil, nil
+ local list = d_getfield(curr, "value")
+ ulstart[attr] = { start = curr, list = list, level = level }
+ elseif user_id == uline_stop_id and ulstart[attr] then
+ local ubox, start = ulstart[attr].list, ulstart[attr].start
+ head = draw_underline(head,curr,glueset,gluesign,glueorder,ubox,start)
+ ulstart[attr] = nil
end
end
end
@@ -1870,9 +1873,9 @@ local function after_linebreak_underline(head,glueorder,glueset,gluesign,ulstart
local curr = d_nodetail(head)
for i, v in pairs(ulstart) do
- local ubox = d_todirect(ulinebox[i])
+ local ubox, start = v.list, v.start
if ubox and level == v.level then
- head = draw_underline(head,curr,glueset,gluesign,glueorder,ubox,v.start)
+ head = draw_underline(head,curr,glueset,gluesign,glueorder,ubox,start)
ulstart[i].start = nil
end
end
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index 9101bbe65ac..d6a3a0dbe8f 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
@@ -23,7 +23,7 @@
\expandafter\endinput
\fi
-\ProvidesPackage{luatexko}[2016/05/08 v1.14 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2016/05/14 v1.15 Typesetting Korean with LuaLaTeX]
\ifdefined\adjustspacing\else % luatex < 0.87
\let\adjustspacing\pdfadjustspacing