summaryrefslogtreecommitdiff
path: root/language/korean/pmhanguljamo/tex/pmhanguljamo.sty
diff options
context:
space:
mode:
Diffstat (limited to 'language/korean/pmhanguljamo/tex/pmhanguljamo.sty')
-rw-r--r--language/korean/pmhanguljamo/tex/pmhanguljamo.sty35
1 files changed, 27 insertions, 8 deletions
diff --git a/language/korean/pmhanguljamo/tex/pmhanguljamo.sty b/language/korean/pmhanguljamo/tex/pmhanguljamo.sty
index aa2a2b704b..0d0d8e01ff 100644
--- a/language/korean/pmhanguljamo/tex/pmhanguljamo.sty
+++ b/language/korean/pmhanguljamo/tex/pmhanguljamo.sty
@@ -22,8 +22,8 @@
\RequirePackage{xparse}
\ProvidesExplPackage
{pmhanguljamo}
- {2020/02/05}
- {v0.3.2}
+ {2020/03/15}
+ {v0.3.4}
{Poorman's Hangul Jamo Input Method}
\RequirePackage{l3keys2e}
@@ -178,8 +178,8 @@
\regex_replace_all:nnN { : } { :/ } \l_tmpa_tl
\exp_args:Nno \regex_split:nnN { / } { \l_tmpa_tl } \l_tmpa_seq
-
- \seq_map_function:NN \l_tmpa_seq \build_syl:n
+
+ \seq_indexed_map_function:NN \l_tmpa_seq \build_syl:nn
}
\tl_new:N \l_cho_tl
@@ -220,17 +220,26 @@
}
}
-\cs_new:Npn \build_syl:n #1
+%%% if xetexko loaded,
+\bool_new:N \g_xetexko_bool
+\@ifpackageloaded{xetexko-space}{
+ \bool_gset_true:N \g_xetexko_bool
+}{
+ \bool_gset_false:N \g_xetexko_bool
+}
+
+\cs_new:Npn \build_syl:nn #1 #2
{
\bool_set_false:N \l_jj_bool
\tl_clear:N \l_cho_tl
\tl_clear:N \l_jun_tl
\tl_clear:N \l_jon_tl
- \build_syl_fn:n #1 \q_recursion_tail \q_recursion_stop
+ \int_set:Nn \l_tmpa_int { #1 }
+ \build_syl_fn:n #2 \q_recursion_tail \q_recursion_stop
}
\cs_new:Npn \build_syl_fn:n #1
-{
+{
\quark_if_recursion_tail_stop_do:nn { #1 }
{
\exp_args:Nnx \regex_match:nnTF { [A-Z] } { \l_cho_tl }
@@ -246,10 +255,20 @@
\tl_set:Nx \l_tmpb_tl { \tl_tail:N \l_jon_tl }
\tl_reverse:N \l_tmpb_tl
+ %%% force allowbreak'ing hangul syllables when xetexko loaded
+ %%% luatexko or polyglossia is of no problem.
+ \bool_if:NT \g_xetexko_bool {
+ \exp_args:Nnx \regex_match:nnT { [a-z] } { \l_cho_tl }
+ {
+ \int_compare:nF { \l_tmpa_int == 1 }
+ { \allowbreak }
+ }
+ }
+ %%% print out the syllable composed
\exp_args:NNx \prop_item:Nn \c_cho_prop { \l_cho_tl }
\exp_args:NNx \prop_item:Nn \c_jung_prop { \l_jun_tl }
\exp_args:NNx \prop_item:Nn \c_jong_prop { \l_tmpb_tl }
- \exp_args:NNx \prop_item:Nn \c_jong_prop { \l_tmpa_tl }
+ \exp_args:NNx \prop_item:Nn \c_jong_prop { \l_tmpa_tl } %% tone mark
}
}