texlive[65764] Build/source/texk/web2c/pdftexdir: sync with pdftex
commits+karl at tug.org
commits+karl at tug.org
Thu Feb 9 19:36:48 CET 2023
Revision: 65764
http://tug.org/svn/texlive?view=revision&revision=65764
Author: karl
Date: 2023-02-09 19:36:47 +0100 (Thu, 09 Feb 2023)
Log Message:
-----------
sync with pdftex r892 (interim interword /space change)
Revision Links:
--------------
http://tug.org/svn/texlive?view=revision&revision=892
Modified Paths:
--------------
trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2023-02-09 00:49:15 UTC (rev 65763)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2023-02-09 18:36:47 UTC (rev 65764)
@@ -1,3 +1,8 @@
+2023-12-28 Thanh Han The <hanthethanh at gmail.com>
+
+ * pdftex.web: use real space char for \pdfinterwordspaceon,
+ but only works for fonts containing the real space char.
+
2023-01-20 Phelype Oleinik <phe.h.o1 at gmail.com>
* pdftex.web: implement shipout keyword for delayed expansion
Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web 2023-02-09 00:49:15 UTC (rev 65763)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web 2023-02-09 18:36:47 UTC (rev 65764)
@@ -15783,6 +15783,8 @@
@!scaled_out: integer; {amount of |scaled| that was taken out in
|divide_scaled|}
@!init_pdf_output: boolean;
+@!adv_char_width_s: integer; {to save result of calculation done in |adv_char_width| }
+@!adv_char_width_s_out: scaled;
@ @<Set init...@>=
one_bp := 65782; {65781.76}
@@ -15869,8 +15871,8 @@
as we have to deal with scaling bitmaps as well.
@p
-procedure adv_char_width(f: internal_font_number; c: eight_bits); {update |pdf_h|
-by character width |w| from font |f|}
+procedure adv_char_width(f: internal_font_number; c: eight_bits; dd: eight_bits);
+{update |pdf_delta_h| by character width |w| from font |f|}
var w, s_out: scaled;
s: integer;
begin
@@ -15877,13 +15879,14 @@
w := char_width(f)(char_info(f)(c));
if isscalable(f) then begin
if pdf_cur_Tm_a = 0 then begin
- call_func(divide_scaled(w, pdf_font_size[f], 4));
- pdf_delta_h := pdf_delta_h + scaled_out;
+ s := divide_scaled(w, pdf_font_size[f], dd);
+ s_out := scaled_out;
+ pdf_delta_h := pdf_delta_h + s_out;
end
else begin
s := divide_scaled(round_xn_over_d(w, 1000, 1000 + pdf_cur_Tm_a),
pdf_font_size[f],
- 4);
+ dd);
s_out := round_xn_over_d(round_xn_over_d(pdf_font_size[f], abs(s), 10000),
1000 + pdf_cur_Tm_a, 1000);
if s < 0 then
@@ -15890,6 +15893,8 @@
s_out := -s_out;
pdf_delta_h := pdf_delta_h + s_out;
end;
+ adv_char_width_s := s;
+ adv_char_width_s_out := s_out;
end else
pdf_delta_h := pdf_delta_h + get_pk_char_width(f, w);
end;
@@ -16192,6 +16197,7 @@
procedure pdf_begin_string(f: internal_font_number); {begin to draw a string}
var s_out, v, v_out: scaled;
+ save_pdf_delta_h: scaled;
s: integer;
must_end_string: boolean; {must we end the current string?}
must_insert_space: boolean; {must we insert an interword space?}
@@ -16233,32 +16239,31 @@
must_insert_space := false;
must_end_string := false;
-@{ print_nl("s_out = "); print_scaled(s_out); @}
-@{ print_nl("space(f) = "); print_scaled(space(f)); @}
-@{ print_nl("space_shrink(f) = "); print_scaled(space_shrink(f)); @}
-@{ print_nl("x_height(f) = "); print_scaled(x_height(f)); @}
-@{ print_nl("v = "); print_scaled(v); @}
-@{ print_nl("v_out = "); print_scaled(v_out); @}
+ if (f <> pdf_f) or (v <> 0) or (abs(s) >= @'100000) then begin
+ must_end_string := true;
+ end;
- if gen_faked_interword_space and
- pdf_doing_string and
- ((abs(v_out) > 2*x_height(f)) or
- (s_out > space(f) - space_shrink(f)) or
- ((f <> pdf_f) and (v = 0))) then
- begin
+ if gen_faked_interword_space
+ and pdf_doing_string
+ and (not must_end_string)
+ and (s_out > space(f) - space_shrink(f))
+ and (v = 0)
+ then begin
must_insert_space := true;
end;
- if (f <> pdf_f) or (v <> 0) or (abs(s) >= @'100000) or must_insert_space then begin
- must_end_string := true;
+ if (must_insert_space) 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|}
+ pdf_delta_h := save_pdf_delta_h;
+ s := s - adv_char_width_s;
+ s_out := s_out - adv_char_width_s_out;
+ cur_h := cur_h - char_width(f)(char_info(f)(32));
end;
if must_end_string then begin
pdf_end_string;
- if must_insert_space then begin
- pdf_insert_interword_space; {this will change |pdf_f|}
- pdf_set_font(f);
- end;
pdf_set_textmatrix(v, v_out, f);
pdf_f := f;
s := 0;
@@ -18373,7 +18378,7 @@
else begin
pdf_begin_string(f);
pdf_print_char(f, #);
- adv_char_width(f, #);
+ adv_char_width(f, #, 4);
end;
end
More information about the tex-live-commits
mailing list.