From 028576d9c85a4b968d5ed3ee3b916ffe92fbf378 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 9 Nov 2018 21:55:06 +0000 Subject: luatexko (9nov18) git-svn-id: svn://tug.org/texlive/trunk@49116 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luatexko/ChangeLog | 8 +++++++ Master/texmf-dist/doc/luatex/luatexko/README | 2 +- .../doc/luatex/luatexko/luatexko-doc.pdf | Bin 229318 -> 230807 bytes .../doc/luatex/luatexko/luatexko-doc.tex | 25 ++++++++++++--------- .../tex/luatex/luatexko/luatexko-core.sty | 12 +++++++++- Master/texmf-dist/tex/luatex/luatexko/luatexko.lua | 25 +++++++++++++-------- Master/texmf-dist/tex/luatex/luatexko/luatexko.sty | 2 +- 7 files changed, 52 insertions(+), 22 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog index d897ede540a..dc5b4b8adec 100644 --- a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog +++ b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog @@ -1,3 +1,11 @@ +2018-11-09 Dohyun Kim + + Version 1.22 + + * luatexko-core.sty, luatexko.lua: new command \hangulbyhangulfont. + This being declared, Hangul characters will be forcibly typeset + with Hangul font even when Latin font has Hangul glyphs. + 2018-08-02 Dohyun Kim Version 1.21 diff --git a/Master/texmf-dist/doc/luatex/luatexko/README b/Master/texmf-dist/doc/luatex/luatexko/README index 715c16f4aea..9cf0fd18642 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.21 (2018/08/02) +LuaTeX-ko Package version 1.22 (2018/11/09) =========================================== 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 176b3ac0295..6eec933da27 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf and b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex index 494e5d978fd..9834ce88cab 100644 --- a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex +++ b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex @@ -62,7 +62,7 @@ \author{Dohyun Kim \normalsize || \and Soojin Nam \normalsize || \and \normalsize <\url{http://github.com/dohyunkim/luatexko}>} -\date{Version 1.21\quad 2018/08/02} +\date{Version 1.22\quad 2018/11/09} \maketitle \begin{quote}\small @@ -76,28 +76,30 @@ 불러야 한다.} \item[v1.3] ------ \item \hyperref[sec:fontcmds]{fallbackfont 계열의 명령이 추가되었다.} - \item \hyperref[sec:fontswitch]{\cs{hangulpunctuations} 선언이 추가되고, - |[QuoteRaise]| 옵션이 없어졌다.} + \item \hyperref[sec:fontswitch]{\cs{hangulpunctuations} 선언 추가, + |[QuoteRaise]| 옵션 제거} \item \hyperref[sec:autojosa]{\cs{josaignoreparens=1}이 선언되면 자동조사 결정시 괄호 부분을 무시한다.} \item[v1.5] ------ \item \hyperref[sec:verttype]{세로쓰기를 지원하기 위한 실험적 코드가 들어갔다.} - \item \hyperref[sec:actualtext]{\cs{actualtext} 명령이 추가되었다.} + \item \hyperref[sec:actualtext]{\cs{actualtext} 명령 추가} \item \hyperref[sec:fontswitch]{한글·한자 글꼴의 지정이 없으면 나눔 Type1을 이용한다.} - \item \hyperref[sec:packageopt]{패키지 옵션 |[nofontspec]|이 추가되었다.} + \item \hyperref[sec:packageopt]{패키지 옵션 |[nofontspec]| 추가} \item[v1.6] ------ - \item \hyperref[sec:fontoption]{글꼴 옵션 |[NoEmbedding]|이 추가되었다.} + \item \hyperref[sec:fontoption]{글꼴 옵션 |[NoEmbedding]| 추가} \item \hyperref[sec:fontcmds]{main/sans hangul/hanja/fallback 폰트의 디폴트 옵션으로 |[Ligatures=TeX]|이 주어진다.} \item[v1.7] ------ \item 패키지 옵션 |[unfonts]|를 더는 지원하지 않는다. 이 옵션을 사용한 기존 문서는 기본 글꼴인 나눔 Type1으로 식자될 것이다. \item[v1.8] ------ - \item \hyperref[sec:ruby]{\cs{xxruby} 명령이 추가되었다.} + \item \hyperref[sec:ruby]{\cs{xxruby} 명령 추가} \item[v1.9] ------ - \item \hyperref[sec:verttype]{|horizontal| 환경이 추가되었다.} + \item \hyperref[sec:verttype]{|horizontal| 환경 추가} + \item[v1.22] ------ + \item \hyperref[sec:fontswitch]{\cs{hangulbyhangulfont} 명령 추가} \end{itemize} \end{quote} @@ -160,8 +162,10 @@ CP949 인코딩에 관해서는 제\ref{sec:uhcencoding}절 참조. 폰트에서 글자를 찾아 찍는다. 세 가지 \hemph{모두 지정되지 않았다면 나눔 Type1 폰트를} 이용한다. 기존 \kotex과는 글꼴 대체 방식이 다르므로 주의해야 한다. -하지만 \cs{hanjabyhanjafont=1}을 선언하면 한자는 우선 한자글꼴로 -식자한다. |0|을 선언하면 원래 방식으로 되돌아간다. 이 명령은 문단 +하지만 \cs{hangulbyhangulfont=1}을 선언하면 한글은 우선 한글폰트로 +식자한다. 또한 +\cs{hanjabyhanjafont=1}을 선언하면 한자는 우선 한자폰트로 +식자한다. 둘 다 |0|을 선언하면 원래 방식으로 되돌아간다. 이 명령들은 문단 중간에서 사용하지 않도록 주의해야 한다. 문단 중에 사용되었다면 그 문단의 처음부터 효력이 발생한다. @@ -229,6 +233,7 @@ fontspec의 글꼴 옵션 외에 \luatexko가 따로 제공하는 것들이 \item[CharRaise] 글자의 세로 위치를 {\addhangulfontfeature{CharRaise=.3em} 조절}할 수 있는 기능이다. 이로써 주변에 식자되는 다른 글꼴과 조화를 이루게 한다. + 따라서 영문폰트에는 작동하지 않는다. 플레인텍에서는 |charraise|. \begin{verbatim} [CharRaise=0.1em] 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 -- cgit v1.2.3