diff options
Diffstat (limited to 'Build/source/texk/web2c/xetexdir')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/am/xetex.am | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/char-warning-xetex.ch | 84 |
3 files changed, 94 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index 81b02b0fcfc..279ddbbbffe 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,10 @@ +2020-07-19 Karl Berry <karl@freefriends.org> + + * char-warning-xetex.ch: new file; see ../pdftexdir/ChangeLog. + Also define new procedure print_ucs_code to print U+nnnn + for system fonts. + * am/xetex.am: add it. + 2020-07-17 Andreas Scherer <https://ascherer.github.io> * am/xetex.am: Avoid changefile ambiguity. diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am index ddba5f9f10b..1d3cb7062eb 100644 --- a/Build/source/texk/web2c/xetexdir/am/xetex.am +++ b/Build/source/texk/web2c/xetexdir/am/xetex.am @@ -116,13 +116,14 @@ xetex_ch_srcs = \ $(xetex_ch_synctex) \ xetexdir/xetex.ch \ $(xetex_post_ch_synctex) \ + xetexdir/char-warning-xetex.ch \ tex-binpool.ch ## EXTRA_DIST += $(xetex_web_srcs) $(xetex_ch_srcs) xetexdir/xetex.defines -DISTCLEANFILES += $(nodist_xetex_SOURCES) xetex.web xetex-final.ch xetex-web2c \ - xetex.p xetex.pool xetex-tangle +DISTCLEANFILES += $(nodist_xetex_SOURCES) xetex.web xetex-final.ch \ + xetex-web2c xetex.p xetex.pool xetex-tangle ## libxetex diff --git a/Build/source/texk/web2c/xetexdir/char-warning-xetex.ch b/Build/source/texk/web2c/xetexdir/char-warning-xetex.ch new file mode 100644 index 00000000000..246c0489ce5 --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/char-warning-xetex.ch @@ -0,0 +1,84 @@ +% $Id$ +% Public domain. See ../pdftexdir/char-warning-pdftex.ch for basic info. +% In addition to the basic change, we also define a new procedure +% print_ucs_code to print in the format U+.... for system fonts. +% +% To test: +% xetex -ini +% \font\x=/usr/local/texlive/2020/texmf-dist/fonts/tfm/public/knuth-lib/logo10.tfm +% \tracinglostchars=3 \x \char99\end +% should get: +% ! Missing character: There is no c ("63) in font logo10. +% And: +% \font\y="Nimbus Mono" \tracinglostchars=3 \y \char43981\end +% should get: +% ! Missing character: There is no ꯍ (U+ABCD) in font Nimbus Mono Regular!. +% Assuming that font is findable as a system font, e.g., shown by +% fc-list :scalable=true family + +@x [30] If \tracinglostchars > 2, then promote full errors. +procedure char_warning(@!f:internal_font_number;@!c:integer); +var old_setting: integer; {saved value of |tracing_online|} +begin if tracing_lost_chars>0 then + begin old_setting:=tracing_online; + if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; + begin begin_diagnostic; + print_nl("Missing character: There is no "); +@.Missing character@> + if c < @"10000 then print_ASCII(c) + else print_char(c); {non-Plane 0 Unicodes can't be sent through |print_ASCII|} + print(" in font "); + slow_print(font_name[f]); print_char("!"); end_diagnostic(false); + end; + tracing_online:=old_setting; + end; +end; +@y +procedure print_ucs_code(@!n: UnicodeScalar); { cf. print_hex } + var k: 0..22; {index to current digit; we assume that $0\L n<16^{22}$} + begin + k := 0; + print("U+"); { prefix with U+ instead of " } + repeat + dig[k] := n mod 16; + n := n div 16; + incr(k); + until n = 0; + { pad to at least 4 hex digits } + while k < 4 do + begin + dig[k] := 0; + incr(k); + end; + print_the_digs(k); +end; + +procedure char_warning(@!f:internal_font_number;@!c:integer); +var old_setting: integer; {saved value of |tracing_online|} +begin if tracing_lost_chars>0 then + begin old_setting:=tracing_online; + if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; + if tracing_lost_chars > 2 then + print_err("Missing character: There is no ") + else begin + begin_diagnostic; + print_nl("Missing character: There is no ") + end; +@.Missing character@> + if c < @"10000 then print_ASCII(c) + else print_char(c); {non-Plane 0 Unicodes can't be sent through |print_ASCII|} + print(" ("); + if is_native_font(f) then print_ucs_code(c) + else print_hex(c); + print(")"); + print(" in font "); + slow_print(font_name[f]); + if tracing_lost_chars < 3 then print_char("!"); + tracing_online:=old_setting; + if tracing_lost_chars > 2 then begin + help0; + error; + end else end_diagnostic(false); + end; {of |tracing_lost_chars>0|} +end; {of procedure} +@z |