diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def index acaafe40e19..8b8d9f876cb 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def @@ -26,10 +26,59 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $ {(pdf)LaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-pdftex.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\seq_new:N \c__ctex_cmap_encoding_seq +\seq_set_from_clist:Nn \c__ctex_cmap_encoding_seq + { C19 , C10 , C00 , C09 , C40 , C60 } +\cs_new_protected_nopar:Npn \ctex_family_cmap:nn #1#2 + { + \cs_if_free:cF { #1 + #2 } + { + \seq_if_in:NnT \c__ctex_cmap_encoding_seq {#1} + { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } } + } + } +\cs_generate_variant:Nn \ctex_family_cmap:nn { x } +\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn +\cs_new_protected_nopar:Npn \ctex_add_cmap:n #1 + { + \cs_if_free:NF \CJK@plane + { \ctex_add_cmap:cn { __ctex_add_cmap_ #1 \CJK@plane : } {#1} } + } +\cs_new_protected_nopar:Npn \ctex_add_cmap:Nn #1#2 + { + \cs_if_exist:NF #1 { \__ctex_save_cmap:Nn #1 {#2} } + #1 + } +\cs_generate_variant:Nn \ctex_add_cmap:Nn { c } +\cs_new_protected_nopar:Npn \__ctex_save_cmap:Nn #1#2 + { + \tex_lowercase:D { \tl_set:Nx \l__ctex_tmp_tl { #2 \CJK@plane } } + \tex_immediate:D \pdfobj stream ~ file { \l__ctex_tmp_tl .cmap } + \cs_new_protected_nopar:Npx #1 + { + \exp_not:N \pdffontattr \exp_not:N \font + { /ToUnicode ~ \int_use:N \pdflastobj \c_space_tl 0 ~ R } + } + } +\group_begin: +\char_set_catcode_other:N \# +\ctex_if_pdfmode:TF + { + \group_end: + \ExplSyntaxOff + \ctex_appto_cmd:NnTF \DeclareFontFamily { \CTEX@Family@CMap {#1} {#2} } + { + \ctex_at_end_package:nn { cmap } + { \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn } + } + { \ctex_patch_failure:N \DeclareFontFamily } + \ExplSyntaxOn + } + { \group_end: } \if_bool:N \g__ctex_zhmCJK_bool \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhmCJK } \RequirePackage { zhmCJK } @@ -127,7 +176,7 @@ } \cs_new_protected_nopar:Npn \ctex_set_ignorespaces: { \cs_set_eq:NN \CJK@ignorespaces \ctex_auto_ignorespaces: } -\ctex_add_hook:Nn \CJKhook { \ctex_set_ignorespaces: } +\ctex_gadd_hook:Nn \CJKhook { \ctex_set_ignorespaces: } \cs_new_protected_nopar:Npn \ctex_punct_set:n #1 { \clist_map_inline:Nn \c__ctex_punct_family_clist @@ -233,7 +282,7 @@ { \tl_gset:Nn \g__ctex_fontset_tl {#1} } { \tl_gset:Nn \g__ctex_fontset_tl {#2} } } -\tl_const:Nn \c__ctex_macosx_file_tl { /mach_kernel } +\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc } \ctex_hypersetup:n { driverfallback = dvipdfmx } \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { @@ -253,11 +302,14 @@ } } { \ctex_hypersetup:n { pdfencoding = unicode } } -\RequirePackage { CJKfntef } \normalem +\RequirePackage { CJKfntef } +\normalem +\cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1 + { \tl_clear:c { CJK#1color } } \clist_map_inline:nn { underdot , underline , underdblline , underwave , sout , xout } { - \tl_clear:c { CJK#1color } + \__ctex_clear_fntef_color:n {#1} \cs_new_protected_nopar:cpx { CTEX#1 } { \msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } } |