| 1 |
% $Id: char-warning-pdftex.ch 57769 2021-02-17 03:03:54Z karl $ |
| 2 |
% Public domain (from David Jones, tex-implementors 30jun2020). |
| 3 |
% Unfortunately this cannot be in pdftex.ch since the ordering |
| 4 |
% of changes gets messed up. |
| 5 |
% |
| 6 |
% If \tracinglostchars >= 3, then making missing characters from a font |
| 7 |
% be an error, not just a log message, and always report the character |
| 8 |
% code in hex as well as a character. |
| 9 |
% |
| 10 |
% Simple example test: |
| 11 |
% pdftex -ini |
| 12 |
% \font\x=/usr/local/texlive/2020/texmf-dist/fonts/tfm/public/knuth-lib/logo10.tfm |
| 13 |
% \tracinglostchars=3 \x \char99\end |
| 14 |
% should get: |
| 15 |
% ! Missing character: There is no c ("63) in font logo10. |
| 16 |
|
| 17 |
@x [30] If \tracinglostchars > 2, then promote to full error. |
| 18 |
@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); |
| 19 |
var old_setting: integer; {saved value of |tracing_online|} |
| 20 |
begin if tracing_lost_chars>0 then |
| 21 |
begin old_setting:=tracing_online; |
| 22 |
if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; |
| 23 |
begin begin_diagnostic; |
| 24 |
print_nl("Missing character: There is no "); |
| 25 |
@.Missing character@> |
| 26 |
print_ASCII(c); print(" in font "); |
| 27 |
slow_print(font_name[f]); print_char("!"); end_diagnostic(false); |
| 28 |
end; |
| 29 |
tracing_online:=old_setting; |
| 30 |
end; |
| 31 |
end; |
| 32 |
@y |
| 33 |
@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); |
| 34 |
var old_setting: integer; {saved value of |tracing_online|} |
| 35 |
begin if tracing_lost_chars>0 then |
| 36 |
begin old_setting:=tracing_online; |
| 37 |
if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1; |
| 38 |
if tracing_lost_chars > 2 then |
| 39 |
print_err("Missing character: There is no ") |
| 40 |
else begin |
| 41 |
begin_diagnostic; |
| 42 |
print_nl("Missing character: There is no ") |
| 43 |
end; |
| 44 |
@.Missing character@> |
| 45 |
print_ASCII(c); |
| 46 |
if tracing_lost_chars > 2 then begin |
| 47 |
print(" ("); |
| 48 |
print_hex(c); |
| 49 |
print(")"); |
| 50 |
end; |
| 51 |
print(" in font "); |
| 52 |
slow_print(font_name[f]); |
| 53 |
if tracing_lost_chars < 3 then print_char("!"); |
| 54 |
tracing_online:=old_setting; |
| 55 |
if tracing_lost_chars > 2 then begin |
| 56 |
help0; |
| 57 |
error; |
| 58 |
end else end_diagnostic(false); |
| 59 |
end; {of |tracing_lost_chars>0|} |
| 60 |
end; {of procedure} |
| 61 |
@z |
| 62 |
|