[pdftex] Bug LiteralDirectFirstSpace

Heiko Oberdiek oberdiek at uni-freiburg.de
Sun Feb 16 00:33:34 CET 2003


Bug "LiteralSpaceFirstSpace":

%%% cut %%% test.tex %%% cut %%%
\nopagenumbers
\pdfcompresslevel=0

Hello
\pdfliteral direct{}%
1%
\pdfliteral direct{}%
!

World\kern100bp\relax
\pdfliteral direct{}%
2%
\pdfliteral direct{}%
!

\bye
%%% cut %%% test.tex %%% cut %%%

Look at the space between the number and the exclamation mark.
It seems, that pdf_first_space_corr is applied twice and
should suppressed the second times. The content of the
\pdfliteral does not matter.

%%% page content stream %%%
stream
1 0 0 1 91.925 759.927 cm
BT
/F1 9.963 Tf 0 0 Td[(Hello)]TJ

[-333(1)]TJ

[-333(!)]TJ 0 -11.955 Td[(W)84(orld)]TJ

[-10037(2)]TJ

[-10037(!)]TJ
ET
endstream
%%% page content stream %%%

The second "-333" and "-10037" should be omitted.
This bug prevents the use of color setting by
"\pdfliteral direct" instead of "\pdfliteral" that
wastes a lot of space, because it ends the text
area sets the CTM and afterwards the CTM is set
again and the text area is started. But for color
setting an exact position is not needed at all.

I do not have fully understand the purpose and need of
pdf_first_space_corr yet, so the following is only a first
quick hack.
  Perhaps someone can try a closer look at the positioning
problem, provide test files for the problem that leads to
pdf_first_space_corr or can provide even a solution.

Patch file for pdfTeX 1.10b-beta-20030213 (and older versions):

%%% cut %%% pdftex.ch.diff %%% cut %%%
*** pdftex.ch.org	Sun Feb 16 00:12:49 2003
--- pdftex.ch	Sun Feb 16 00:15:56 2003
***************
*** 1306,1311 ****
--- 1306,1313 ----
          pdf_set_origin;
      end
      else begin
+         pdf_first_space_corr:=0;
+         {Does the previous line fix the bug "LiteralDirectFirstSpace"?}
          pdf_end_string;
          pdf_print_nl;
      end;
%%% cut %%% pdftex.ch.diff %%% cut %%%

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 


More information about the pdftex mailing list