diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty b/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty index 59853b9dd07..c282b3c6ad1 100644 --- a/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty +++ b/Master/texmf-dist/tex/latex/pmhanguljamo/pmhanguljamo.sty @@ -22,14 +22,15 @@ \RequirePackage{xparse} \ProvidesExplPackage {pmhanguljamo} - {2022/09/02} - {v0.5} + {2022/09/06} + {v0.5.1} {Poorman's Hangul Jamo Input Method} \RequirePackage{l3keys2e} \bool_new:N \opt_usepmfont_bool \tl_new:N \opt_pmfont_tl +\tl_new:N \opt_pmfontfeature_tl \keys_define:nn { pmhanguljamo } { @@ -38,7 +39,8 @@ pmfont .code:n = { \bool_gset_true:N \opt_usepmfont_bool \tl_gset:Nn \opt_pmfont_tl { #1 } - } + }, + pmfontfeature .tl_set:N = \opt_pmfontfeature_tl } \ProcessKeysOptions { pmhanguljamo } @@ -179,9 +181,29 @@ \bool_gset_true:N \opt_usepmfont_bool } -\NewDocumentCommand \setpmhangulfont { m } +\NewDocumentCommand \unusepmfont { } { - \tl_gset:Nn \opt_pmfont_tl { #1 } + \bool_gset_false:N \opt_usepmfont_bool +} + +\NewDocumentCommand \setpmhangulfont { o m o } +{ + \tl_gset:Nn \opt_pmfont_tl { #2 } + \IfValueTF { #3 } { \tl_gset:Nn \opt_pmfontfeature_tl { #3, Script=Hangul, Renderer=OpenType } } + { + \IfValueTF { #1 } { \tl_gset:Nn \opt_pmfontfeature_tl { #1, Script=Hangul, Renderer=OpenType } } + { \tl_gset:Nn \opt_pmfontfeature_tl { Script=Hangul, Renderer=OpenType } } + } +} + +\AtBeginDocument{ + \tl_if_empty:NTF \opt_pmfontfeature_tl + { + \tl_gset:Nn \opt_pmfontfeature_tl { Script=Hangul, Renderer=OpenType } + } + { + \tl_gput_right:Nn \opt_pmfontfeature_tl { , Script=Hangul, Renderer=OpenType } + } } %%%% if RRK is given, then input pmhanguljamo-rrk.sty @@ -270,7 +292,12 @@ \seq_map_indexed_inline:Nn \l_inputword_seq { \bool_if:NTF \opt_usepmfont_bool - { {\pm_hangulfontspec[Script=Hangul,Renderer=OpenType]{\opt_pmfont_tl} \jamotextcmd{ ##2 } } } + { + { + \pm_hangulfontspec [\opt_pmfontfeature_tl] {\opt_pmfont_tl} + \jamotextcmd{ ##2 } + } + } { \jamotextcmd { ##2 } } \int_compare:nT { ##1 < \seq_count:N \l_inputword_seq } { \space } @@ -374,6 +401,7 @@ \NewDocumentCommand \ColonMark {} { : } \NewDocumentCommand \SemiColonMark {} { ; } \NewDocumentCommand \SlashMark {} { / } +\NewDocumentCommand \CntrdotMark {} { ยท } %%%%%%%%% DICTIONARIES \prop_const_from_keyval:Nn \c_cho_prop @@ -794,5 +822,29 @@ | = {} } +%%%% underline +\NewDocumentCommand \jamoul { m m } +{ + \tl_set:Nn \l_pmulcmdnm_tl { #1 } + \seq_set_split:Nnn \l_pmlli_seq { ~ } { #2 } + \seq_map_indexed_function:NN \l_pmlli_seq \_tr_ulfn:nn +} + +\cs_new:Npn \_tr_ulfn:nn #1 #2 +{ + \tl_set:Nn \l_tmpz_tl { #2 } + \regex_replace_all:nnN { \: } { \:\/ } \l_tmpz_tl + \regex_replace_all:nnN { \; } { \;\/ } \l_tmpz_tl + \seq_set_split:NnV \l_pmnni_seq { / } \l_tmpz_tl + \seq_map_inline:Nn \l_pmnni_seq + { + \exp_args:No \use:c { \l_pmulcmdnm_tl } { \jamoword { ##1 } } + } + \int_compare:nT { #1 < \seq_count:N \l_pmlli_seq } + { + \exp_args:No \use:c { \l_pmulcmdnm_tl } {\space} + } +} + \endinput |