Skip to content

Commit

Permalink
add code to stop spacechars, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Apr 10, 2024
1 parent 9b23f70 commit df25f7c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tagpdf-backend.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,12 @@ functions
% The interwordfont attr is set by the function |@@_mark_spaces| too and
% stores the font, so that we can decide which font
% to use for the real space char.
% The interwordspaceOff attr allows to locally suppress the insertion of
% real space chars, e.g. when they are inserted by other means (e.g. with |\char|).
% \begin{macrocode}
local mctypeattributeid = luatexbase.new_attribute ("g_@@_mc_type_attr")
local mccntattributeid = luatexbase.new_attribute ("g_@@_mc_cnt_attr")
local iwspaceOffattributeid = luatexbase.new_attribute ("g__tag_interwordspaceOff_attr")
local iwspaceattributeid = luatexbase.new_attribute ("g_@@_interwordspace_attr")
local iwfontattributeid = luatexbase.new_attribute ("g_@@_interwordfont_attr")
% \end{macrocode}
Expand Down Expand Up @@ -877,7 +880,10 @@ local function @@_space_chars_shipout (box)
local head = box.head
if head then
for n in node.traverse(head) do
local spaceattr = nodegetattribute(n,iwspaceattributeid) or -1
local spaceattr = -1
if not nodehasattribute(n,iwspaceOffattributeid) then
spaceattr = nodegetattribute(n,iwspaceattributeid) or -1
end
if n.id == HLIST then -- enter the hlist
@@_space_chars_shipout (n)
elseif n.id == VLIST then -- enter the vlist
Expand Down

0 comments on commit df25f7c

Please sign in to comment.