Skip to content

Commit

Permalink
fix spacechar on first page
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Apr 11, 2024
1 parent d788fe1 commit 7d501af
Show file tree
Hide file tree
Showing 5 changed files with 620 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ this project uses date-based 'snapshot' version identifiers.
- \tag_spacechar_on:, \tag_spacechar_off: to locally switch off
the real space chars.

### Fixed
- spacechar in floats on the first page

## [2024-03-27]
Version 0.99a
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions tagpdf-space.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
\pdfglyphtounicode{space}{0020}
\keys_define:nn { @@ / setup }
{
activate/spaces/true .code:n = { \pdfinterwordspaceon },
activate/spaces/false .code:n = { \pdfinterwordspaceoff },
activate/spaces/true .code:n = { \AddToHook{shipout/firstpage}[tagpdf/space]{\pdfinterwordspaceon} },
activate/spaces/false .code:n = { \RemoveFromHook{shipout/firstpage}[tagpdf/space] },
activate/spaces .default:n = true,
}
}
Expand Down
199 changes: 199 additions & 0 deletions testfiles/spacechar-float.luatex.tpf
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
%PDF-1.5
%���������
19 0 obj
<< /Length 380 >>
stream
/opacity1 gs
/Artifact BMC
EMC
/text<</MCID 0>> BDC
BT
/F15 9.96264 Tf
1 0 0 1 133.768 660.284 Tm [<0023002300230067002300230023>]TJ
ET
EMC
/Artifact BMC
EMC
/text<</MCID 1>> BDC
BT
/F15 9.96264 Tf
1 0 0 1 148.712 630.286 Tm [<001C001C001C0067001C001C001C>]TJ
ET
EMC
/Artifact BMC
EMC
/Artifact BMC
BT
/F15 9.96264 Tf
1 0 0 1 303.133 89.365 Tm [<0052>]TJ
ET
EMC
/Artifact BMC
EMC
endstream
endobj
18 0 obj
<< /Type /Page /Contents 19 0 R /Resources 17 0 R /MediaBox [ 0 0 612 792 ] /StructParents 0/Tabs /S /Parent 21 0 R >>
endobj
17 0 obj
<< /ExtGState 1 0 R /Font << /F15 20 0 R >> /ProcSet [ /PDF /Text ] >>
endobj
1 0 obj
<< /opacity1 <</ca 1/CA 1>> >>
endobj
22 0 obj
<< /Marked true >>
endobj
6 0 obj
<< /Nums [0 [ 0 0 R 0 0 R]
] >>
endobj
23 0 obj
<< /Limits [(ID.01) (ID.08)]/Names [(ID.01) 9 0 R (ID.02) 10 0 R (ID.03) 11 0 R (ID.04) 12 0 R (ID.05) 13 0 R (ID.06) 14 0 R (ID.07) 15 0 R (ID.08) 16 0 R ] >>
endobj
24 0 obj
<< /Kids [23 0 R] >>
endobj
7 0 obj
<< /Artifact /NonStruct /DocumentFragment /Art /Aside /Note /H7 /H6 /H8 /H6 /H9 /H6 /H10 /H6 /Title /P /FENote /Note /Sub /Span /Em /Span /Strong /Span /title /P /part /P /section /H2 /subsection /H3 /subsubsection /H4 /paragraph /H5 /subparagraph /H6 /list /L /itemize /L /enumerate /L /description /L /quote /BlockQuote /quotation /BlockQuote /verbatim /P /item /LI /itemlabel /Lbl /itembody /LBody /footnote /Note /footnotemark /Lbl /footnotelabel /Lbl /text-unit /Part /text /P /theorem-like /Sect /codeline /Span /float /Note /figures /Sect /tables /Sect /chapter /H1 >>
endobj
25 0 obj
<< /justify <</O/Layout/TextAlign/Justify>>
>>
endobj
9 0 obj
<< /Type /StructElem /S /Document /P 5 0 R /K [12 0 R 10 0 R] /ID (ID.01) >>
endobj
10 0 obj
<< /Type /StructElem /S /figures /P 9 0 R /K 14 0 R /ID (ID.02) >>
endobj
11 0 obj
<< /Type /StructElem /S /Artifact /P 5 0 R /ID (ID.03) >>
endobj
12 0 obj
<< /Type /StructElem /S /text-unit /P 9 0 R /K 13 0 R /ID (ID.04) >>
endobj
13 0 obj
<< /Type /StructElem /C /justify /S /text /P 12 0 R /K <</Type /MCR /Pg 18 0 R /MCID 1>> /ID (ID.05) >>
endobj
14 0 obj
<< /Type /StructElem /S /float /P 10 0 R /K 15 0 R /ID (ID.06) >>
endobj
15 0 obj
<< /Type /StructElem /S /text-unit /P 14 0 R /K 16 0 R /ID (ID.07) >>
endobj
16 0 obj
<< /Type /StructElem /C /justify /S /text /P 15 0 R /K <</Type /MCR /Pg 18 0 R /MCID 0>> /ID (ID.08) >>
endobj
5 0 obj
<< /Type /StructTreeRoot /IDTree 24 0 R /ClassMap 25 0 R /ParentTree 6 0 R /RoleMap 7 0 R /K 9 0 R >>
endobj
26 0 obj
[ 28 [ 500 ] 35 [ 556 ] 82 [ 500 ] 103 [ 333 ] ]
endobj
28 0 obj
<< /Length 13 >>
[BINARY STREAM]
endobj
29 0 obj
<< /Subtype /CIDFontType0C /Length 866 >>
[BINARY STREAM]
endobj
27 0 obj
<< /Type /FontDescriptor /FontName /COXIPJ+LMRoman10-Regular /Flags 4 /FontBBox [ -430 -290 1417 1127 ] /Ascent 1127 /CapHeight 683 /Descent -290 /ItalicAngle 0 /StemV 93 /XHeight 431 /FontFile3 29 0 R /CIDSet 28 0 R >>
endobj
30 0 obj
<< /Length 734 >>
stream
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-COXIPJ-LMRoman10-Regular-0)
%%Title: (TeX-COXIPJ-LMRoman10-Regular-0 TeX COXIPJ-LMRoman10-Regular 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (COXIPJ-LMRoman10-Regular)
/Supplement 0
>> def
/CMapName /TeX-Identity-COXIPJ-LMRoman10-Regular def
/CMapType 2 def
1 begincodespacerange
<0000> <FFFF>
endcodespacerange
0 beginbfrange
endbfrange
4 beginbfchar
<001C> <0061>
<0023> <0062>
<0052> <0031>
<0067> <0020>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
endstream
endobj
20 0 obj
<< /Type /Font /Subtype /Type0 /Encoding /Identity-H /BaseFont /COXIPJ+LMRoman10-Regular /DescendantFonts [ 31 0 R ] /ToUnicode 30 0 R >>
endobj
31 0 obj
<< /Type /Font /Subtype /CIDFontType0 /BaseFont /COXIPJ+LMRoman10-Regular /FontDescriptor 27 0 R /W 26 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
endobj
21 0 obj
<< /Type /Pages /Count 1 /Kids [ 18 0 R ] >>
endobj
32 0 obj
<< /Type /Catalog /Pages 21 0 R /MarkInfo 22 0 R/Lang (en-US)/StructTreeRoot 5 0 R >>
endobj
33 0 obj
<< /Producer (LuaTeX)/Creator (TeX) /CreationDate (D:20160520090000Z) /ModDate (D:20160520090000Z) /Trapped /False >>
endobj
xref
0 34
0000000002 65535 f
0000000682 00000 n
0000000003 00000 f
0000000004 00000 f
0000000008 00000 f
0000002434 00000 n
0000000765 00000 n
0000001026 00000 n
0000000000 00000 f
0000001682 00000 n
0000001775 00000 n
0000001859 00000 n
0000001934 00000 n
0000002020 00000 n
0000002142 00000 n
0000002225 00000 n
0000002312 00000 n
0000000595 00000 n
0000000460 00000 n
0000000020 00000 n
0000004670 00000 n
0000005024 00000 n
0000000729 00000 n
0000000813 00000 n
0000000989 00000 n
0000001618 00000 n
0000002552 00000 n
0000003640 00000 n
0000002617 00000 n
0000002690 00000 n
0000003876 00000 n
0000004824 00000 n
0000005086 00000 n
0000005188 00000 n
trailer
<< /Size 34 /Root 32 0 R /Info 33 0 R /ID [ <2350CAD05F8A7AF0AA4058486855344F> <2350CAD05F8A7AF0AA4058486855344F> ] >>
startxref
5322
%%EOF
13 changes: 13 additions & 0 deletions testfiles/spacechar-float.pvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
% this tests if space chars with floats on the first page are correctly handled.
\DocumentMetadata{testphase=phase-III,xmp=false}
\input{regression-test}
\documentclass{report}
\begin{document}\showoutput
aaa aaa

\begin{figure}
bbb bbb
\end{figure}


\end{document}
Loading

0 comments on commit 7d501af

Please sign in to comment.