summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-11-09 21:55:06 +0000
committerKarl Berry <karl@freefriends.org>2018-11-09 21:55:06 +0000
commit028576d9c85a4b968d5ed3ee3b916ffe92fbf378 (patch)
tree7bd0b38ace9ba73064e13b799f856160a2ca261e /Master/texmf-dist/tex/luatex
parent29a130c2612ca597fcf45f1b38e93259358a3f2e (diff)
luatexko (9nov18)
git-svn-id: svn://tug.org/texlive/trunk@49116 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty12
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua25
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty2
3 files changed, 28 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty
index b91570c9b80..59a485e7574 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}[2018/04/19 v1.20 Typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko-core}[2018/11/09 v1.22 Typesetting Korean with LuaTeX]
\RequirePackage{luaotfload}[2016/04/21]
\RequirePackage{ifpdf}
\fi
@@ -419,6 +419,16 @@
\directlua{ luatexkouhc2utf8.start_uhc_filename() }%
\fi}
+%% use hangul font for hangul chars
+\def\hangulfontforhangul{\afterassignment\h@ngul@fontforh@ngul\count@}
+\let\hangulbyhangulfont\hangulfontforhangul
+\def\h@ngul@fontforh@ngul{%
+ \ifcase\count@
+ \directlua{ luatexko.hangulfontforhangul = false }%
+ \else
+ \directlua{ luatexko.hangulfontforhangul = true }%
+ \fi}
+
%% use hanja font for hanja chars
\def\hanjafontforhanja{\afterassignment\h@nj@fontforh@nj@\count@}
\let\hanjabyhanjafont\hanjafontforhanja
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index 4ad352e08af..f7bc8eef39f 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 = '2018/04/19',
- version = '1.20',
+ date = '2018/11/09',
+ version = '1.22',
description = 'Korean linebreaking and font-switching',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -1513,25 +1513,32 @@ local function font_substitute(head)
d_setfield(curr, "font", prevfont) -- sync font
end
else
- local myfontchar
+ local myfontchar, forcehangul, forcehanja
local eng = currfont and get_font_table(currfont)
if eng and eng.encodingbytes and eng.encodingbytes == 2 -- exclude type1
and hangulpunctuations[currchar] and d_has_attribute(curr, hangulpunctsattr)
and (d_has_attribute(curr, finemathattr) or 0) > 0 -- not ttfamily
and not get_font_char(currfont, 0xAC00) then -- exclude hangul font
else
- myfontchar = get_font_char(currfont, currchar)
+ if luatexko.hangulfontforhangul or luatexko.hanjafontforhanja then
+ local uni = d_get_unicode_char(curr)
+ uni = uni and get_cjk_class(uni) or 10
+ if uni < 7 then
+ forcehanja = luatexko.hanjafontforhanja
+ elseif uni < 10 then
+ forcehangul = luatexko.hangulfontforhangul
+ end
+ end
+ if not forcehangul and not forcehanja then
+ myfontchar = get_font_char(currfont, currchar)
+ end
end
if not myfontchar then
local hangul = d_has_attribute(curr, hangulfntattr)
local hanja = d_has_attribute(curr, hanjafntattr)
local fallback = d_has_attribute(curr, fallbackfntattr)
local ftable = {hangul, hanja, fallback}
- if luatexko.hanjafontforhanja then
- local uni = d_get_unicode_char(curr)
- uni = uni and get_cjk_class(uni)
- if uni and uni < 7 then ftable = {hanja, hangul, fallback} end
- end
+ if forcehanja then ftable = {hanja, hangul, fallback} end
local fid
for i = 1,3 do
fid = ftable[i]
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index a33d455a7a4..b4595612eab 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}[2018/08/02 v1.21 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2018/11/09 v1.22 Typesetting Korean with LuaLaTeX]
\ifdefined\adjustspacing\else % luatex < 0.87
\let\adjustspacing\pdfadjustspacing