diff --git a/manual/luatex-callbacks.tex b/manual/luatex-callbacks.tex index 34a8010eb0389df07cf78e304f9c67a2994dee80..cad7ad7c6f8dd7be4ff094fc3c8c68a4886c0894 100644 --- a/manual/luatex-callbacks.tex +++ b/manual/luatex-callbacks.tex @@ -942,6 +942,17 @@ definition can be reused instead of creating a whole new font structure. Setting this callback to \type {false} is pointless as it will prevent font loading completely but will nevertheless generate errors. +\subsection{\type {glyph_not_found}} + +This callback kicks in when the backend cannot insert a glyph. When no callback +is defined a message is written to the log. + +\startfunctioncall +function(<number> id, <number> char) + -- do something with font id and char code +end +\stopfunctioncall + \stopchapter \stopcomponent diff --git a/manual/luatex.pdf b/manual/luatex.pdf index 5c767470866abd94855058dd432ddceed4f03e8f..badf0442fb95af4872e5b23d36dd62f8533af3c7 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/font/texfont.h b/source/texk/web2c/luatexdir/font/texfont.h index e0cb467380301d52e9db879dca763d17f9fc08e6..d415460b1e12adb75d222cc937b49ea711e3df29 100644 --- a/source/texk/web2c/luatexdir/font/texfont.h +++ b/source/texk/web2c/luatexdir/font/texfont.h @@ -435,6 +435,7 @@ typedef enum { extern charinfo *get_charinfo(internal_font_number f, int c); extern int char_exists(internal_font_number f, int c); +extern int lua_glyph_not_found_callback(internal_font_number f, int c); extern charinfo *char_info(internal_font_number f, int c); /* diff --git a/source/texk/web2c/luatexdir/font/texfont.w b/source/texk/web2c/luatexdir/font/texfont.w index 7bb3b7c3d73e007073ee1dc422f6809887ab0d73..ce463326a867beb55d6c18fc6c2ed548f01eafe7 100644 --- a/source/texk/web2c/luatexdir/font/texfont.w +++ b/source/texk/web2c/luatexdir/font/texfont.w @@ -348,12 +348,11 @@ int char_exists(internal_font_number f, int c) } @ @c -#if 0 -static int lua_char_exists_callback(internal_font_number f, int c) +int lua_glyph_not_found_callback(internal_font_number f, int c) { int callback_id; int ret = 0; - callback_id = callback_defined(char_exists_callback); + callback_id = callback_defined(glyph_not_found_callback); if (callback_id != 0) { if (!get_callback(Luas, callback_id)) { lua_pop(Luas, 2); @@ -368,10 +367,11 @@ static int lua_char_exists_callback(internal_font_number f, int c) } else { ret = lua_toboolean(Luas, -1); } + } else { + char_warning(f,c); } return ret; } -#endif @ @c extinfo *new_variant(int glyph, int startconnect, int endconnect, diff --git a/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/source/texk/web2c/luatexdir/lua/lcallbacklib.c index 46cdbaacbcc6e0c3b0c2f440c2cd956314a33a64..adb1ffd52e25649e5344a0e05fa2353a31c96039 100644 --- a/source/texk/web2c/luatexdir/lua/lcallbacklib.c +++ b/source/texk/web2c/luatexdir/lua/lcallbacklib.c @@ -54,7 +54,7 @@ static const char *const callbacknames[] = { "pre_output_filter", "buildpage_filter", "hpack_filter", "vpack_filter", - "char_exists", + "glyph_not_found", "hyphenate", "ligaturing", "kerning", diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index 381b8bba28c60096e68c346c3051d50e515c882a..78f4bbc6722eee44a77aee52182a496de2565691 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 6396 +#define luatex_svn_revision 6399 diff --git a/source/texk/web2c/luatexdir/luatexcallbackids.h b/source/texk/web2c/luatexdir/luatexcallbackids.h index ac784359ba59c696e567b211b453fea39ddcc98e..32df36a4a1af28f45b7b715a73c0f1fd76ec822c 100644 --- a/source/texk/web2c/luatexdir/luatexcallbackids.h +++ b/source/texk/web2c/luatexdir/luatexcallbackids.h @@ -47,7 +47,7 @@ typedef enum { pre_output_filter_callback, buildpage_filter_callback, hpack_filter_callback, vpack_filter_callback, - char_exists_callback, + glyph_not_found_callback, hyphenate_callback, ligaturing_callback, kerning_callback, diff --git a/source/texk/web2c/luatexdir/pdf/pdffont.w b/source/texk/web2c/luatexdir/pdf/pdffont.w index b3f1605154ca95e9cdcd8c9f2155f2f53fa5ccb1..278efa9d6faaa41dddeb63b96deb7535499d8f9c 100644 --- a/source/texk/web2c/luatexdir/pdf/pdffont.w +++ b/source/texk/web2c/luatexdir/pdf/pdffont.w @@ -41,7 +41,8 @@ scaled_whd output_one_char(PDF pdf, halfword p) int ex_glyph = ex_glyph(p)/1000; scaled_whd ci = get_charinfo_whd(f, c); /* the real width, height and depth of the character */ if (!(char_exists(f,c))) { - char_warning(f,c); + lua_glyph_not_found_callback(f,c); + /* char_warning(f,c); */ return ci; } ci.wd = ext_xn_over_d(ci.wd, 1000000 + ex_glyph(p), 1000000); diff --git a/source/texk/web2c/luatexdir/pdf/pdfglyph.w b/source/texk/web2c/luatexdir/pdf/pdfglyph.w index 06755a54bdfada5192535ced67c72c8ceedd3fad..0703beed22cafceec168b2f172b83d4a89ed72ac 100644 --- a/source/texk/web2c/luatexdir/pdf/pdfglyph.w +++ b/source/texk/web2c/luatexdir/pdf/pdfglyph.w @@ -197,8 +197,11 @@ void pdf_place_glyph(PDF pdf, internal_font_number f, int c, int ex) boolean move; pdfstructure *p = pdf->pstruct; scaledpos pos = pdf->posstruct->pos; - if (!char_exists(f, c)) - return; + /* already done: + if (!char_exists(f, c)) { + return; + } + */ if (font_writingmode(f) == vertical_writingmode) { if (p->wmode != WMODE_V) { p->wmode = WMODE_V;