summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/alephdir/eochar.ch
blob: 8c6fba10adaaef7aa627e698d794eb82a81dc8bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
% Fix the Omega \char<..> primitives
%---------------------------------------
@x
@d assign_font_dimen=assign_mu_glue+1
   {user-defined font dimension ( \.{\\fontdimen} )}
@y
@d assign_font_dimen=assign_mu_glue+1
   {font dimension ( \.{\\fontdimen} ), \.{\\charwd}, \.{\\charht}, etc}
@d font_dimen_code=0
@d char_width_code=font_dimen_code+1
@d char_height_code=char_width_code+1
@d char_depth_code=char_height_code+1
@d char_italic_code=char_depth_code+1
@z
%---------------------------------------
@x [26] m.416 l.8407 - Omega char dimensions
primitive("fontdimen",assign_font_dimen,0);@/
@!@:font_dimen_}{\.{\\fontdimen} primitive@>
@y
primitive("fontdimen",assign_font_dimen,font_dimen_code);@/
@!@:font_dimen_}{\.{\\fontdimen} primitive@>
primitive("charwd",assign_font_dimen,char_width_code);@/
@!@:char_width_}{\.{\\charwd} primitive@>
primitive("charht",assign_font_dimen,char_height_code);@/
@!@:char_height_}{\.{\\charht} primitive@>
primitive("chardp",assign_font_dimen,char_depth_code);@/
@!@:char_depth_}{\.{\\chardp} primitive@>
primitive("charit",assign_font_dimen,char_italic_code);@/
@!@:char_italic_}{\.{\\charit} primitive@>
@z
%---------------------------------------
@x [26] m.416 l.8425 - Omega char dimensions
assign_font_dimen: print_esc("fontdimen");
@y
assign_font_dimen: if chr_code=font_dimen_code then print_esc("fontdimen")
else if chr_code=char_width_code then print_esc("charwd")
else if chr_code=char_height_code then print_esc("charht")
else if chr_code=char_depth_code then print_esc("chardp")
else if chr_code=char_italic_code then print_esc("charit")
else print("[unknown fontdimen code!]");
@z
%---------------------------------------
@x CLEAN UP FROM OMEGA
primitive("charwd",set_box_dimen,(width_offset+3));
@!@:charwd_}{\.{\\charwd} primitive@>
primitive("charht",set_box_dimen,(height_offset+3));
@!@:charht_}{\.{\\charht} primitive@>
primitive("chardp",set_box_dimen,(depth_offset+3));
@!@:chardp_}{\.{\\chardp} primitive@>
primitive("charit",set_box_dimen,(depth_offset+4));
@!@:charit_}{\.{\\charit} primitive@>
@y
@z
%---------------------------------------
@x
else if chr_code=(width_offset+3) then print_esc("charwd")
else if chr_code=(height_offset+3) then print_esc("charht")
else if chr_code=(depth_offset+3) then print_esc("chardp")
else print_esc("charit");
@y
else print("[unknown box dimen!]");
@z
%---------------------------------------
@x
@ @<Fetch a box dimension@>=
if m<=3 then
begin
   scan_register_num;
   fetch_box(q);
   if q=null then cur_val:=0 @+else
   cur_val:=mem[q+m].sc;
   cur_val_level:=dimen_val;
end
else
begin
   scan_char_num;
   if m=(width_offset+3) then begin
      cur_val:= char_width(main_f)(char_info(main_f)(cur_val))
      end
   else if m=(height_offset+3) then begin
      cur_val:= char_height(main_f)(height_depth(char_info(main_f)(cur_val)))
      end
   else if m=(depth_offset+3) then begin
      cur_val:= char_depth(main_f)(height_depth(char_info(main_f)(cur_val)))
      end
   else begin
      cur_val:= char_italic(main_f)(char_info(main_f)(cur_val));
      end;
   cur_val_level:=dimen_val;
end
@y
@ @<Fetch a box dimension@>=
if m<=height_offset then begin
   scan_register_num;
   fetch_box(q);
   if q=null then cur_val:=0 @+else
   cur_val:=mem[q+m].sc;
   cur_val_level:=dimen_val;
end
else begin
   confusion("boxdimen");
   { something wrong with the code ...}
end
@z
%---------------------------------------
@x [26] m.419 l.8461 - Omega char dimensions
@ @<Fetch a font dimension@>=
begin find_font_dimen(false);
font_info(dimen_font)(font_file_size(dimen_font)).sc:=0;
scanned_result(font_info(dimen_font)(cur_val).sc)(dimen_val);
end
@y
@ @<Fetch a font dimension@>=
if m=font_dimen_code then begin find_font_dimen(false);
  font_info(dimen_font)(font_file_size(dimen_font)).sc:=0;
  scanned_result(font_info(dimen_font)(cur_val).sc)(dimen_val);
  end
else
  begin scan_char_num;
     if m=char_width_code then begin
        cur_val:= char_width(main_f)(char_info(main_f)(cur_val))
        end
     else if m=char_height_code then begin
        cur_val:= char_height(main_f)(height_depth(char_info(main_f)(cur_val)))
        end
     else if m=char_depth_code then begin
        cur_val:= char_depth(main_f)(height_depth(char_info(main_f)(cur_val)))
        end
     else if m=char_italic_code then begin
        cur_val:= char_italic(main_f)(char_info(main_f)(cur_val));
        end
     else confusion("fontdimen");
     cur_val_level:=dimen_val;
  end
@z
%---------------------------------------
@x
assign_font_dimen: begin find_font_dimen(true); k:=cur_val;
  scan_optional_equals; scan_normal_dimen;
  font_info(dimen_font)(k).sc:=cur_val;
  end;
@y
assign_font_dimen: begin
  n:=cur_chr;
  if n=font_dimen_code then begin
    find_font_dimen(true); k:=cur_val;
    scan_optional_equals; scan_normal_dimen;
    font_info(dimen_font)(k).sc:=cur_val;
    end
  else begin
    print_err("Invalid dimension assignment");
    help2("You tried to assign a character dimension.")@/
    ("This is not allowed. Proceed; I'll ignore the assignment.");
    error;
    scan_char_num; scan_optional_equals; scan_normal_dimen;
  end
end;
@z