From dfb7b40cf174e14a589256065d837f651c4d2fd3 Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Sun, 4 Feb 2024 09:26:11 +0000 Subject: Character index within the limits in defining a Type 3 font (H.Hagen). Thanks M. Chernoff. git-svn-id: svn://tug.org/texlive/trunk@69697 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/ChangeLog | 6 +++++- Build/source/texk/web2c/luatexdir/font/writet3.c | 24 +++++++++++++++++++--- .../texk/web2c/luatexdir/luatex_svnversion.h | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index cbf824eb1a2..91cea6c8db6 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,5 +1,9 @@ +2024-04-24 Luigi Scarso + * Character index within the limits in defining a Type 3 font (H.Hagen). Thanks M. Chernoff. + + 2024-03-24 Luigi Scarso - * Ensures that setgentounicode has a glyph_unicode_tree not NULL + * Ensures that setgentounicode has a glyph_unicode_tree not NULL (thanks M. Chernoff) 2024-01-24 Luigi Scarso * New kpse.in_name_ok_silent_extended and kpse.in_name_ok_silent_extended diff --git a/Build/source/texk/web2c/luatexdir/font/writet3.c b/Build/source/texk/web2c/luatexdir/font/writet3.c index 693bb0c6ef9..5044f02c549 100644 --- a/Build/source/texk/web2c/luatexdir/font/writet3.c +++ b/Build/source/texk/web2c/luatexdir/font/writet3.c @@ -227,6 +227,15 @@ static void writet3(PDF pdf, internal_font_number f, int callback_id) int first_char, last_char; int pk_font_scale; int tounicode_objnum = 0; + int bc = font_bc(f); + int ec = font_ec(f); + if (bc > 255) { + bc = 255; + } + if (ec > 255) { + formatted_warning("font", "discarding characters above 255 in type 3 font '%s' in write", font_name(f)); + ec = 255; + } pdffloat pf; boolean is_notdef; t3_glyph_num = 0; @@ -237,13 +246,13 @@ static void writet3(PDF pdf, internal_font_number f, int callback_id) xfree(t3_buffer); t3_curbyte = 0; t3_size = 0; - for (i = font_bc(f); i <= font_ec(f); i++) { + for (i = bc; i <= ec; i++) { if (pdf_char_marked(f, i)) { break; } } first_char = i; - for (i = font_ec(f); i > first_char; i--) { + for (i = ec; i > first_char; i--) { if (pdf_char_marked(f, i)) { break; } @@ -439,8 +448,17 @@ void prerollt3user(PDF pdf, internal_font_number f) { int callback_id = callback_defined(provide_charproc_data_callback); if (callback_id > 0) { + int bc = font_bc(f); + int ec = font_ec(f); + if (bc > 255) { + bc = 255; + } + if (ec > 255) { + formatted_warning("font", "discarding characters above 255 in type 3 font '%s' in preroll", font_name(f)); + ec = 255; + } int i; - for (i = font_bc(f); i <= font_ec(f); i++) { + for (i = bc; i <= ec; i++) { if (pdf_char_marked(f, i)) { /*tex We pass |true|, the font id and the character index. */ run_callback(callback_id, "ddd->", 1, f, i); diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h index bbdd30a131c..9708d4d31de 100644 --- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1,4 +1,4 @@ #ifndef luatex_svn_revision_h #define luatex_svn_revision_h -#define luatex_svn_revision 7602 +#define luatex_svn_revision 7603 #endif -- cgit v1.2.3