texlive[73569] Build/source/texk/web2c/pdftexdir: do not omit space

commits+karl at tug.org commits+karl at tug.org
Thu Jan 23 22:51:51 CET 2025


Revision: 73569
          https://tug.org/svn/texlive?view=revision&revision=73569
Author:   karl
Date:     2025-01-23 22:51:51 +0100 (Thu, 23 Jan 2025)
Log Message:
-----------
do not omit space chars at font changes, pdftex r942-3

Revision Links:
--------------
    https://tug.org/svn/texlive?view=revision&revision=942

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    trunk/Build/source/texk/web2c/pdftexdir/NEWS
    trunk/Build/source/texk/web2c/pdftexdir/pdftex.web

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2025-01-23 20:59:03 UTC (rev 73568)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2025-01-23 21:51:51 UTC (rev 73569)
@@ -1,6 +1,19 @@
-2025-01-22  Thanh Han The  <hanthethanh at gmail.com>
+2025-01-23  Thanh Han The  <hanthethanh at gmail.com>
 
+	* pdftex.web (Glob...): remove pdf_last_f; remove uses.
+	(pdf_set_f): test and set pdf_f.
+	(pdf_begin_string): new variable move_by_tm.
+	Test gen_faked_interword_space and new move_by_tm to determine
+	when to insert a space.
+	Report from Ulrike Fischer:
+	  https://tug.org/pipermail/pdftex/2024-July/009424.html
+	with followup from Ross Moore:
+	  https://tug.org/pipermail/pdftex/2025-January/009426.html
+
+2025-01-22  Karl Berry  <hanthethanh at gmail.com>
+
 	* pdftex.web (scale_image): rename resolution_ratio to one_inch.
+	Suggestion from Thanh.
 
 2025-01-18  Andreas Scherer  <https://ascherer.github.io>
 

Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS	2025-01-23 20:59:03 UTC (rev 73568)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS	2025-01-23 21:51:51 UTC (rev 73569)
@@ -3,6 +3,7 @@
     if \pdfmajorversion >= 2, the PTEX.Fullbanner and other dictionary
     entries use an _ instead of ., as in PTEX_Fullbanner.
 - bugfixes:
+  - don't omit real spaces just because the font changes.
   - increase tolerance for detecting interword spaces in overfull lines.
   - ignore tiny resolutions like 1x1 embedded in images instead of
     exceeding \maxdimen.

Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2025-01-23 20:59:03 UTC (rev 73568)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2025-01-23 21:51:51 UTC (rev 73569)
@@ -15976,7 +15976,6 @@
 @!pdf_draftmode_value: integer;
 @!pdf_cur_Tm_a: integer; {|a| value of the current text matrix, i.e., the current
                           horizontal scaling factor}
-@!pdf_last_f: internal_font_number; {last font in PDF output page}
 @!pdf_last_fs: internal_font_number; {last font size in PDF output page}
 @!pdf_dummy_font: internal_font_number; {font used to insert artificial interword spaces}
 
@@ -16162,7 +16161,7 @@
     end;
     pdf_append_list(f)(pdf_font_list); {|f| not found in |pdf_font_list|, append it now}
 found:
-    if (k = pdf_last_f) and (font_size[f] = pdf_last_fs) then
+    if (k = pdf_f) and (font_size[f] = pdf_last_fs) then
         return;
     pdf_print("/F");
     pdf_print_int(k);
@@ -16170,7 +16169,7 @@
     pdf_out(" ");
     pdf_print_real(divide_scaled(font_size[f], one_hundred_bp, 6), 4);
     pdf_print(" Tf");
-    pdf_last_f := k;
+    pdf_f := k;
     pdf_last_fs := font_size[f];
 end;
 
@@ -16180,7 +16179,6 @@
     pdf_print_ln("BT");
     pdf_doing_text := true;
     pdf_f := null_font;
-    pdf_last_f := null_font;
     pdf_last_fs := 0;
     pdf_doing_string := false;
     pdf_cur_Tm_a := 0;
@@ -16209,10 +16207,14 @@
     s: integer;
     must_end_string: boolean;  {must we end the current string?}
     must_insert_space: boolean;  {must we insert an interword space?}
+    move_by_tm: boolean;  {movement must be set using Tm operator}
+
 begin
     if not pdf_doing_text then
         pdf_begin_text;
-    if f <> pdf_f then begin
+   if (not gen_faked_interword_space and pdf_f <> f)
+      or (gen_faked_interword_space and not (font_used[f] and font_used[pdf_f]))
+    then begin
         pdf_end_string;
         pdf_set_font(f);
     end;
@@ -16246,16 +16248,15 @@
 
     must_insert_space := false;
     must_end_string := false;
+    move_by_tm := (v <> 0) or (abs(s) >= @'100000);
 
-    if (f <> pdf_f) or (v <> 0) or (abs(s) >= @'100000) then begin
+    if move_by_tm then begin
         must_end_string := true;
     end;
 
     if gen_faked_interword_space
-        and pdf_doing_string
-        and (not must_end_string)
+        and (not move_by_tm)
         and (s_out > space(f) - space_shrink(f) - 65536)
-        and (v = 0)
     then begin
         must_insert_space := true;
     end;
@@ -16262,7 +16263,7 @@
 
     if (must_insert_space) then begin
         {insert a real space char from the font when possible}
-        if pdf_font_has_space_char[f]  then begin
+        if pdf_font_has_space_char[f] and pdf_doing_string then begin
             pdf_out(" ");
             save_pdf_delta_h := pdf_delta_h;
             adv_char_width(f, 32, 3); { to get |adv_char_width_s| and |adv_char_width_s_out|}
@@ -16282,7 +16283,6 @@
             pdf_set_font(f);
         end;
         pdf_set_textmatrix(v, v_out, f);
-        pdf_f := f;
         s := 0;
     end;
 



More information about the tex-live-commits mailing list.