summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx')
-rw-r--r--Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx81
1 files changed, 71 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx b/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx
index b0a68ae1af3..ea5e247e456 100644
--- a/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx
+++ b/Master/texmf-dist/tex/latex/xcjk2uni/xCJK2uni-make.ltx
@@ -21,17 +21,62 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xCJK2uni.dtx 512 2013-08-17 15:03:03Z sobenlee $
+\GetIdInfo$Id: xCJK2uni.dtx 643 2014-04-29 09:36:22Z sobenlee $
{Convert CJK character to Unicode.}
\ProvidesExplFile{xCJK2uni-make.ltx}
- {\ExplFileDate}{0.1}{\ExplFileDescription}
+ {\ExplFileDate}{0.2}{\ExplFileDescription}
+\msg_new:nnn { xCJK2uni } { file-not-found }
+ {
+ SFD file~`#2'~for~encoding~`#1'~not~found.\\
+ xCJK2uni~will~not~work!
+ }
+\msg_new:nnn { xCJK2uni } { shell-escape }
+ { Please~call~`#1'~with~the~`--shell-escape'~option. }
+\char_set_catcode_letter:N \@
+\int_compare:nNnF
+ {
+ \cs_if_exist_use:NF \pdf@shellescape
+ { \cs_if_exist_use:NF \shellescape { \pdfshellescape } }
+ } = \c_one
+ {
+ \msg_fatal:nnx { xCJK2uni } { shell-escape }
+ {
+ \luatex_if_engine:TF { LuaLaTeX }
+ {
+ \pdftex_if_engine:TF
+ { \if_case:w \pdftex_pdfoutput:D LaTeX \else: pdfLaTeX \fi: }
+ { XeLaTeX }
+ }
+ }
+ }
+\ior_new:N \g__CJKtu_sfd_ior
+\tl_new:N \g__CJKtu_path_str
+\tl_const:Nn \c__CJKtu_cmd_tl { kpsewhich ~ UGBK.sfd }
+\luatex_if_engine:TF
+ { \tl_gset:Nx \g__CJKtu_path_str { \pdf@pipe { \c__CJKtu_cmd_tl } } }
+ {
+ \tex_immediate:D \tex_write:D 18
+ { \c__CJKtu_cmd_tl > \c_job_name_tl .aux }
+ \ior_open:NnTF \g__CJKtu_sfd_ior { \c_job_name_tl .aux }
+ {
+ \ior_get_str:NN \g__CJKtu_sfd_ior \g__CJKtu_path_str
+ \ior_close:N \g__CJKtu_sfd_ior
+ }
+ { \msg_fatal:nnnn { xCJK2uni } { file-not-found } { GBK } { UGBK.sfd } }
+ }
+\tl_if_blank:oTF { \g__CJKtu_path_str }
+ { \msg_fatal:nnnn { xCJK2uni } { file-not-found } { GBK } { UGBK.sfd } }
+ {
+ \seq_set_split:NnV \l_tmpa_seq { / } \g__CJKtu_path_str
+ \seq_pop_right:NN \l_tmpa_seq \g__CJKtu_path_str
+ \tl_gset:Nx \g__CJKtu_path_str { \seq_use:Nn \l_tmpa_seq { / } }
+ }
\tl_const:Nx \c__CJKtu_hash_str { \iow_char:N \# }
\tl_const:Nx \c__CJKtu_lbrace_str { \iow_char:N \{ }
\tl_const:Nx \c__CJKtu_rbrace_str { \iow_char:N \} }
\tl_const:Nx \c__CJKtu_backslash_str { \iow_char:N \\ }
\tl_const:Nx \c__CJKtu_indent_str
{ \c_catcode_other_space_tl \c_catcode_other_space_tl }
-\ior_new:N \g__CJKtu_sfd_ior
\iow_new:N \g__CJKtu_sfd_map_iow
\iow_new:N \g__CJKtu_sfd_cmap_iow
\seq_new:N \l__CJKtu_sfd_plane_seq
@@ -49,7 +94,7 @@
\cs_new_protected_nopar:Npn \__CJKtu_write_file:nnn #1#2#3
{
\group_begin:
- \file_path_include:n { sfd/ }
+ \file_path_include:n { \g__CJKtu_path_str / }
\ior_open:NnTF \g__CJKtu_sfd_ior { #3.sfd }
{
\group_end:
@@ -81,11 +126,6 @@
\msg_critical:nnxx { xCJK2uni } { file-not-found } {#1} { #3.sfd }
}
}
-\msg_new:nnn { xCJK2uni } { file-not-found }
- {
- SFD file~`#2'~for~encoding~`#1'~not~found.\\
- xCJK2uni~will~not~work!
- }
\group_begin:
\char_set_lccode:nn { \c_zero } { `\\ }
\char_set_lccode:nn { \c_one } { `\x }
@@ -123,7 +163,7 @@
\iow_now:Nx \g__CJKtu_sfd_map_iow
{
\c__CJKtu_indent_str \c__CJKtu_indent_str \c__CJKtu_indent_str
- \seq_use:Nnnn \l__CJKtu_sfd_line_seq { \or: } { \or: } { \or: }
+ \seq_use:Nn \l__CJKtu_sfd_line_seq { \or: }
\token_to_str:N \or:
}
}
@@ -208,6 +248,7 @@
%%~This~is~file~`xCJK2uni-#2.def',\iow_newline:
%%~generated~from~file~`#2.sfd'~by~`xCJK2uni-make.ltx'.\iow_newline:
%% \iow_newline:
+ \__CJKtu_identification:n { xCJK2uni-#2.def }
\cs_new_nopar:cpn { ~ CJKtu_#1_sfd_map:nn ~ } ~ \c__CJKtu_hash_str 1
\iow_newline: \c__CJKtu_indent_str \c__CJKtu_lbrace_str \iow_newline:
\c__CJKtu_indent_str \c__CJKtu_indent_str
@@ -219,6 +260,26 @@
\c__CJKtu_indent_str \c__CJKtu_rbrace_str
}
}
+\group_begin:
+\char_set_catcode_space:n { 32 }
+\tl_const:Nx \c__CJKtu_svn_id_str
+ {\tl_to_str:n {$Id: xCJK2uni.dtx 643 2014-04-29 09:36:22Z sobenlee $}}
+\group_end:
+\cs_new_nopar:Npx \__CJKtu_identification:n #1
+ {
+ \token_to_str:N \GetIdInfo \c__CJKtu_svn_id_str
+ \iow_newline:
+ \c__CJKtu_indent_str
+ \c__CJKtu_lbrace_str Convert~CJK~character~to~Unicode. \c__CJKtu_rbrace_str
+ \iow_newline:
+ \token_to_str:N \ProvidesExplFile \c__CJKtu_lbrace_str #1 \c__CJKtu_rbrace_str
+ \iow_newline:
+ \c__CJKtu_indent_str
+ \c__CJKtu_lbrace_str \token_to_str:N \ExplFileDate \c__CJKtu_rbrace_str
+ \c__CJKtu_lbrace_str 0.2 \c__CJKtu_rbrace_str
+ \c__CJKtu_lbrace_str \token_to_str:N \ExplFileDescription \c__CJKtu_rbrace_str
+ \iow_newline:
+ }
\cs_new_protected_nopar:Npn \__CJKtu_write_sfd_map_trailer:n #1
{
\iow_now:Nx \g__CJKtu_sfd_map_iow