summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2025-01-23 21:51:51 +0000
committerKarl Berry <karl@freefriends.org>2025-01-23 21:51:51 +0000
commit9761d2b4735b4bd6c257081c1e1231da57ae6795 (patch)
tree38e8fa2ee5e7d074ea396ec349176d0d4f2e9e42
parent9575330dbf8a3eec7d9cecbd204affe3f6358e36 (diff)
do not omit space chars at font changes, pdftex r942-3
git-svn-id: svn://tug.org/texlive/trunk@73569 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog15
-rw-r--r--Build/source/texk/web2c/pdftexdir/NEWS1
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftex.web22
3 files changed, 26 insertions, 12 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index fa299878b4b..cd87cdb3a12 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,6 +1,19 @@
-2025-01-22 Thanh Han The <hanthethanh@gmail.com>
+2025-01-23 Thanh Han The <hanthethanh@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@gmail.com>
* pdftex.web (scale_image): rename resolution_ratio to one_inch.
+ Suggestion from Thanh.
2025-01-18 Andreas Scherer <https://ascherer.github.io>
diff --git a/Build/source/texk/web2c/pdftexdir/NEWS b/Build/source/texk/web2c/pdftexdir/NEWS
index 4c6738d01da..d5ca1127aff 100644
--- a/Build/source/texk/web2c/pdftexdir/NEWS
+++ b/Build/source/texk/web2c/pdftexdir/NEWS
@@ -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.
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web
index a563dea8862..583111093e2 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftex.web
+++ b/Build/source/texk/web2c/pdftexdir/pdftex.web
@@ -15976,7 +15976,6 @@ DVI}
@!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 @@ begin
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 @@ found:
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 @@ begin
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 @@ var s_out, v, v_out: scaled;
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,23 +16248,22 @@ begin
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;
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 @@ begin
pdf_set_font(f);
end;
pdf_set_textmatrix(v, v_out, f);
- pdf_f := f;
s := 0;
end;