summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/ChangeLog7
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/README2
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdfbin214900 -> 215106 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex10
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty29
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua91
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty2
7 files changed, 84 insertions, 57 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
index 0b797e463da..7433a4e72e6 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
+++ b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
@@ -1,3 +1,10 @@
+2016-05-08 Dohyun Kim <nomos at ktug org>
+
+ Version 1.14
+
+ * luatexko.lua, luatexko-core.sty: more updates for luatex 0.95,
+ user_defined whatsit intead of special whatsit
+
2016-04-25 Dohyun Kim <nomos at ktug org>
Version 1.13
diff --git a/Master/texmf-dist/doc/luatex/luatexko/README b/Master/texmf-dist/doc/luatex/luatexko/README
index 0bdecbbe7cd..835a27262a5 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.13 (2016/04/25)
+LuaTeX-ko Package version 1.14 (2016/05/08)
===========================================
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 bf5864bb262..3738364e449 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 40171f9d3e8..e79c494dc81 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
+++ b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
@@ -20,19 +20,19 @@
InterLatinCJK=.125em,
Expansion, Protrusion,
]
-\setsanshangulfont{Source Han Sans K}[
+\setsanshangulfont{Noto Sans CJK KR}[
CharRaise=-0.1ex,
Script=Hangul,
Language=Korean,
- UprightFont=* Normal,
+ UprightFont=* DemiLight,
BoldFont=* Bold,
InterLatinCJK=.125em,
]
\setmonofont{Inconsolatazi4}[
Color=191970, % MidnightBlue
]
-\setmonohangulfont{Source Han Sans K}[
- UprightFont=* Normal,
+\setmonohangulfont{Noto Sans CJK KR}[
+ UprightFont=* DemiLight,
BoldFont=* Bold,
CharRaise=-.25ex,
Color=191970, % MidnightBlue
@@ -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.13\quad 2016/04/25}
+\date{Version 1.14\quad 2016/05/08}
\maketitle
\begin{quote}\small
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
index e34a222ef35..bec7d1206b2 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/04/25 v1.13 Typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko-core}[2016/05/08 v1.14 Typesetting Korean with LuaTeX]
\RequirePackage{luaotfload}[2016/04/21]
\RequirePackage{ifpdf}
\fi
@@ -271,27 +271,36 @@
\def\ulinedown {0.25em }
\newcount\luakoulineboxcnt\luakoulineboxcnt\z@
\protected\def\uline#1{%
+ \begingroup
\ifnum\luakoulineboxcnt > 65535 \luakoulineboxcnt\z@ \fi
\global\advance\luakoulineboxcnt\@ne
+ \edef\luako@temp@{\the\luakoulineboxcnt}%
+ \leavevmode
\dimen@\dimexpr\ulinedown+\ulinewidth\relax
\dimen@ii-\dimexpr\ulinedown\relax
- \setbox\z@\hbox{\vrule width\z@ height\dimen@ii depth\dimen@}%
- \directlua{luatexko.ulinebox[\the\luakoulineboxcnt]=node.copy_list(tex.box[0].head)}%
- \leavevmode\special{luako:ulinebegin=\the\luakoulineboxcnt}%
- #1\special{luako:ulineend}}
-% strike-out
+ \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) }%
+ #1%
+ \directlua{ luatexko.uline_boundary(\luako@temp@,false) }%
+ \endgroup}
\protected\def\sout#1{{\def\ulinedown{-0.5ex-\ulinewidth/2}\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
\setbox\z@\hbox{#1}%
- \directlua{luatexko.ulinebox[\the\luakoulineboxcnt]=node.copy_list(tex.box[0])}%
- \leavevmode\special{luako:ulinebegin=\the\luakoulineboxcnt}%
- #2\special{luako:ulineend}}
+ \directlua{ luatexko.ulinebox[\luako@temp@]=node.copy_list(tex.box[0])
+ luatexko.uline_boundary(\luako@temp@,true) }%
+ #2%
+ \directlua{ luatexko.uline_boundary(\luako@temp@,false) }%
+ \endgroup}
\protected\def\uuline{\dimen@ii-\dimexpr\ulinedown\relax
\dimen@\dimexpr\ulinedown+\ulinewidth\relax
- \markoverwith{\vtop{\hrule width.2em height\dimen@ii depth\dimen@
+ \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
\markoverwith{\lower4\p@\hbox{\ltxko@sixly\char58}}}
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index a9ad5ab6229..0be96ddbd0d 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/04/25',
- version = '1.13',
+ date = '2016/05/08',
+ version = '1.14',
description = 'Korean linebreaking and font-switching',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -83,7 +83,7 @@ local kernnode = node.id("kern")
local penaltynode = node.id("penalty")
local rulenode = node.id("rule")
local whatsitnode = node.id("whatsit")
-local whatsitspecial = node.subtype("special")
+local user_whatsit = node.subtype("user_defined")
local nodedirect = node.direct
local d_todirect = nodedirect.todirect
@@ -121,6 +121,7 @@ local d_end_of_math = nodedirect.end_of_math
local d_nodetail = nodedirect.tail
local d_nodedimensions = nodedirect.dimensions
local d_nodefree = nodedirect.free
+local d_nodewrite = nodedirect.write
local emsize = 655360
@@ -1808,65 +1809,75 @@ end
---------------------
-- underline emphasis
---------------------
-local function draw_underline(head,curr,width,ubox,ulstart)
+
+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)
+ d_nodewrite(n)
+end
+luatexko.uline_boundary = uline_boundary
+
+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
+ end
+ local width = d_nodedimensions(glueset,gluesign,glueorder,start,curr)
if width and width > 0 then
local glue = d_get_gluenode(width)
d_setsubtype(glue, 101) -- cleaders
d_setleader(glue, d_copy_node(ubox))
- head = d_insert_before(head, ulstart, glue)
- head = d_insert_before(head, ulstart, d_get_kernnode(-width))
- end
- for _,nd in ipairs({ulstart,curr}) do
- if d_getid(nd) == whatsitnode and d_getsubtype(nd) == whatsitspecial then
- local nddata = d_getfield(nd,"data")
- if nddata and nddata:find("luako:uline") then
- head = d_remove_node(head,nd)
- d_nodefree(nd)
- end
- end
+ head = d_insert_before(head, start, glue)
+ head = d_insert_before(head, start, d_get_kernnode(-width))
end
return head
end
-local function after_linebreak_underline(head,glueorder,glueset,gluesign,ulinenum)
- local ulstart = ulinenum and head
- if ulstart and d_getid(ulstart) == gluenode then
- ulstart = d_getnext(ulstart)
- end
+local function after_linebreak_underline(head,glueorder,glueset,gluesign,ulstart,level)
+ ulstart, level = ulstart or {}, level or 0
+
for curr in d_traverse(head) do
local currid = d_getid(curr)
- if currid == hlistnode and not ulstart then -- skip nested hbox
+ if currid == hlistnode then
local newhead
- newhead,ulinenum = after_linebreak_underline(
+ newhead, ulstart = after_linebreak_underline(
d_getlist(curr),
d_getfield(curr,"glue_order"),
d_getfield(curr,"glue_set"),
d_getfield(curr,"glue_sign"),
- ulinenum)
+ ulstart,
+ level+1)
d_setlist(curr, newhead)
- elseif currid == whatsitnode and d_getsubtype(curr) == whatsitspecial then
- local currdata = d_getfield(curr,"data")
- if currdata then
- if currdata:find("luako:ulinebegin=") then
- ulinenum = tonumber(currdata:match("(%d+)"))
- ulinenum = ulinebox[ulinenum] and ulinenum
- ulstart = ulinenum and curr
- elseif ulstart and ulinenum and currdata:find('luako:ulineend') then
- local ubox = d_todirect(ulinebox[ulinenum])
- local wd = d_nodedimensions(glueset,gluesign,glueorder,ulstart,curr)
- head = draw_underline(head,curr,wd,ubox,ulstart)
+ elseif currid == whatsitnode and d_getsubtype(curr) == user_whatsit then
+ local user_id = d_getfield(curr, "user_id")
+ local whatsit_type = d_getfield(curr, "type")
+ local num = d_getfield(curr, "value")
+ if num and ulinebox[num] and whatsit_type == 100 then
+ 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[ulinenum], ulinenum, ulstart = nil, nil, nil
+ ulinebox[num], ulstart[num] = nil, nil
end
end
end
- if ulstart and ulinenum and curr == d_nodetail(head) then
- local ubox = d_todirect(ulinebox[ulinenum])
- local wd = d_nodedimensions(glueset,gluesign,glueorder,ulstart,curr)
- head = draw_underline(head,curr,wd,ubox,ulstart)
+ end
+
+ local curr = d_nodetail(head)
+ for i, v in pairs(ulstart) do
+ local ubox = d_todirect(ulinebox[i])
+ if ubox and level == v.level then
+ head = draw_underline(head,curr,glueset,gluesign,glueorder,ubox,v.start)
+ ulstart[i].start = nil
end
end
- return head, ulinenum
+
+ return head, ulstart
end
-----------------------------------
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index cdedc21db6d..9101bbe65ac 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/04/25 v1.13 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2016/05/08 v1.14 Typesetting Korean with LuaLaTeX]
\ifdefined\adjustspacing\else % luatex < 0.87
\let\adjustspacing\pdfadjustspacing