diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-24 18:00:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-24 18:00:42 +0000 |
commit | 12819de5a193a81ba460e12c80e9e5af3d88e8a7 (patch) | |
tree | fa3f87dafcc4c8614fa373e364f77826a485ce02 /Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx | |
parent | 1f8a99f91f89d808a685fb90434693017786a8a6 (diff) | |
parent | 3ce790a95a47285842ce11676520c9ebaa3d6d83 (diff) |
sync with trunk 57871; starting pretest
git-svn-id: svn://tug.org/texlive/branches/branch2020@57872 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx new file mode 100644 index 00000000000..edc5e445c70 --- /dev/null +++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx @@ -0,0 +1,89 @@ +% \iffalse meta-comment +% +%% File: tagpdf-space.dtx +% +% Copyright (C) 2019 Ulrike Fischer +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% https://www.latex-project.org/lppl.txt +% +% This file is part of the "tagpdf bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/u-fischer/tagpdf +% +% for those people who are interested. +% +% \fi +% +% \begin{macrocode} +%<@@=tag> +%<*space> +\ProvidesExplPackage {tagpdf-space-code} {2021/02/23} {0.80} + {part of tagpdf - code related to real space chars} +% luatex uses an attribute (declared in the driver file) and some luacode in tagpdf.lua +% perhaps I will split the code by engine in the future + +\sys_if_engine_pdftex:T + { + \pdfglyphtounicode{space}{0020} + \keys_define:nn { @@ / setup } + { + interwordspace .choices:nn = { true, on } { \pdfinterwordspaceon }, + interwordspace .choices:nn = { false, off }{ \pdfinterwordspaceon }, + show-spaces .bool_set:N = \l_@@_showspaces_bool + } + } + + +\sys_if_engine_luatex:T + { + \keys_define:nn { @@ / setup } + { + interwordspace .choices:nn = + { true, on } + { \directlua{ltx.@@.func.markspaceon()} }, + interwordspace .choices:nn = + { false, off } + {\directlua{ltx.@@.func.markspaceoff()} }, + show-spaces .choice:, + show-spaces / true .code:n = + {\directlua{ltx.@@.trace.showspaces=true}}, + show-spaces / false .code:n = + {\directlua{ltx.@@.trace.showspaces=nil}}, + show-spaces .default:n = true + } + + \cs_new_protected:Nn \@@_fakespace: + { + \group_begin: + \setattribute\g_@@_interwordspace_attr{1} + \setattribute\g_@@_interwordfont_attr + { + \directlua{tex.print(\the\catcodetable@latex, font.current())} + } + \skip_horizontal:n{\c_zero_skip} + \group_end: + } + } + +\sys_if_engine_xetex:T + { + \keys_define:nn { @@ / setup } + { + interwordspace .choices:nn = { true, on } { \msg_warning:nnn {tag}{sys-no-interwordspace}{xetex} }, + interwordspace .choices:nn = { false, off }{ \msg_warning:nnn {tag}{sys-no-interwordspace}{xetex} }, + show-spaces .bool_set:N = \l_@@_showspaces_bool + } + } + +%</space> +% \end{macrocode} |