| 1 |
% $Id: enctex1.ch 57736 2021-02-13 23:02:37Z karl $ |
| 2 |
% enctex1.ch: implementation of enc\TeX, to be applied on top of tex.ch. |
| 3 |
% This is the first set of changes, used by all engines supporting encTeX |
| 4 |
% (i.e., everything but XeTeX and LuaTeX). |
| 5 |
|
| 6 |
@x [2.20] l.579 - encTeX: global declarations |
| 7 |
xprn: array [ASCII_code] of ASCII_code; |
| 8 |
{ non zero iff character is printable } |
| 9 |
@y |
| 10 |
xprn: array [ASCII_code] of ASCII_code; |
| 11 |
{ non zero iff character is printable } |
| 12 |
mubyte_read: array [ASCII_code] of pointer; |
| 13 |
{ non zero iff character begins the multi byte code } |
| 14 |
mubyte_write: array [ASCII_code] of str_number; |
| 15 |
{ non zero iff character expands to multi bytes in log and write files } |
| 16 |
mubyte_cswrite: array [0..127] of pointer; |
| 17 |
{ non null iff cs mod 128 expands to multi bytes in log and write files } |
| 18 |
mubyte_skip: integer; { the number of bytes to skip in |buffer| } |
| 19 |
mubyte_keep: integer; { the number of chars we need to keep unchanged } |
| 20 |
mubyte_skeep: integer; { saved |mubyte_keep| } |
| 21 |
mubyte_prefix: integer; { the type of mubyte prefix } |
| 22 |
mubyte_tablein: boolean; { the input side of table will be updated } |
| 23 |
mubyte_tableout: boolean; { the output side of table will be updated } |
| 24 |
mubyte_relax: boolean; { the relax prefix is used } |
| 25 |
mubyte_start: boolean; { we are making the token at the start of the line } |
| 26 |
mubyte_sstart: boolean; { saved |mubyte_start| } |
| 27 |
mubyte_token: pointer; { the token returned by |read_buffer| } |
| 28 |
mubyte_stoken: pointer; { saved first token in mubyte primitive } |
| 29 |
mubyte_sout: integer; { saved value of |mubyte_out| } |
| 30 |
mubyte_slog: integer; { saved value of |mubyte_log| } |
| 31 |
spec_sout: integer; { saved value of |spec_out| } |
| 32 |
no_convert: boolean; { conversion supressed by noconvert primitive } |
| 33 |
active_noconvert: boolean; { true if noconvert primitive is active } |
| 34 |
write_noexpanding: boolean; { true only if we need not write expansion } |
| 35 |
cs_converting: boolean; { true only if we need csname converting } |
| 36 |
special_printing: boolean; { true only if we need converting in special } |
| 37 |
message_printing: boolean; { true if message or errmessage prints to string } |
| 38 |
@z |
| 39 |
|
| 40 |
@x [2.23] l.723 - encTeX |
| 41 |
for i:=@'177 to @'377 do xchr[i]:=i; |
| 42 |
@y |
| 43 |
for i:=@'177 to @'377 do xchr[i]:=i; |
| 44 |
{Initialize enc\TeX\ data.} |
| 45 |
for i:=0 to 255 do mubyte_read[i]:=null; |
| 46 |
for i:=0 to 255 do mubyte_write[i]:=0; |
| 47 |
for i:=0 to 127 do mubyte_cswrite[i]:=null; |
| 48 |
mubyte_keep := 0; mubyte_start := false; |
| 49 |
write_noexpanding := false; cs_converting := false; |
| 50 |
special_printing := false; message_printing := false; |
| 51 |
no_convert := false; active_noconvert := false; |
| 52 |
@z |
| 53 |
|
| 54 |
@x [5.59] l.1508 FIXME -- enc\TeX\ modifications of |print|. |
| 55 |
else begin if selector>pseudo then |
| 56 |
begin print_char(s); return; {internal strings are not expanded} |
| 57 |
end; |
| 58 |
if (@<Character |s| is the current new-line character@>) then |
| 59 |
if selector<pseudo then |
| 60 |
begin print_ln; return; |
| 61 |
end; |
| 62 |
@y |
| 63 |
else begin if (selector>pseudo) and (not special_printing) |
| 64 |
and (not message_printing) then |
| 65 |
begin print_char(s); return; {internal strings are not expanded} |
| 66 |
end; |
| 67 |
if (@<Character |s| is the current new-line character@>) then |
| 68 |
if selector<pseudo then |
| 69 |
begin print_ln; no_convert := false; return; |
| 70 |
end |
| 71 |
else if message_printing then |
| 72 |
begin print_char(s); no_convert := false; return; |
| 73 |
end; |
| 74 |
if (mubyte_log>0) and (not no_convert) and (mubyte_write[s]>0) then |
| 75 |
s := mubyte_write[s] |
| 76 |
else if xprn[s] or special_printing then |
| 77 |
begin print_char(s); no_convert := false; return; end; |
| 78 |
no_convert := false; |
| 79 |
@z |
| 80 |
|
| 81 |
@x [5.71] encTeX - native buffer printing |
| 82 |
if last<>first then for k:=first to last-1 do print(buffer[k]); |
| 83 |
@y |
| 84 |
k:=first; while k < last do begin print_buffer(k) end; |
| 85 |
@z |
| 86 |
|
| 87 |
@x [17.230] l.4725 - encTeX: xord_code_base, xchr_code_base, prn_code_base, |
| 88 |
@d math_font_base=cur_font_loc+1 {table of 48 math font numbers} |
| 89 |
@y |
| 90 |
@d xord_code_base=cur_font_loc+1 |
| 91 |
@d xchr_code_base=xord_code_base+1 |
| 92 |
@d xprn_code_base=xchr_code_base+1 |
| 93 |
@d math_font_base=xprn_code_base+1 |
| 94 |
@z |