summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexko
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-20 22:04:14 +0000
committerKarl Berry <karl@freefriends.org>2013-05-20 22:04:14 +0000
commitdfc4de48df122c4541cc1d44ab0c498a43582a47 (patch)
tree3564307f58b85565b2b9c7badb0ea0c399f4a64d /Master/texmf-dist/tex/luatex/luatexko
parentf78323b8060c819726a015d8b6cfa051bb94ddda (diff)
luatexko (20may13)
git-svn-id: svn://tug.org/texlive/trunk@30597 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexko')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty46
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua32
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty19
5 files changed, 29 insertions, 72 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
index 2a837045d5a..bff0ddebdcc 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
@@ -1,4 +1,4 @@
-% $Id: luatexko-core.sty,v 1.22 2012/11/23 05:06:02 nomos Exp $
+% luatexko-core.sty
%
% Copyright (c) 2013 Dohyun Kim <nomos at ktug org>
%
@@ -14,7 +14,7 @@
\input luaotfload.sty
\catcode`@ = 11
\else
- \ProvidesPackage{luatexko-core}[2013/05/10 v1.0 Typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko-core}[2013/05/19 v1.1 Typesetting Korean with LuaTeX]
\RequirePackage{luaotfload}
\fi
@@ -224,25 +224,8 @@
\check@hangul@family
\ifdefined\hangul@font \hangul@font \fi
\expandafter\endgroup
- \directlua{
- local i = font.current()
- local name = fonts.hashes.identifiers[i]
- name = name and name.properties and name.properties.name
- luatexko.tmpfntname = name or "luatexkodefault"
- }%
- \directlua{
- local name = luatexko.tmpfntname
- local hang = luatexko.hangulfont[name]
- if hang then
- tex.setattribute("hangfntattr", hang)
- else
- local c = luatexko.hangulcount
- c = c + 1
- luatexko.hangulcount = c
- tex.setattribute("hangfntattr",c)
- luatexko.hangulfont[name] = c
- luatexko.hangulfont[c] = name
- end }%
+ \directlua{ luatexko.cjkfontidtmp = font.current() }%
+ \hangfntattr\directlua{ tex.sprint(luatexko.cjkfontidtmp) }\relax
}
\def\luatexko@hanja@selectfont{%
\begingroup
@@ -251,25 +234,8 @@
\check@hanja@family
\ifdefined\hanja@font \hanja@font \fi
\expandafter\endgroup
- \directlua{
- local i = font.current()
- local name = fonts.hashes.identifiers[i]
- name = name and name.properties and name.properties.name
- luatexko.tmpfntname = name or "luatexkodefault"
- }%
- \directlua{
- local name = luatexko.tmpfntname
- local hanj = luatexko.hangulfont[name]
- if hanj then
- tex.setattribute("hanjfntattr", hanj)
- else
- local c = luatexko.hangulcount
- c = c + 1
- luatexko.hangulcount = c
- tex.setattribute("hanjfntattr",c)
- luatexko.hangulfont[name] = c
- luatexko.hangulfont[c] = name
- end }%
+ \directlua{ luatexko.cjkfontidtmp = font.current() }%
+ \hanjfntattr\directlua{ tex.sprint(luatexko.cjkfontidtmp) }\relax
\ifnum\cjtypesetattr>\z@\luatexkolatinspaceskip\fi
}
\let\check@hangul@family\relax
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
index 85533605571..e131ec384fd 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
@@ -1,4 +1,4 @@
--- $Id: luatexko-normalize.lua,v 1.5 2012/06/01 08:31:05 nomos Exp $
+-- luatexko-normalize.lua
--
-- Copyright (c) 2013 Dohyun Kim <nomos at ktug org>
--
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
index 9f792d0397d..9f498132132 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
@@ -1,4 +1,4 @@
--- $Id: luatexko-uhc2utf8.lua,v 1.4 2011/07/08 15:23:52 nomos Exp $
+-- luatexko-uhc2utf8.lua
--
-- Copyright (c) 2013 Dohyun Kim <nomos at ktug org>
--
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index 98000fc1a98..1165d706bd7 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
@@ -1,4 +1,4 @@
--- $Id: luatexko.lua,v 1.29 2012/12/13 09:13:22 nomos Exp $
+-- luatexko.lua
--
-- Copyright (c) 2013 Dohyun Kim <nomos at ktug org>
--
@@ -14,8 +14,8 @@ module('luatexko', package.seeall)
local err,warn,info,log = luatexbase.provides_module({
name = 'luatexko',
- date = '2013/05/10',
- version = 1.0,
+ date = '2013/05/19',
+ version = '1.1',
description = 'Korean linebreaking and font-switching',
author = 'Dohyun Kim',
license = 'LPPL v1.3+',
@@ -88,8 +88,6 @@ local emsize = 655360
dotemphnode = {}
rubynode = {}
ulinebox = {}
-hangulfont = {}
-hangulcount = 0
hanjafontforhanja = false
local cjkclass = {
@@ -1355,10 +1353,8 @@ local hangulfontlist = {}
local function font_substitute(head)
for curr in traverse_id(glyphnode, head) do
local eng = get_font_table(curr.font)
- local engsize = eng and eng.size
local engfontchar = get_font_char(curr.font, curr.char)
- if not engsize then -- no font table of plain tex cm font
- engsize = tex_sp(tex.pdffontsize(font.current()))
+ if not eng then -- no font table of plain tex cm font
engfontchar = get_cjk_class(curr.char) == 10
end
if curr.char and not engfontchar then
@@ -1366,29 +1362,13 @@ local function font_substitute(head)
local hangul = has_attribute(curr, hangfntattr)
local hanja = has_attribute(curr, hanjfntattr)
local ftable = {hangul, hanja}
-
if hanjafontforhanja then
local uni = get_unicode_char(curr)
uni = uni and get_cjk_class(uni)
if uni and uni < 7 then ftable = {hanja, hangul} end
end
- for _,fallback in ipairs(ftable) do
- local fkey = fallback and hangulfont[fallback]
- if fkey then
- local fname, fsize = stringmatch(fkey, "(.+) at (.+)")
- if not fname then fname = fkey end
- if fsize then
- fsize = tex_sp(fsize)
- else
- fsize = engsize
- end
- fkey = fname .. "@" .. fsize
- local fid = hangulfontlist[fkey]
- if not fid then
- fid = font_define_func(fname, fsize, font.nextid())
- if type(fid) == "table" then fid = fontdefine(fid) end
- hangulfontlist[fkey] = fid
- end
+ for _,fid in ipairs(ftable) do
+ if fid then
local c = get_font_char(fid, curr.char)
if c then
korid = true
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index 25ca8590bdd..f00c5356cce 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
@@ -1,4 +1,4 @@
-% $Id: luatexko.sty,v 1.39 2012/11/23 05:06:02 nomos Exp $
+% luatexko.sty
%
% Copyright (c) 2013 Dohyun Kim <nomos at ktug org>
%
@@ -22,7 +22,7 @@
\expandafter\endinput
\fi
-\ProvidesPackage{luatexko}[2013/05/10 v1.0 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2013/05/19 v1.1 Typesetting Korean with LuaLaTeX]
\RequirePackage{fontspec}
\RequirePackage{luatexko-core}
@@ -150,7 +150,8 @@
\luatexko@hangul@selectfont\luatexko@hanja@selectfont}
% don't forget to redefine \normalfont
-\protected\edef\normalfont{\unexpanded{\let\hangul@font\luatexko@undefined}%
+\protected\edef\normalfont{\unexpanded{%
+ \let\hangul@font\luatexko@undefined\let\hanja@font\luatexko@undefined}%
\unexpanded\expandafter{\normalfont}}
\let\reset@font\normalfont
@@ -232,7 +233,17 @@
\let\uwave\@firstofone
\let\dashuline\@firstofone
\let\dotuline\@firstofone
- \let\autojosaattr\@firstofone
+ \def\는{는}%
+ \def\은{은}%
+ \def\을{을}%
+ \def\를{를}%
+ \def\와{와}%
+ \def\과{과}%
+ \def\가{가}%
+ \def\이{이}%
+ \def\라{라}%
+ \def\으{으}%
+ \def\로{로}%
}}{}
}