summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-06-22 21:23:02 +0000
committerKarl Berry <karl@freefriends.org>2019-06-22 21:23:02 +0000
commit3f444ab8318d583f7cadb0d135486a8b204b567c (patch)
tree5c50a3590cdcee7a6080bf09b1a355ceb0b482e2 /Master
parentaa7047f2124bed0dd8bf7be61b5d99517f233a1e (diff)
luatexko (22jun19)
git-svn-id: svn://tug.org/texlive/trunk@51424 c570f23f-e606-0410-a88d-b1316a301751
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.pdfbin277917 -> 283439 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex152
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua77
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua29
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua181
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty15
8 files changed, 297 insertions, 166 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
index 09a7df505cb..a4c035982ca 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
+++ b/Master/texmf-dist/doc/luatex/luatexko/ChangeLog
@@ -1,3 +1,10 @@
+2019-06-21 Dohyun Kim <nomos at ktug org>
+
+ Version 2.3
+
+ * luatexko.lua: prevent discretionary node after Kana;
+ provide lua functions deactivateall() and reactivateall().
+
2019-06-07 Dohyun Kim <nomos at ktug org>
Version 2.2
diff --git a/Master/texmf-dist/doc/luatex/luatexko/README b/Master/texmf-dist/doc/luatex/luatexko/README
index bdb97987b2c..b83a164f5bf 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 2.2 (2019/06/07)
+LuaTeX-ko Package version 2.3 (2019/06/21)
===========================================
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 96079dfcc4d..e42c173b792 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 b7cb9f6e8b5..faa88eeeaa8 100644
--- a/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
+++ b/Master/texmf-dist/doc/luatex/luatexko/luatexko-doc.tex
@@ -13,6 +13,7 @@
\usepackage[svgnames]{xcolor}
\usepackage[hangul]{luatexko}
\setmainhangulfont{Noto Serif CJK KR}[
+ Scale=0.98,
AutoFakeSlant,
Script=Hangul,
Language=Korean,
@@ -23,6 +24,7 @@
Expansion, Protrusion,
]
\setsanshangulfont{Noto Sans CJK KR}[
+ Scale=0.98,
Script=Hangul,
Language=Korean,
UprightFont=* DemiLight,
@@ -30,12 +32,15 @@
InterLatinCJK=.125em,
]
\setmonofont{Inconsolatazi4}[
+ Scale=0.98,
+ CharRaise=0.125ex,
Color=MidnightBlue,
]
\setmonohangulfont{Noto Sans CJK KR}[
+ Scale=0.98,
UprightFont=* DemiLight,
BoldFont=* Bold,
- CharRaise=-.2ex,
+ CharRaise=-.125ex,
Color=MidnightBlue,
]
\setmathhangulfont{Noto Sans CJK KR}[
@@ -72,7 +77,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 2.2\quad 2019/06/07}
+\date{Version 2.3\quad 2019/06/21}
\maketitle
\begin{quote}\small
@@ -82,7 +87,6 @@
\item[v2.2] ------
\item \hyperref[sec:fontoption]{글꼴옵션 |InterCharStretch| 제공}
\item[v2.0] ------
- \item \hyperref[sec:packageopt]{패키지 옵션 |nofontspec| 제거}
\item \hyperref[sec:fontoption]{글꼴옵션 |PunctRaise|, |NoEmbeding| 제거}
\item \hyperref[sec:mathhangul]{수식 한글 글꼴을 자동으로 잡아주지 않음}
\item \cs{actualtext} 명령 작동 않음. 대신, 옛한글 텍스트 추출 자동 지원%
@@ -99,6 +103,7 @@
\smallskip
\section{부르기}\label{sec:loading}
+
\hemph{\texlive\ 2019 이상}{ \small (\luatex\ v1.10 이상)}을 사용해야 한다.
\luatexko\ 부르기: \cs{usepackage{luatexko}} 혹은 \cs{usepackage{kotex}}.%
@@ -110,6 +115,7 @@ BOM (Byte Order Mark)은 있어도 좋고 없어도 좋다.
CP949 인코딩에 관해서는 제\ref{sec:uhcencoding}절 참조.
\section{패키지 옵션}\label{sec:packageopt}
+
패키지 옵션으로 |[hangul]|과 |[hanja]|가 제공된다.%
\footnote{%
|[nofontspec]| 옵션은 v2.0부터 더는 제공되지 않는다. }
@@ -119,10 +125,12 @@ CP949 인코딩에 관해서는 제\ref{sec:uhcencoding}절 참조.
``제~3 장''과 같은 방식으로 표시되며 절 제목 이하에는 붙지 않는다.
\section{글꼴명령}\label{sec:fontcmds}
+
\luatexko를 로드하면 fontspec 패키지를 자동으로 불러온다. 글꼴 설정에
대해서는 fontspec 문서를 참조.
-한국어 글꼴을 위해 새로 마련한 명령은 다음과 같다.%
+한국어 글꼴을 위해 새로 마련한 명령은 다음과 같다.
+첫 두 줄, 즉 main/sans 글꼴들에는 |Ligatures=TeX| 옵션이 자동으로 주어진다.%
\footnote{%
\cs{adhochangulfont} \cs{adhochanjafont} \cs{addhocfallbackfont}는
마지막 줄 명령들의 다른 이름들이다. }\,%
@@ -141,10 +149,9 @@ CP949 인코딩에 관해서는 제\ref{sec:uhcencoding}절 참조.
\addhangulfontfeature \addhanjafontfeature \addfallbackfontfeature
\hangulfontspec \hanjafontspec \fallbackfontspec
\end{verbatim}
-첫 두 줄, 즉 main/sans hangul/hanja/fallback 글꼴에는
-|Ligatures=TeX| 옵션이 자동으로 주어진다.
\section{글꼴 대체}\label{sec:fontswitch}
+
원칙적으로 \luatexko는 지시된 글자가 영문폰트에 없으면 한글폰트에서,
한글폰트에도 없으면 한자폰트에서, 한자폰트에도 없으면 fallback
폰트에서 글자를 찾아 찍는다.
@@ -159,7 +166,7 @@ CP949 인코딩에 관해서는 제\ref{sec:uhcencoding}절 참조.
문단 중간에서 사용해도 동작한다. 그러나 루아코드가 실행되므로
텍의 그룹에 의해 영향받지 않는 전역적 효과를 가진다.
-나아가 일정한 영문 문장부호들은 한글 폰트로 식자된다.
+일정한 영문 문장부호들은 한글 폰트로 식자된다.
즉, \cs{hangulpunctuations=1}이 기본으로 작동하고,
|0|을 지시해야 이 기능이 비로소 꺼진다.
verbatim 코드를 식자할 때는 이 기능이 작동하지 않는다.%
@@ -179,15 +186,17 @@ verbatim 코드를 식자할 때는 이 기능이 작동하지 않는다.%
[0x2015] ― [0x2018] ‘ [0x2019] ’ [0x201C] “
[0x201D] ” [0x2026] … [0x203B] ※
\end{verbatim}
+
다음과 같은 명령으로 이 목록에 문자를 추가하거나 제거할 수 있다.
인자는 콤마로 분리된 숫자 형식으로서 유니코드 코드포인트를 뜻한다.
+이들 명령은 문단 중간에서도 쓸 수 있지만, 전역적 효과를 가진다.
\begin{verbatim}
\registerpunctuations{45, "2D, `-}
\unregisterpunctuations{"2D, "2015}
\end{verbatim}
-이들 명령은 문단 중간에서도 쓸 수 있지만, 전역적 효과를 가진다.
\section{줄바꿈 허용}\label{sec:break}
+
어떤 글자 앞이나 뒤에서 줄바꿈을 허용하고 싶을 때 아래와 같이 명령을 준다.
\begin{verbatim}
\registerbreakableafter{"2460, "2461}
@@ -198,6 +207,7 @@ verbatim 코드를 식자할 때는 이 기능이 작동하지 않는다.%
이들 문자 앞뒤 모두에서 줄바꿈이 되지 않는다.
\section{글꼴 옵션}\label{sec:fontoption}
+
fontspec의 글꼴 옵션 외에 \luatexko가 따로 제공하는 것들이 있다.%
\footnote{%
옛한글 식자를 위해서는 적어도 |Script=Hangul|
@@ -323,6 +333,24 @@ fontspec의 글꼴 옵션 외에 \luatexko가 따로 제공하는 것들이 있
\end{description}
\section{고문헌}\label{sec:classic}
+
+\begin{figure}
+ \centering
+ \fbox{\parbox{37em}{\typesetclassic\sffamily
+ \addhangulfontfeature{CompressPunctuations}
+子曰:「學而時習之,不亦說乎?有朋自遠方來,不亦樂乎?人不知而不慍,
+不亦君子乎?」\par
+有子曰:「其爲人也孝弟,而好犯上者,鮮矣!不好犯上,而好作亂者,未之有也!
+君子務本,本立而道生;孝弟也者,其爲仁之本與?」\par
+子曰:「巧言令色,鮮矣仁!」\par
+曾子曰:「吾日三省吾身:爲人謀,而不忠乎?與朋友交,而不信乎?傳,
+不習乎?」\par
+子曰:「道千乘之國,敬事而信,節用而愛人,使民以時。」\par
+子曰:「弟子入則孝,出則弟;謹而信,汎愛衆;而親仁,行有餘力,則以學文。」
+ }}
+\caption{고문헌 조판 보기. typesetclassic 환경을 이용했다.}\label{fig:gomun}
+\end{figure}
+
고문헌 조판을 위해 |typesetclassic| 환경을 제공한다.%
\footnote{%
플레인텍에서는 (문서 전체에 적용하지 않는다면 그룹 안에서)
@@ -342,27 +370,11 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
플레인텍에서는 (문서 전체에 적용하지 않는다면 그룹 안에서)
\cs{typesetmodern}을 사용한다. }
-\begin{figure}
- \centering
- \fbox{\parbox{37em}{\typesetclassic\sffamily
- \addhangulfontfeature{CompressPunctuations}
-子曰:「學而時習之,不亦說乎?有朋自遠方來,不亦樂乎?人不知而不慍,
-不亦君子乎?」\par
-有子曰:「其爲人也孝弟,而好犯上者,鮮矣!不好犯上,而好作亂者,未之有也!
-君子務本,本立而道生;孝弟也者,其爲仁之本與?」\par
-子曰:「巧言令色,鮮矣仁!」\par
-曾子曰:「吾日三省吾身:爲人謀,而不忠乎?與朋友交,而不信乎?傳,
-不習乎?」\par
-子曰:「道千乘之國,敬事而信,節用而愛人,使民以時。」\par
-子曰:「弟子入則孝,出則弟;謹而信,汎愛衆;而親仁,行有餘力,則以學文。」
- }}
-\caption{고문헌 조판 보기. typesetclassic 환경을 이용했다.}\label{fig:gomun}
-\end{figure}
-
고문헌 조판 중 \luatexko가 글자 사이에 삽입하는 미세간격을
사용자가 영{\small(zero)}으로 강제하기 위해선 \cs{inhibitglue} 명령을 이용한다.
\section{세로쓰기}\label{sec:verttype}
+
세로쓰기는 폰트의 고급 오픈타입 속성을 이용하므로 폰트가 이를 지원해야
가능한 일이다. 폰트에 |Vertical=Alternates|와 |RawFeature=vertical| 옵션을
준다.%
@@ -378,12 +390,6 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
세로쓰기에서는 \cs{typesetclassic}의 아종인 \cs{typesetvertical}이
기본으로 셋팅되어 있다. 일종의 고문헌 조판으로 보는 것이다.
-문서의 일부를 세로쓰기하려면 \cs{begin{vertical}{<dimen>}} \ldots\ \cs{end{vertical}}
-환경을 이용한다. |<dimen>|으로 세로쓰기 박스의 높이를 지시한다.%
-\footnote{%
- 플레인텍에서는 \cs{vertical{<dimen>}} \ldots\ \cs{endvertical}. }
-그림~\ref{fig:vertical} 및 그림~\ref{fig:vertical2} 참조.
-
\begin{figure}
\framebox[\linewidth]{\begin{vertical}{20em}\sffamily
\addhangulfontfeature{Vertical=Alternates, RawFeature=vertical}
@@ -393,6 +399,12 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
\caption{세로쓰기의 예. 박스 높이 |20em|을 지시했다.}\label{fig:vertical}
\end{figure}
+문서의 일부를 세로쓰기하려면 \cs{begin{vertical}{<dimen>}} \ldots\ \cs{end{vertical}}
+환경을 이용한다. |<dimen>|으로 세로쓰기 박스의 높이를 지시한다.%
+\footnote{%
+ 플레인텍에서는 \cs{vertical{<dimen>}} \ldots\ \cs{endvertical}. }
+그림~\ref{fig:vertical} 및 그림~\ref{fig:vertical2} 참조.
+
\begin{figure}
\framebox[\linewidth]{\begin{vertical}{17em}\sffamily
\addhangulfontfeature{Vertical=Alternates, CharRaise=3.2pt,
@@ -430,37 +442,8 @@ v2.0부터는 고문헌 조판에서 한글^^b7한자와 영문자가 붙어 나
플레인텍에서는 \cs{horizontal{<dimen>}} \ldots\ \cs{endhorizontal}. }
가로쓰기 영역의 폰트 설정은 사용자의 몫이다.
-\section{수식 한글}\label{sec:mathhangul}
-\begin{quote}
- |$가^{나^다}$|\quad$\Rightarrow\quad가^{나^다}$
-\end{quote}
-수식 한글 폰트를 설정하면 수식 모드에서도 한글을 {\small(hbox로 감싸지 않고)}
-직접 입력할 수 있다.%
-\footnote{%
- 플레인텍에서는 \cs{mathhangulfont=UnBatang}과 같이 설정한다.
- 또는 좀 더 그럴듯하게 하려면:\par
- \leftskip=3em\noindent
- |\\font\\texthangul="Noto Sans CJK KR DemiLight" at 10pt|\\
- |\\font\\scripthangul="Noto Sans CJK KR Regular" at 7pt|\\
- |\\font\\scriptscripthangul="Noto Sans CJK KR Medium" at 5pt|\\
- |\\setmathhangulfonts\\texthangul\\scripthangul\\scriptscripthangul| }
-v2.0부터는 자동으로 수식 한글을 잡아주지 않는다.
-\begin{verbatim}
- \setmathhangulfont{Noto Sans CJK KR}[
- SizeFeatures={
- {Size=-6, Font=* Medium},
- {Size=6-9, Font=* Regular},
- {Size=9-, Font=* DemiLight},
- } ]
-\end{verbatim}
-현재 한글만 쓸 수 있게 설정되어 있다.
-한자도 수식에 직접 입력하려면 사용자는
-\begin{verbatim}
- \setmathhangulblock{4E00}{9FC3}
-\end{verbatim}
-명령으로 유니코드 블럭을 추가 지정해야 한다.
-
\section{드러냄표}\label{sec:dotemph}
+
\cs{dotemph} 명령으로 \dotemph{드러냄표}%
를 이용한 강조를 할 수 있다. 기본은 글자 위에 점을 찍는 형태이나
다음과 같이 명령을 주어 개인적으로 선호하는 기호를 드러냄표로 쓸 수
@@ -472,6 +455,7 @@ v2.0부터는 자동으로 수식 한글을 잡아주지 않는다.
②~|\def\dotemphchar{\bfseries ^^^^02d9}|: 드러냄표 기호 자체를 정의.
\section{루비}\label{sec:ruby}
+
루비를 달 수 있다. ruby 패키지가 이미 존재하지만 \luatexko와 궁합이 잘
맞지 않아 새로 매크로를 제공한다.
\begin{quote}
@@ -507,6 +491,7 @@ v2.0부터는 자동으로 수식 한글을 잡아주지 않는다.
두 인자의 글자 수가 동일해야 한다.
\section{밑줄긋기}\label{sec:uline}
+
ulem 패키지가 \luatexko와 궁합이 잘 맞지 않아{\small (줄바꿈에 문제가 있음)}
명령을 따로 제공한다.
@@ -553,6 +538,7 @@ ulem 패키지가 \luatexko와 궁합이 잘 맞지 않아{\small (줄바꿈에
\ymarker{노란색을 칠해서 강조한다}.
\section{자동조사}\label{sec:autojosa}
+
자동조사는 \kotex 과 동일하게 \cs{은} \cs{는} \cs{이} \cs{가} \cs{을} \cs{를}
\cs{와} \cs{과} \cs{로} \cs{으로} \cs{라} \cs{이라} 따위를 사용한다.
버전 1.3부터는 \cs{josaignoreparens=1}이 선언되어 있으면 자동조사는
@@ -567,7 +553,49 @@ ulem 패키지가 \luatexko와 궁합이 잘 맞지 않아{\small (줄바꿈에
|홍길동(2001)\로|\quad$\Rightarrow$\quad 홍길동(2001)\로
\end{quote}
+\section{루아 모듈의 제거 및 복원}\label{sec:luamodule}
+
+루아 코드 |luatexko.deactivateall()|은 이상 언급한 \luatexko 의 거의 모든
+기능을 무력화한다. |luatexko.reactivateall()|은 이를 복원한다.%
+\footnote{수직 모드 (문단과 문단 사이)에서 사용할 것.
+ 수평 모드에서는 정상작동을 보장하지 못한다.}
+다른 패키지와 충돌할 때 시도해 볼 수 있다.
+전자의 함수에는 문자열을 인자로 줄 수도 있는데, 해당하는 다른 패키지의
+모듈들을 잠시 제거할 수 있다.
+
+\section{수식 한글}\label{sec:mathhangul}
+
+\begin{quote}
+ |$가^{나^다}$|\quad$\Rightarrow\quad가^{나^다}$
+\end{quote}
+수식 한글 폰트를 설정하면 수식 모드에서도 한글을 {\small(hbox로 감싸지 않고)}
+직접 입력할 수 있다.%
+\footnote{%
+ 플레인텍에서는 \cs{mathhangulfont=UnBatang}과 같이 설정한다.
+ 또는 좀 더 그럴듯하게 하려면:\par
+ \leftskip=3em\noindent
+ |\\font\\texthangul="Noto Sans CJK KR DemiLight" at 10pt|\\
+ |\\font\\scripthangul="Noto Sans CJK KR Regular" at 7pt|\\
+ |\\font\\scriptscripthangul="Noto Sans CJK KR Medium" at 5pt|\\
+ |\\setmathhangulfonts\\texthangul\\scripthangul\\scriptscripthangul| }
+v2.0부터는 자동으로 수식 한글을 잡아주지 않는다.
+\begin{verbatim}
+ \setmathhangulfont{Noto Sans CJK KR}[
+ SizeFeatures={
+ {Size=-6, Font=* Medium},
+ {Size=6-9, Font=* Regular},
+ {Size=9-, Font=* DemiLight},
+ } ]
+\end{verbatim}
+현재 한글만 쓸 수 있게 설정되어 있다.
+한자도 수식에 직접 입력하려면 사용자는
+다음 명령으로 유니코드 블럭을 추가 지정해야 한다.
+\begin{verbatim}
+ \setmathhangulblock{4E00}{9FC3}
+\end{verbatim}
+
\section{한국어 항목 번호}\label{sec:hangulnums}
+
\kotex과 동일하게 항목 번호를 한국어 기호로 붙일 수 있다.%
\footnote{%
\cs{jaso} \cs{gana} \cs{ojaso} \cs{ogana} \cs{pjaso} \cs{pgana}
@@ -575,12 +603,14 @@ ulem 패키지가 \luatexko와 궁합이 잘 맞지 않아{\small (줄바꿈에
\cs{hroman} \cs{hRoman} \cs{hNum} \cs{hanjanum} 따위를 사용한다. }
\section{입력 변환}\label{sec:noramlize}
+
\cs{luatexhangulnormalize=1}이라 지시하면 첫가끝 자모를 완성형 음절로,
|2|라면 완성형 음절을 첫가끝 자모로 인코딩 변환한다. |0|이 할당되면
인코딩 변환 기능이 꺼진다. \XeTeX의 \cs{XeTeXinputnormalization} 명령과
유사하나, 오직 한글과 일부 한자에 대해서만 정규화가 작동할 뿐이다.
\section{UHC 입력 인코딩}\label{sec:uhcencoding}
+
권장하지 않지만 불가피하게 입력 인코딩이 UHC (Unified Hangul Code)%
\footnote{%
CP949라고도 하며 EUC-KR을 포함한다. }%
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
index d1429026fbe..9213f4c3e1b 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
@@ -13,15 +13,22 @@
luatexbase.provides_module({
name = "luatexko-normalize",
- version = "2.2",
- date = "2019/06/07",
+ version = "2.3",
+ date = "2019/06/21",
author = "Dohyun Kim, Soojin Nam",
description = "Hangul normalization",
license = "LPPL v1.3+",
})
-luatexkonormalize = luatexkonormalize or {}
-local luatexkonormalize = luatexkonormalize
+luatexko = luatexko or {}
+luatexko.normalize = luatexko.normalize or {}
+local luatexkonormalize = luatexko.normalize
+
+local utf8codes = utf8.codes
+local utf8char = utf8.char
+local tableinsert = table.insert
+local tableappend = table.append
+local tableunpack = table.unpack
local chanjatohanja = {
[0xF900] = {0x8C48, 0xFE00},
@@ -422,7 +429,7 @@ local function is_jongsong (c)
end
local function jamo2syllable (t) -- table -> integer
- local cho, jung, jong = table.unpack(t)
+ local cho, jung, jong = tableunpack(t)
local s = (cho - 0x1100) * 21
s = (s + jung - 0x1161) * 28
if jong then
@@ -445,35 +452,35 @@ end
local function hanguldecompose (buffer)
local t = {}
- for _, c in utf8.codes(buffer) do
+ for _, c in utf8codes(buffer) do
if is_hangul(c) then
- table.append(t, syllable2jamo(c))
+ tableappend(t, syllable2jamo(c))
else
- table.insert(t, c)
+ tableinsert(t, c)
end
end
- return utf8.char(table.unpack(t))
+ return utf8char(tableunpack(t))
end
-- LV | LVT, T -> L, V, T+
local function flush_syllable_jong (t, s)
if #s == 2 then
- table.append(t, syllable2jamo( s[1] ))
- table.insert(t, s[2])
+ tableappend(t, syllable2jamo( s[1] ))
+ tableinsert(t, s[2])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
local function compose_hanguldecompose (buffer) -- string -> table
local t, s = {}, {}
- for _, c in utf8.codes(buffer) do
+ for _, c in utf8codes(buffer) do
if #s == 1 and is_jongsong(c) then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_syllable_jong(t, s)
- table.insert(is_hangul(c) and s or t, c)
+ tableinsert(is_hangul(c) and s or t, c)
end
end
t = flush_syllable_jong(t, s)
@@ -483,9 +490,9 @@ end
-- L, V, [T & ^OT]? -> LV | LVT
local function flush_syllable (t, s)
if #s == 2 or #s == 3 and is_modern_jong( s[3] ) then
- table.insert(t, jamo2syllable(s))
+ tableinsert(t, jamo2syllable(s))
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -494,10 +501,10 @@ local function compose_modern_hangul (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and is_modern_jung(c) or #s >= 2 and is_jongsong(c) then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_syllable(t, s)
- table.insert(is_modern_cho(c) and s or t, c)
+ tableinsert(is_modern_cho(c) and s or t, c)
end
end
t = flush_syllable(t, s)
@@ -507,9 +514,9 @@ end
-- L, VF -> CL
local function flush_cjamocho (t, s)
if #s == 2 then
- table.insert(t, jamotocjamo.ccho[ s[1] ])
+ tableinsert(t, jamotocjamo.ccho[ s[1] ])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -518,10 +525,10 @@ local function compose_jamo_chosong (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and c == 0x1160 then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_cjamocho(t, s)
- table.insert(jamotocjamo.ccho[c] and s or t, c)
+ tableinsert(jamotocjamo.ccho[c] and s or t, c)
end
end
t = flush_cjamocho(t, s)
@@ -531,9 +538,9 @@ end
-- LF, V, ^T -> CV, ^T
local function flush_cjamojung (t, s)
if #s == 2 then
- table.insert(t, jamotocjamo.cjung[ s[2] ])
+ tableinsert(t, jamotocjamo.cjung[ s[2] ])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -542,10 +549,10 @@ local function compose_jamo_jungsong (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and jamotocjamo.cjung[c] or #s == 2 and is_jongsong(c) then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_cjamojung(t, s)
- table.insert(c == 0x115F and s or t, c)
+ tableinsert(c == 0x115F and s or t, c)
end
end
t = flush_cjamojung(t, s)
@@ -555,9 +562,9 @@ end
-- CHJ -> HJ, VS
local function flush_compat_hanja (t, s)
if #s == 1 then
- table.append(t, chanjatohanja[ s[1] ])
+ tableappend(t, chanjatohanja[ s[1] ])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -566,10 +573,10 @@ local function compose_compat_hanja (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and c >= 0xFE00 and c <= 0xFE02 then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_compat_hanja(t, s)
- table.insert(chanjatohanja[c] and s or t, c)
+ tableinsert(chanjatohanja[c] and s or t, c)
end
end
t = flush_compat_hanja(t, s)
@@ -583,7 +590,7 @@ local function hangulcompose (buffer)
t = compose_jamo_jungsong(t)
t = compose_compat_hanja (t)
- return utf8.char(table.unpack(t))
+ return utf8char(tableunpack(t))
end
local loaded = false
@@ -592,7 +599,7 @@ local remove_from_callback = luatexbase.remove_from_callback
local function unload()
if loaded then
- remove_from_callback('process_input_buffer', 'luatexko-hangul-normalize')
+ remove_from_callback('process_input_buffer', 'luatexko.hangul_normalize')
loaded = false
end
end
@@ -600,14 +607,14 @@ luatexkonormalize.unload = unload
local function compose()
unload()
- add_to_callback('process_input_buffer', hangulcompose, 'luatexko-hangul-normalize')
+ add_to_callback('process_input_buffer', hangulcompose, 'luatexko.hangul_normalize')
loaded = true
end
luatexkonormalize.compose = compose
local function decompose()
unload()
- add_to_callback('process_input_buffer', hanguldecompose, 'luatexko-hangul-normalize')
+ add_to_callback('process_input_buffer', hanguldecompose, 'luatexko.hangul_normalize')
loaded = true
end
luatexkonormalize.decompose = decompose
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
index 1757d5b7017..a26f6212383 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
@@ -13,15 +13,16 @@
luatexbase.provides_module({
name = "luatexko-uhc2utf8",
- version = "2.2",
- date = "2019/06/07",
+ version = "2.3",
+ date = "2019/06/21",
author = "Dohyun Kim, Soojin Nam",
description = "UHC (CP949) input encoding",
license = "LPPL v1.3+",
})
-luatexkouhc2utf8 = luatexkouhc2utf8 or {}
-local luatexkouhc2utf8 = luatexkouhc2utf8
+luatexko = luatexko or {}
+luatexko.uhc2utf8 = luatexko.uhc2utf8 or {}
+local luatexkouhc2utf8 = luatexko.uhc2utf8
local kpse_find_file = kpse.find_file
local add_to_callback = luatexbase.add_to_callback
@@ -64,12 +65,12 @@ local function uhc_to_utf8 (buffer)
end
local function startconvert ()
- add_to_callback('process_input_buffer', uhc_to_utf8, 'luatexko-uhctoutf8', 1)
+ add_to_callback('process_input_buffer', uhc_to_utf8, 'luatexko.uhctoutf8', 1)
end
luatexkouhc2utf8.startconvert = startconvert
local function stopconvert ()
- remove_from_callback('process_input_buffer', 'luatexko-uhctoutf8')
+ remove_from_callback('process_input_buffer', 'luatexko.uhctoutf8')
end
luatexkouhc2utf8.stopconvert = stopconvert
@@ -93,13 +94,13 @@ local function utf8_to_uhc (name)
if u >= 0xA1 and u <= 0xFFE6 then
local c = t_ucs2uhc[u]
if c then
- table.insert(t, c // 256)
- table.insert(t, c % 256)
+ t[#t + 1] = c // 256
+ t[#t + 1] = c % 256
else
- table.insert(t, u)
+ t[#t + 1] = u
end
else
- table.insert(t, u)
+ t[#t + 1] = u
end
end
return string.char(table.unpack(t))
@@ -113,15 +114,15 @@ local function uhc_find_file (file, ...)
end
local function start_uhc_filename ()
- add_to_callback('find_read_file', function(id, name) return uhc_find_file(name) end, 'luatexko-touhc-findreadfile')
- add_to_callback('find_image_file', uhc_find_file, 'luatexko-touhc-findimagefile')
+ add_to_callback('find_read_file', function(id, name) return uhc_find_file(name) end, 'luatexko.touhc_findreadfile')
+ add_to_callback('find_image_file', uhc_find_file, 'luatexko.touhc_findimagefile')
kpse.find_file = uhc_find_file
end
luatexkouhc2utf8.start_uhc_filename = start_uhc_filename
local function stop_uhc_filename ()
- remove_from_callback('find_read_file', 'luatexko-touhc-findreadfile')
- remove_from_callback('find_image_file', 'luatexko-touhc-findimagefile')
+ remove_from_callback('find_read_file', 'luatexko.touhc_findreadfile')
+ remove_from_callback('find_image_file', 'luatexko.touhc_findimagefile')
kpse.find_file = kpse_find_file
end
luatexkouhc2utf8.stop_uhc_filename = stop_uhc_filename
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index 17b43d5628a..5f6cd602e53 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 = '2019/06/07',
- version = '2.2',
+ date = '2019/06/21',
+ version = '2.3',
description = 'typesetting Korean with LuaTeX',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -61,17 +61,18 @@ local texsprint = tex.sprint
local stringformat = string.format
local tableconcat = table.concat
-local tableinsert = table.insert
local tableunpack = table.unpack
-local add_to_callback = luatexbase.add_to_callback
-local attributes = luatexbase.attributes
-local call_callback = luatexbase.call_callback
-local create_callback = luatexbase.create_callback
-local module_warning = luatexbase.module_warning
-local new_user_whatsit = luatexbase.new_user_whatsit
-local new_user_whatsit_id = luatexbase.new_user_whatsit_id
-local registernumber = luatexbase.registernumber
+local add_to_callback = luatexbase.add_to_callback
+local attributes = luatexbase.attributes
+local call_callback = luatexbase.call_callback
+local callback_descriptions = luatexbase.callback_descriptions
+local create_callback = luatexbase.create_callback
+local module_warning = luatexbase.module_warning
+local new_user_whatsit = luatexbase.new_user_whatsit
+local new_user_whatsit_id = luatexbase.new_user_whatsit_id
+local registernumber = luatexbase.registernumber
+local remove_from_callback = luatexbase.remove_from_callback
local function warning (...)
return module_warning("luatexko", stringformat(...))
@@ -98,6 +99,7 @@ local lua_number = 100
local lua_value = 108
local spaceskip = 13
local nohyphen = registernumber"l@nohyphenation" or -1 -- verbatim
+local langkor = registernumber"koreanlanguage" or 16383
local hangulfontattr = attributes.luatexkohangulfontattr
local hanjafontattr = attributes.luatexkohanjafontattr
@@ -152,7 +154,7 @@ local function is_cjk_combining (c)
or is_unicode_var_sel(c)
end
-local function is_noncjkletter (c)
+local function is_noncjk_char (c)
return c >= 0x30 and c <= 0x39
or c >= 0x41 and c <= 0x5A
or c >= 0x61 and c <= 0x7A
@@ -329,7 +331,7 @@ local function process_fonts (head)
local c = curr.char
- if is_unicode_var_sel(c) then
+ if is_cjk_combining(c) then
local p = getprev(curr)
if p.id == glyphid and curr.font ~= p.font then
hangul_space_skip(curr, p.font)
@@ -435,12 +437,12 @@ local charclass = setmetatable({
local SC_charclass = setmetatable({
[0xFF01] = 4, [0xFF1A] = 4, [0xFF1B] = 4, [0xFF1F] = 4,
-}, { __index = function(_,c) return charclass[c] end })
+}, { __index = charclass })
local vert_charclass = setmetatable({
[0xFF1A] = 5, -- 0xFE13
[0xFF1B] = 5, -- 0xFE14
-}, { __index = function(_,c) return charclass[c] end })
+}, { __index = charclass })
local function get_char_class (c, classic)
if classic == vert_classic then
@@ -467,7 +469,7 @@ local breakable_after = setmetatable({
[0xFF1E] = true, [0xFF5E] = true, [0xFF70] = true,
},{ __index = function (_,c)
return is_hangul_jamo(c) and not is_chosong(c)
- or is_noncjkletter(c)
+ or is_noncjk_char(c)
or is_hanja(c)
or is_cjk_combining(c)
or is_kana(c)
@@ -553,7 +555,7 @@ end
local function fontdata_opt_dim (fd, optname)
local dim = option_in_font(fd, optname)
if dim then
- local m, u = dim:match"(.+)(e[mx])%s*$"
+ local m, u = dim:match"^(.+)(e[mx])%s*$"
if m and u then
if u == "em" then
dim = m * fd.parameters.quad
@@ -700,7 +702,7 @@ end
-- interhangul & interlatincjk
-local function is_cjk (c)
+local function is_cjk_char (c)
return is_hangul_jamo(c)
or is_hanja(c)
or is_cjk_combining(c)
@@ -710,6 +712,32 @@ local function is_cjk (c)
or rawget(breakable_after, c) and c >= 0x2000
end
+local function is_cjk (n, c) -- node, char
+ if n and c then
+ if is_unicode_var_sel(c) then
+ local p = getprev(n)
+ if p and p.id == glyphid then
+ local pc = my_node_props(p).unicode or p.char or 0
+ return is_cjk_char(pc)
+ end
+ end
+ return is_cjk_char(c)
+ end
+end
+
+local function is_noncjk (n, c) -- node, char
+ if n and c then
+ if is_unicode_var_sel(c) then
+ local p = getprev(n)
+ if p and p.id == glyphid then
+ local pc = my_node_props(p).unicode or p.char or 0
+ return is_noncjk_char(pc)
+ end
+ end
+ return is_noncjk_char(c)
+ end
+end
+
local function do_interhangul_option (head, curr, pc, c, fontid, par)
local cc = (is_hangul(c) or is_chosong(c)) and 1 or 0
@@ -758,55 +786,63 @@ local function process_interhangul (head, par)
return head
end
-local function do_interlatincjk_option (head, curr, pc, pf, c, cf, par)
- local cc = is_cjk(c) and 1 or is_noncjkletter(c) and 2 or 0
- local brb = cc == 2 or breakable_before[c] -- numletter != br_before
-
- if brb and cc*pc == 2 and curr.lang ~= nohyphen then
- local fontid = cc == 1 and cf or pf
- local dim = get_font_opt_dimen(fontid, "interlatincjk")
- if dim then
- head = insert_glue_before(head, curr, par, true, brb, false, false, dim, fontid)
+local function do_interlatincjk_option (head, curr, pc, pf, pcl, c, cf, par)
+ local cc = is_cjk(curr, c) and 1 or is_noncjk(curr, c) and 2 or 0
+ local old = has_attribute(curr, classicattr)
+ local ccl = get_char_class(c, old)
+
+ if cc*pc == 2 and curr.lang ~= nohyphen then
+ local brb = cc == 2 or breakable_before[c] -- numletter != br_before
+ if brb then
+ local fid = cc == 1 and cf or pf
+ local dim = get_font_opt_dimen(fid, "interlatincjk")
+ if dim then
+ local ict = old and intercharclass[pcl][ccl] -- under classic env. only
+ if ict then
+ dim = get_font_opt_dimen(fid, "intercharacter") or 0
+ end
+ head = insert_glue_before(head, curr, par, true, brb, old, ict, dim, fid)
+ end
end
end
- return head, cc, cf
+ return head, cc, cf, ccl
end
local function process_interlatincjk (head, par)
- local curr, pc, pf = head, 0, 0
+ local curr, pc, pf, pcl = head, 0, 0, 0
while curr do
local id = curr.id
if id == glyphid then
local c = my_node_props(curr).unicode or curr.char
- head, pc, pf = do_interlatincjk_option(head, curr, pc, pf, c, curr.font, par)
+ head, pc, pf, pcl = do_interlatincjk_option(head, curr, pc, pf, pcl, c, curr.font, par)
pc = breakable_after[c] and pc or 0
elseif id == hlistid and has_attribute(curr, rubyattr) then
local c, cf = ruby_char_font(curr)
- head, pc, pf = do_interlatincjk_option(head, curr, pc, pf, c, cf, par)
+ head, pc, pf, pcl = do_interlatincjk_option(head, curr, pc, pf, pcl, c, cf, par)
elseif id == whatsitid and curr.mode == directmode then
local glyf, c = get_actualtext(curr)
if c and glyf then
- head, pc, pf = do_interlatincjk_option(head, curr, pc, pf, c, glyf.font, par)
+ head, pc, pf, pcl = do_interlatincjk_option(head, curr, pc, pf, pcl, c, glyf.font, par)
curr = goto_end_actualtext(curr)
end
elseif id == mathid then
if pc == 1 then
- head = do_interlatincjk_option(head, curr, pc, pf, 0x30, pf, par)
+ head = do_interlatincjk_option(head, curr, pc, pf, pcl, 0x30, pf, par)
end
- pc, curr = 2, end_of_math(curr)
+ pc, pcl, curr = 2, 0, end_of_math(curr)
elseif id == dirid then
if pc == 1 and curr.dir:sub(1,1) == "+" then
- head = do_interlatincjk_option(head, curr, pc, pf, 0x30, pf, par)
- pc = 0
+ head = do_interlatincjk_option(head, curr, pc, pf, pcl, 0x30, pf, par)
+ pc, pcl = 0, 0
end
elseif is_blocking_node(curr) then
- pc = 0
+ pc, pcl = 0
end
curr = getnext(curr)
end
@@ -836,7 +872,7 @@ local function process_remove_spaces (head)
vchar, vfont = ruby_char_font(v)
end
if vchar and vfont and option_in_font(vfont, opt_name) then
- ok = is_cjk(vchar)
+ ok = is_cjk(v, vchar)
end
break
@@ -845,7 +881,7 @@ local function process_remove_spaces (head)
end
if ok then
head = noderemove(head, curr)
- tableinsert(to_free, curr)
+ to_free[#to_free + 1] = curr
break
end
end
@@ -906,7 +942,7 @@ local josa_code = setmetatable({
return c ~= 0x1160 and 2
elseif is_jongsong(c) then
return c == 0x11AF and 1 or 3
- elseif is_noncjkletter(c) and c <= 0x7A
+ elseif is_noncjk_char(c) and c <= 0x7A
or c >= 0x2160 and c <= 0x217F -- roman
or c >= 0x2460 and c <= 0x24E9 -- ①
or c >= 0x314F and c <= 0x3163 or c >= 0x3187 and c <= 0x318E -- ㅏ
@@ -974,7 +1010,7 @@ local function process_josa (head)
curr.char = cc
else
head = noderemove(head, curr)
- tableinsert(tofree, curr)
+ tofree[#tofree + 1] = curr
end
end
unset_attribute(curr, autojosaattr)
@@ -1232,7 +1268,7 @@ local function pdfliteral_direct_actual (syllable)
if syllable then
local t = {}
for _,v in ipairs(syllable) do
- tableinsert(t, conv_tounicode(v))
+ t[#t + 1] = conv_tounicode(v)
end
data = stringformat("/Span<</ActualText<FEFF%s>>>BDC", tableconcat(t))
else
@@ -1284,7 +1320,7 @@ local function process_reorder_tonemarks (head)
if is_jungsong(u)
or is_jongsong(u)
or hangul_tonemark[u] then
- tableinsert(syllable, u)
+ syllable[#syllable + 1] = u
curr, uni = n, u
else
break
@@ -1471,7 +1507,7 @@ local function process_vertical_font (fontdata)
local tsb_tab = get_tsb_table(fontdata.filename, subfont)
if not tsb_tab then
warning("Vertical metrics table (vmtx) not found in the font\n"..
- "`%s'", fontdata.fontname)
+ "`%s'", fontdata.fullname)
return
end
@@ -1697,13 +1733,13 @@ local function process_patch_font (fontdata)
texset("global", "protrudechars", 2)
active_processes.protrusion = true
end
- if not active_processes[fontdata.fontname] and
+ if not active_processes[fontdata.fullname] and
option_in_font(fontdata, "compresspunctuations") then
warning("Both `compresspunctuations' and `protrusion' are\n"..
"enabled for the font `%s'.\n"..
"Beware that this could result in bad justifications.\n",
- fontdata.fontname)
- active_processes[fontdata.fontname] = true
+ fontdata.fullname)
+ active_processes[fontdata.fullname] = true
end
end
@@ -1766,8 +1802,57 @@ local function activate (name)
end
luatexko.activate = activate
+add_to_callback ("hyphenate",
+function(head)
+ local curr = head
+ while curr do
+ local id = curr.id
+ if id == glyphid then
+ if curr.subtype == 1 and
+ curr.lang ~= nohyphen and
+ is_cjk(curr, curr.char) then
+ curr.lang = langkor
+ end
+ elseif id == mathid then
+ curr = end_of_math(curr)
+ end
+ curr = getnext(curr)
+ end
+ lang.hyphenate(head)
+end,
+"luatexko.hyphenate.prevent_disc_nodes")
+
-- aux functions
+local function deactivate_all (str)
+ luatexko.deactivated = {}
+ for _, name in ipairs{ "hpack_filter",
+ "pre_linebreak_filter",
+ "vpack_filter",
+ "hyphenate",
+ "luaotfload.patch_font" } do
+ local t = {}
+ for i, v in ipairs( callback_descriptions(name) ) do
+ if v:find(str or "^luatexko%.") then
+ local ff, dd = remove_from_callback(name, v)
+ t[#t + 1] = { ff, dd, i }
+ end
+ end
+ luatexko.deactivated[name] = t
+ end
+end
+luatexko.deactivateall = deactivate_all
+
+local function reactivate_all ()
+ for name, v in pairs(luatexko.deactivated or {}) do
+ for _, vv in ipairs(v) do
+ add_to_callback(name, tableunpack(vv))
+ end
+ end
+ luatexko.deactivated = nil
+end
+luatexko.reactivateall = reactivate_all
+
local function current_has_hangul_chars (cnt)
texcount[cnt] = char_in_font(fontcurrent(), 0xAC00) and 1 or 0
end
@@ -1789,7 +1874,7 @@ local function get_charslots_of_gid (fd, gid)
local t = {}
for i, v in pairs(fd.characters) do
if v.index == gid then
- table.insert(t, i)
+ t[#t + 1] = i
end
end
return t
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index 8660fe8de54..dbe1be8411a 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
@@ -13,7 +13,7 @@
\ifdefined\luatexkohangulfontattr \endinput\fi
\ifdefined\selectfont
- \ProvidesPackage{luatexko}[2019/06/07 v2.2 typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko}[2019/06/21 v2.3 typesetting Korean with LuaTeX]
\RequirePackage{luatexbase}
\RequirePackage{fontspec}
\else
@@ -22,6 +22,7 @@
\chardef\luatexkoatcatcode=\catcode`\@
\catcode`\@=11
\fi
+\newlanguage\koreanlanguage
\protected\def\pdfliteral{\pdfextension literal}
\newattribute\luatexkohangulfontattr
\newattribute\luatexkohanjafontattr
@@ -30,7 +31,7 @@
\newattribute\luatexkoclassicattr
\newattribute\luatexkodotemphattr
\newattribute\luatexkorubyattr \chardef\luatexkorubyalloc\allocationnumber
-\directlua{ require"luatexko.lua" }
+\directlua{ require"luatexko" }
% classic
\protected\def\typesetclassic{\luatexkoclassicattr\z@\parindent1em }
\protected\def\typesetvertical{\luatexkoclassicattr\@ne\parindent1em }
@@ -293,17 +294,17 @@
\directlua{require"luatexko-normalize"}%
\afterassignment\luatexkohangulnormalize\count@}
\def\luatexkohangulnormalize{%
- \ifcase\count@ \directlua{ luatexkonormalize.unload() }% 0: none
- \or \directlua{ luatexkonormalize.compose() }% 1: nfc
- \else \directlua{ luatexkonormalize.decompose() }% 2: nfd
+ \ifcase\count@ \directlua{ luatexko.normalize.unload() }% 0: none
+ \or \directlua{ luatexko.normalize.compose() }% 1: nfc
+ \else \directlua{ luatexko.normalize.decompose() }% 2: nfd
\fi }
% convert uhc to utf8
\def\luatexuhcinputencoding{%
\directlua{require"luatexko-uhc2utf8"}%
\afterassignment\luatexkouhcinputencoding\count@}
\def\luatexkouhcinputencoding{%
- \ifcase\count@ \directlua{ luatexkouhc2utf8.stopconvert() }%
- \else \directlua{ luatexkouhc2utf8.startconvert() }%
+ \ifcase\count@ \directlua{ luatexko.uhc2utf8.stopconvert() }%
+ \else \directlua{ luatexko.uhc2utf8.startconvert() }%
\fi}
% actualtext not provided
\protected\def\actualtext#1#{\luatexkoactualtext}