diff options
author | Karl Berry <karl@freefriends.org> | 2018-08-07 22:06:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-08-07 22:06:23 +0000 |
commit | 706448acbd096e1a59cb987e8352abdd43624ebe (patch) | |
tree | b15d896ae27ff72a04f6ffcdc9ed0fc2ccdc689b /Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty | |
parent | 23fec857e8f705b5595264d42d1265077d09654d (diff) |
tagpdf (7aug18)
git-svn-id: svn://tug.org/texlive/trunk@48366 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty | 95 |
1 files changed, 70 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty index 3c92767a107..898f33a7115 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty @@ -1,4 +1,4 @@ -\ProvidesExplPackage {tagpdf-struct-code} {2018/07/09} {0.2} +\ProvidesExplPackage {tagpdf-struct-code} {2018/08/06} {0.3} {part of tagpdf - code related to storing structure} % I will use a latex counter for the structure count @@ -9,8 +9,8 @@ \zref@newprop {tagstruct} [0] { \int_use:N \c@g__uftag_struct_abs_int } -\zref@newlist {tagpdfstruct} -\zref@addprop {tagpdfstruct}{tagstruct} +\zref@newlist {uftagzrlstruct} +\zref@addprop {uftagzrlstruct}{tagstruct} % a sequence stores structnum -> the obj numbers % to allow easy mapping over the structures @@ -243,19 +243,19 @@ } } { - \msg_error:nnn { tagpdf } { struct-no-objnum } { #1} + \msg_error:nnn {uftag} { struct-no-objnum } { #1} } } % keys for the user commands -% why did I call the submodule elem instead of struct? -\keys_define:nn { tagpdf / elem } +% should I pass the values (e.g. the tag) through an escape command? +\keys_define:nn { uftag / struct } { label .tl_set:N = \l__uftag_struct_key_label_tl, stash .bool_set:N = \l__uftag_struct_elem_stash_bool, tag .code:n = % S property - { - \__uftag_pdf_escape_name:Nn \l__uftag_tmpa_tl { #1 } + {%%????????? \pdfescapename?? + \tl_set:Nx \l__uftag_tmpa_tl { #1 } \bool_if:NT \g__uftag_check_tags_bool { \__uftag_check_structure_tag:N \l__uftag_tmpa_tl @@ -267,30 +267,75 @@ }, title .code:n = % T property { - \__uftag_pdf_escape_string:Nn \l__uftag_tmpa_tl { #1 } - \tl_put_left:Nn \l__uftag_tmpa_tl {(^^fe^^ff} - \__uftag_prop_gput:cno + \str_set_convert:Nnon + \l__uftag_tmpa_str + { #1 } + { \g__uftag_inputencoding_tl } + { utf16/hex } + \__uftag_prop_gput:cnx + { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } + { T } + { <\l__uftag_tmpa_str> } + }, + title-o .code:n = % T property + { + \str_set_convert:Nnon + \l__uftag_tmpa_str + { #1 } + { \g__uftag_inputencoding_tl } + { utf16/hex } + \__uftag_prop_gput:cnx { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } { T } - { \l__uftag_tmpa_tl) } + { <\l__uftag_tmpa_str> } }, alttext .code:n = % Alt property { - \__uftag_pdf_escape_string:Nn \l__uftag_tmpa_tl { #1 } - \tl_put_left:Nn \l__uftag_tmpa_tl {(^^fe^^ff} - \__uftag_prop_gput:cno + \str_set_convert:Nnon + \l__uftag_tmpa_str + { #1 } + { \g__uftag_inputencoding_tl } + { utf16/hex } + \__uftag_prop_gput:cnx { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } { Alt } - { \l__uftag_tmpa_tl) } + { <\l__uftag_tmpa_str> } + }, + alttext-o .code:n = % Alt property + { + \str_set_convert:Noon + \l__uftag_tmpa_str + { #1 } + { \g__uftag_inputencoding_tl } + { utf16/hex } + \__uftag_prop_gput:cnx + { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } + { Alt } + { <\l__uftag_tmpa_str> } }, actualtext .code:n = % ActualText property { - \__uftag_pdf_escape_hex:Nn \l__uftag_tmpa_tl {#1 } - \tl_put_left:Nn \l__uftag_tmpa_tl {<FEFF } - \__uftag_prop_gput:cno + \str_set_convert:Nnon + \l__uftag_tmpa_str + { #1 } + { \g__uftag_inputencoding_tl } + { utf16/hex } + \__uftag_prop_gput:cnx + { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } + { ActualText } + { <\l__uftag_tmpa_str>} + }, + actualtext-o .code:n = % ActualText property + { + \str_set_convert:Noon + \l__uftag_tmpa_str + { #1 } + { \g__uftag_inputencoding_tl } + { utf16/hex } + \__uftag_prop_gput:cnx { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } { ActualText } - { \l__uftag_tmpa_tl>} + { <\l__uftag_tmpa_str>} }, } @@ -319,19 +364,19 @@ { g__uftag_struct_\int_eval:n { \c@g__uftag_struct_abs_int }_prop } { entries } { StructElem } - \keys_set:nn {tagpdf / elem} { #1 } + \keys_set:nn {uftag / struct} { #1 } \__uftag_check_structure_has_tag:n { \int_eval:n {\c@g__uftag_struct_abs_int} } \tl_if_empty:NF {\l__uftag_struct_key_label_tl} { - \zref@labelbylist{tagpdfstruct-\l__uftag_struct_key_label_tl}{tagpdfstruct} + \zref@labelbylist{tagpdfstruct-\l__uftag_struct_key_label_tl}{uftagzrlstruct} } %get the potential parent from the stack: \seq_get:NNF \g__uftag_struct_stack_seq \l__uftag_struct_stack_parent_tmp_tl { - \msg_error:nn { tagpdf } { struct-faulty-nesting } + \msg_error:nn { uftag } { struct-faulty-nesting } } \seq_gpush:NV \g__uftag_struct_stack_seq \c@g__uftag_struct_abs_int \tl_gset:NV \g__uftag_struct_stack_current_tl \c@g__uftag_struct_abs_int @@ -381,7 +426,7 @@ \cs_new:Nn \uftag_struct_use:n %#1 is the label { \prop_if_exist:cTF - { g__uftag_struct_\zref@extractdefault{tagpdfstruct-#1}{tagstruct}{unknown}_prop } + { g__uftag_struct_\zref@extractdefault{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %?????????? { \__uftag_check_struct_used:n {#1} %add the label structure as kid to the current structure (can be the root) @@ -396,7 +441,7 @@ \prop_item:cn { g__uftag_struct_\g__uftag_struct_stack_current_tl _prop} { objnum }~0~R } } - {\msg_warning:nnn{tagpdf}{struct-label-unknown}{#1}} + {\msg_warning:nnn{uftag}{struct-label-unknown}{#1}} } \endinput |