1 /* Copyright 2014 Clerk Ma
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 void char_warning_(internal_font_number f, eight_bits c)
25 if (tracing_lost_chars > 0)
27 if (show_missing == 0)
30 if (show_missing) /* add ! before 94/June/10 */
33 prints("Missing character: there is no ");
36 print_nl("Missing character: there is no ");
40 if (show_numeric) /* bkph 93/Dec/21 */
47 print_char('0' + c / 100);
48 c = c - (c / 100) * 100;
49 print_char('0' + c / 10);
53 c = c - (c / 100) * 100;
55 print_char('0' + c / 10);
57 print_char('0' + c % 10);
62 slow_print(font_name[f]);
68 show_context(); /* not if its the nullfont */
71 if (show_missing == 0)
72 end_diagnostic(false);
74 missing_characters++; /* bkph 93/Dec/16 */
78 halfword new_character_(internal_font_number f, eight_bits c)
84 if (char_exists(char_info(f, c)))
101 sprintf(log_line, "dvi_swap() %lld", dvi_gone);
102 show_line(log_line, 0);
105 if (dvi_limit == dvi_buf_size)
107 write_dvi(0, half_buf - 1);
108 dvi_limit = half_buf;
109 dvi_offset = dvi_offset + dvi_buf_size;
114 write_dvi(half_buf, dvi_buf_size - 1);
115 dvi_limit = dvi_buf_size;
118 dvi_gone = dvi_gone + half_buf;
121 void dvi_four_(integer x)
124 dvi_out(x / 0100000000);
127 x = x + 010000000000;
128 x = x + 010000000000;
129 dvi_out((x / 0100000000) + 128);
133 dvi_out(x / 0200000);
139 void dvi_pop_(integer l)
141 if ((l == dvi_offset + dvi_ptr) && (dvi_ptr > 0))
147 void dvi_font_def_(internal_font_number f)
160 dvi_out(((f - 1) >> 8));
161 dvi_out(((f - 1) & 255));
168 dvi_out(font_check[f].b0);
169 dvi_out(font_check[f].b1);
170 dvi_out(font_check[f].b2);
171 dvi_out(font_check[f].b3);
172 dvi_four(font_size[f]);
173 dvi_four(font_dsize[f]);
174 dvi_out(length(font_area[f]));
175 dvi_out(length(font_name[f]));
177 for (k = str_start[font_area[f]]; k <= str_start[font_area[f] + 1] - 1; k++)
178 dvi_out(str_pool[k]);
180 for (k = str_start[font_name[f]]; k <= str_start[font_name[f] + 1] - 1; k++)
181 dvi_out(str_pool[k]);
184 void zmovement(scaled w, eight_bits o)
190 q = get_node(movement_node_size);
192 location(q) = dvi_offset + dvi_ptr;
211 switch(mstate + info(p))
213 case none_seen + yz_OK:
214 case none_seen + y_OK:
217 if (location(p) < dvi_gone)
221 k = location(p) - dvi_offset;
224 k = k + dvi_buf_size;
226 dvi_buf[k] = dvi_buf[k] + y1 - down1;
232 case none_seen + z_OK:
235 if (location(p) < dvi_gone)
239 k = location(p) - dvi_offset;
242 k = k + dvi_buf_size;
244 dvi_buf[k] = dvi_buf[k] + z1 - down1;
250 case none_seen + y_here:
251 case none_seen + z_here:
252 case y_seen + z_here:
253 case z_seen + y_here:
261 switch (mstate + info(p))
263 case none_seen + y_here:
267 case none_seen + z_here:
271 case y_seen + z_here:
272 case z_seen + y_here:
286 if (abs(w) >= 8388608L) /* 2^23 */
293 if (abs(w) >= 32768L)
298 w = w + 16777216L; /* 2^24 */
299 //dvi_out(w / 65536L);
301 /* w = w % 65536L; */
333 if (info(q) == y_here)
335 dvi_out(o + y0 - down1);
358 dvi_out(o + z0 - down1);
381 void prune_movements_(integer l)
385 while (down_ptr != 0)
387 if (location(down_ptr) < l)
392 free_node(p, movement_node_size);
396 while (right_ptr != 0)
398 if (location(right_ptr) < l)
403 free_node(p, movement_node_size);
407 void special_out_(pointer p)
414 old_setting = selector;
415 selector = new_string;
417 #ifdef ALLOCATESTRING
418 if (pool_ptr + 32000 > current_pool_size)
419 str_pool = realloc_str_pool (increment_pool_size);
421 show_token_list(link(write_tokens(p)), 0, 10000000L);
423 show_token_list(link(write_tokens(p)), 0, pool_size - pool_ptr);
426 selector = old_setting;
429 if (cur_length < 256)
437 dvi_four(cur_length);
440 for (k = str_start[str_ptr]; k <= pool_ptr - 1; k++)
441 dvi_out(str_pool[k]);
443 pool_ptr = str_start[str_ptr];
446 void write_out_(pointer p)
449 /* integer oldmode; */
450 int oldmode; /* 1995/Jan/7 */
451 /* small_number j; */
452 int j; /* 1995/Jan/7 */
456 info(q) = right_brace_token + '}';
459 info(r) = end_write_token;
461 begin_token_list(write_tokens(p), write_text);
463 info(q) = left_brace_token + '{';
468 q = scan_toks(false, true);
471 if (cur_tok != end_write_token)
473 print_err("Unbalanced write command");
474 help2("On this page there's a \\write with fewer real {'s than }'s.",
475 "I can't handle that very well; good luck.");
482 while (!(cur_tok == end_write_token));
487 old_setting = selector;
494 if ((j == 17) && (selector == term_and_log))
503 selector = old_setting;
506 void out_what_(pointer p)
508 /* small_number j; */
509 int j; /* 1995/Jan/7 */
520 if (subtype(p) == write_node)
527 a_close(write_file[j]);
529 if (subtype(p) == close_node)
530 write_open[j]= false;
533 cur_name = open_name(p);
534 cur_area = open_area(p);
535 cur_ext = open_ext(p);
537 if (cur_ext == 335) /* "" */
538 cur_ext = 785; /* => ".tex" */
540 pack_file_name(cur_name, cur_area, cur_ext);
542 while (!a_open_out(write_file[j]))
543 prompt_file_name("output file name", ".tex");
545 write_open[j] = true;
568 void hlist_out (void)
572 scaled save_h, save_v;
574 /* glue_ord g_order; */
583 boolean outer_doing_leaders;
592 g_order = glue_order(this_box);
593 g_sign = glue_sign(this_box);
594 p = list_ptr(this_box);
600 if (cur_s > max_push)
603 save_loc = dvi_offset + dvi_ptr;
627 if (f <= 64 + font_base)
628 dvi_out(f - font_base - 1 + fnt_num_0);
630 /* if we allow greater than 256 fonts */
648 dvi_out(((f - 1) >> 8)); /* top byte */
649 dvi_out(((f - 1) & 255)); /* bottom byte */
660 cur_h = cur_h + char_width(f, char_info(f, c));
663 while (!(!is_char_node(p)));
673 if (list_ptr(p) == 0)
674 cur_h = cur_h + width(p);
679 cur_v = base_line + shift_amount(p);
683 if (type(p) == vlist_node)
690 cur_h = edge + width(p);
711 rule_wd = width(g) - cur_g;
713 if (g_sign != normal)
715 if (g_sign == stretching)
717 if (stretch_order(g) == g_order)
719 cur_glue = cur_glue + stretch(g);
720 vet_glue(glue_set(this_box) * cur_glue);
721 cur_g = round(glue_temp);
724 else if (shrink_order(g) == g_order)
726 cur_glue = cur_glue - shrink(g);
727 vet_glue(glue_set(this_box) * cur_glue);
728 cur_g = round(glue_temp);
732 rule_wd = rule_wd + cur_g;
734 if (subtype(p) >= a_leaders)
736 leader_box = leader_ptr(p);
738 if (type(leader_box) == rule_node)
740 rule_ht = height(leader_box);
741 rule_dp = depth(leader_box);
745 leader_wd = width(leader_box);
747 if ((leader_wd > 0) && (rule_wd > 0))
749 rule_wd = rule_wd + 10;
750 edge = cur_h + rule_wd;
753 if (subtype(p) == a_leaders)
756 cur_h = left_edge + leader_wd * ((cur_h - left_edge) / leader_wd);
759 cur_h = cur_h + leader_wd;
763 lq = rule_wd / leader_wd;
764 lr = rule_wd % leader_wd;
766 if (subtype(p) == c_leaders)
767 cur_h = cur_h + (lr / 2);
770 lx =(2 * lr + lq + 1) / (2 * lq + 2);
771 cur_h = cur_h + ((lr - (lq - 1)* lx) / 2);
775 while (cur_h + leader_wd <= edge)
777 cur_v = base_line + shift_amount(leader_box);
782 temp_ptr = leader_box;
783 outer_doing_leaders = doing_leaders;
784 doing_leaders = true;
786 if (type(leader_box) == vlist_node)
791 doing_leaders = outer_doing_leaders;
795 cur_h = save_h + leader_wd + lx;
809 cur_h = cur_h + width(p);
814 mem[lig_trick] = mem[lig_char(p)];
815 link(lig_trick) = link(p);
828 if (is_running(rule_ht))
829 rule_ht = height(this_box);
831 if (is_running(rule_dp))
832 rule_dp = depth(this_box);
834 rule_ht = rule_ht + rule_dp;
836 if ((rule_ht > 0) && (rule_wd > 0))
839 cur_v = base_line + rule_dp;
845 dvi_h = dvi_h + rule_wd;
849 cur_h = cur_h + rule_wd;
855 prune_movements(save_loc);
863 void vlist_out (void)
867 scaled save_h, save_v;
869 /* glue_ord g_order; */
870 int g_order; /* 95/Jan/7 */
872 int g_sign; /* 95/Jan/7 */
878 boolean outer_doing_leaders;
887 g_order = glue_order(this_box);
888 g_sign = glue_sign(this_box);
889 p = list_ptr(this_box);
895 if (cur_s > max_push)
898 save_loc = dvi_offset + dvi_ptr;
900 cur_v = cur_v - height(this_box);
907 confusion("vlistout");
916 if (list_ptr(p) == 0)
917 cur_v = cur_v + height(p) + depth(p);
920 cur_v = cur_v + height(p);
924 cur_h = left_edge + shift_amount(p);
927 if (type(p) == vlist_node)
934 cur_v = save_v + depth(p);
955 rule_ht = width(g) - cur_g;
957 if (g_sign != normal)
959 if (g_sign == stretching)
961 if (stretch_order(g) == g_order)
963 cur_glue = cur_glue + stretch(g);
964 vet_glue(glue_set(this_box) * cur_glue);
965 cur_g = round(glue_temp);
968 else if (shrink_order(g) == g_order) /* BUG FIX !!! */
970 cur_glue = cur_glue - shrink(g);
971 vet_glue(glue_set(this_box) * cur_glue);
972 cur_g = round(glue_temp);
976 rule_ht = rule_ht + cur_g;
978 if (subtype(p) >= a_leaders)
980 leader_box = leader_ptr(p);
982 if (type(leader_box) == rule_node)
984 rule_wd = width(leader_box);
989 leader_ht = height(leader_box) + depth(leader_box);
991 if ((leader_ht > 0) && (rule_ht > 0))
993 rule_ht = rule_ht + 10;
994 edge = cur_v + rule_ht;
997 if (subtype(p) == a_leaders)
1000 cur_v = top_edge + leader_ht * ((cur_v - top_edge) / leader_ht);
1003 cur_v = cur_v + leader_ht;
1007 lq = rule_ht / leader_ht;
1008 lr = rule_ht % leader_ht;
1010 if (subtype(p) == c_leaders)
1011 cur_v = cur_v + (lr / 2);
1014 lx = (2 * lr + lq + 1) / (2 * lq + 2);
1015 cur_v = cur_v + ((lr - (lq - 1) * lx) / 2);
1019 while (cur_v + leader_ht <= edge)
1021 cur_h = left_edge + shift_amount(leader_box);
1024 cur_v = cur_v + height(leader_box);
1027 temp_ptr = leader_box;
1028 outer_doing_leaders = doing_leaders;
1029 doing_leaders = true;
1031 if (type(leader_box) == vlist_node)
1036 doing_leaders = outer_doing_leaders;
1040 cur_v = save_v - height(leader_box) + leader_ht + lx;
1053 cur_v = cur_v + width(p);
1063 if (is_running(rule_wd))
1064 rule_wd = width(this_box);
1066 rule_ht = rule_ht + rule_dp;
1067 cur_v = cur_v + rule_ht;
1069 if ((rule_ht > 0) && (rule_wd > 0))
1081 cur_v = cur_v + rule_ht;
1088 prune_movements(save_loc);
1096 void dvi_ship_out_(halfword p)
1103 if (tracing_output > 0)
1107 prints("Completed box being shipped out");
1110 if (term_offset > max_print_line - 9)
1112 else if ((term_offset > 0) || (file_offset > 0))
1118 while ((count(j) == 0) && (j > 0))
1121 for (k = 0; k <= j; k++)
1123 print_int(count(k));
1131 if (tracing_output > 0)
1136 end_diagnostic(true);
1139 if ((height(p) > max_dimen) || (depth(p) > max_dimen) ||
1140 (height(p) + depth(p) + v_offset > max_dimen) ||
1141 (width(p) + h_offset > max_dimen))
1143 print_err("Huge page cannot be shipped out");
1144 help2("The page just created is more than 18 feet tall or",
1145 "more than 18 feet wide, so I suspect something went wrong.");
1148 if (tracing_output <= 0)
1151 print_nl("The following box has been deleted:");
1153 end_diagnostic(true);
1159 if (height(p) + depth(p) + v_offset > max_v)
1160 max_v = height(p) + depth(p) + v_offset;
1162 if (width(p) + h_offset > max_h)
1163 max_h = width(p) + h_offset;
1171 if (total_pages == 0)
1175 dvi_four(25400000L);
1176 dvi_four(473628672L);
1179 old_setting = selector;
1180 selector = new_string;
1181 prints(" TeX output ");
1188 print_two(tex_time / 60);
1189 print_two(tex_time % 60);
1190 selector = old_setting;
1191 dvi_out(cur_length);
1193 for (s = str_start[str_ptr]; s <= pool_ptr - 1; s++)
1194 dvi_out(str_pool[s]);
1196 pool_ptr = str_start[str_ptr];
1199 page_loc = dvi_offset + dvi_ptr;
1202 for (k = 0; k <= 9; k++)
1206 last_bop = page_loc;
1207 cur_v = height(p) + v_offset;
1210 if (type(p) == vlist_node)
1220 if (tracing_output <= 0)
1227 if (tracing_stats > 1)
1229 print_nl("Memory usage before: ");
1230 print_int(var_used);
1232 print_int(dyn_used);
1240 if (tracing_stats > 1)
1243 print_int(var_used);
1245 print_int(dyn_used);
1246 prints("; still utouched: ");
1247 print_int(hi_mem_min - lo_mem_max - 1);
1252 void ship_out_(halfword p)
1254 switch (shipout_flag)
1263 void scan_spec_(group_code c, boolean three_codes)
1271 if (scan_keyword("to"))
1272 spec_code = exactly;
1273 else if (scan_keyword("spread"))
1274 spec_code = additional;
1277 spec_code = additional;
1282 scan_dimen(false, false, false);
1291 saved(0) = spec_code;
1293 save_ptr = save_ptr + 2;
1298 halfword hpack_(halfword p, scaled w, small_number m)
1306 int o; /* 95/Jan/7 */
1307 internal_font_number f;
1312 r = get_node(box_node_size);
1313 type(r) = hlist_node;
1315 shift_amount(r) = 0;
1316 q = r + list_offset;
1321 total_stretch[normal] = 0;
1322 total_shrink[normal] = 0;
1323 total_stretch[fil] = 0;
1324 total_shrink[fil] = 0;
1325 total_stretch[fill] = 0;
1326 total_shrink[fill] = 0;
1327 total_stretch[filll] = 0;
1328 total_shrink[filll] = 0;
1333 while (is_char_node(p))
1336 i = char_info(f, character(p));
1337 hd = height_depth(i);
1338 x = x + char_width(f, i);
1339 s = char_height(f, hd);
1344 s = char_depth(f, hd);
1363 if (type(p) >= rule_node)
1366 s = shift_amount(p);
1368 if (height(p) - s > h)
1371 if (depth(p) + s > d)
1379 if (adjust_tail != 0)
1381 while (link(q) != p)
1384 if (type(p) == adjust_node)
1386 link(adjust_tail) = adjust_ptr(p);
1388 while (link(adjust_tail) != 0)
1389 adjust_tail = link(adjust_tail);
1392 free_node(link(q), small_node_size);
1396 link(adjust_tail) = p;
1413 o = stretch_order(g);
1414 total_stretch[o] = total_stretch[o] + stretch(g);
1415 o = shrink_order(g);
1416 total_shrink[o] = total_shrink[o] + shrink(g);
1418 if (subtype(p) >= a_leaders)
1438 mem[lig_trick] = mem[lig_char(p)];
1439 link(lig_trick) = link(p);
1452 if (adjust_tail != 0)
1453 link(adjust_tail) = 0;
1458 if (m == additional)
1466 glue_sign(r) = normal;
1467 glue_order(r) = normal;
1473 if (total_stretch[filll] != 0)
1475 else if (total_stretch[fill] != 0)
1477 else if (total_stretch[fil] != 0)
1483 glue_sign(r) = stretching;
1485 if (total_stretch[o] != 0)
1486 glue_set(r) = x / ((double) total_stretch[o]);
1489 glue_sign(r) = normal;
1494 if (list_ptr(r) != 0)
1496 last_badness = badness(x, total_stretch[normal]);
1498 if (last_badness > hbadness)
1502 if (last_badness > 100)
1503 print_nl("Underfull");
1507 prints(" \\hbox (badness ");
1508 print_int(last_badness);
1510 if (last_badness > 100) /* Y&Y TeX */
1520 if (total_shrink[filll] != 0)
1522 else if (total_shrink[fill] != 0)
1524 else if (total_shrink[fil] != 0)
1530 glue_sign(r) = shrinking;
1532 if (total_shrink[o] != 0)
1533 glue_set(r) = ((- (integer) x) / ((double) total_shrink[o]));
1536 glue_sign(r) = normal;
1540 if ((total_shrink[o] < - (integer) x) && (o == 0) && (list_ptr(r) != 0))
1542 last_badness = 1000000L;
1545 if ((- (integer) x - total_shrink[normal] > hfuzz) || (hbadness < 100))
1547 if ((overfull_rule > 0) && (- (integer) x - total_shrink[0] > hfuzz))
1549 while (link(q) != 0)
1552 link(q) = new_rule();
1553 width(link(q)) = overfull_rule;
1557 print_nl("Overfull \\hbox (");
1558 print_scaled(- (integer) x - total_shrink[normal]);
1559 prints("pt too wide");
1566 else if (o == normal)
1567 if (list_ptr(r) != 0)
1569 last_badness = badness(- (integer) x, total_shrink[normal]);
1571 if (last_badness > hbadness)
1574 print_nl("Tight \\hbox (badness ");
1575 print_int(last_badness);
1584 prints(") has occurred while \\output is active");
1587 if (pack_begin_line != 0)
1589 if (pack_begin_line > 0)
1590 prints(") in paragraph at lines ");
1592 prints(") in alignment at lines ");
1594 print_int(abs(pack_begin_line));
1598 prints(") detected at line ");
1604 font_in_short_display = null_font;
1605 short_display(list_ptr(r));
1609 end_diagnostic(true);
1615 halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
1622 int o; /* 95/Jan/7 */
1625 r = get_node(box_node_size);
1626 type(r) = vlist_node;
1627 subtype(r) = min_quarterword;
1628 shift_amount(r) = 0;
1633 total_stretch[normal] = 0;
1634 total_shrink[normal] = 0;
1635 total_stretch[fil] = 0;
1636 total_shrink[fil] = 0;
1637 total_stretch[fill] = 0;
1638 total_shrink[fill] = 0;
1639 total_stretch[filll] = 0;
1640 total_shrink[filll] = 0;
1644 if (is_char_node(p))
1649 else switch (type(p))
1656 x = x + d + height(p);
1659 if (type(p) >= rule_node)
1662 s = shift_amount(p);
1664 if (width(p) + s > w)
1678 o = stretch_order(g);
1679 total_stretch[o] = total_stretch[o] + stretch(g);
1680 o = shrink_order(g);
1681 total_shrink[o] = total_shrink[o] + shrink(g);
1683 if (subtype(p) >= a_leaders)
1695 x = x + d + width(p);
1716 if (m == additional)
1724 glue_sign(r) = normal;
1725 glue_order(r) = normal;
1731 if (total_stretch[filll] != 0)
1733 else if (total_stretch[fill] != 0)
1735 else if (total_stretch[fil] != 0)
1741 glue_sign(r) = stretching;
1743 if (total_stretch[o] != 0)
1744 glue_set(r) = x / ((double) total_stretch[o]);
1747 glue_sign(r) = normal;
1752 if (list_ptr(r) != 0)
1754 last_badness = badness(x, total_stretch[normal]);
1756 if (last_badness > vbadness)
1760 if (last_badness > 100)
1761 print_nl("Underfull");
1765 prints(" \\vbox (badness ");
1766 print_int(last_badness);
1768 if (last_badness > 100)
1769 underfull_vbox++; /* 1996/Feb/9 */
1778 if (total_shrink[filll] != 0)
1780 else if (total_shrink[fill] != 0)
1782 else if (total_shrink[fil] != 0)
1788 glue_sign(r) = shrinking;
1790 if (total_shrink[o] != 0)
1791 glue_set(r) =(- (integer) x)/ ((double) total_shrink[o]);
1794 glue_sign(r) = normal;
1798 if ((total_shrink[o] < - (integer) x) && (o == 0) && (list_ptr(r) != 0))
1800 last_badness = 1000000L;
1803 if ((- (integer) x - total_shrink[0] > vfuzz) || (vbadness < 100))
1806 print_nl("Overfull \\vbox (");
1807 print_scaled(- (integer) x - total_shrink[0]);
1808 prints("pt too high");
1810 overfull_vbox++; /* 1996/Feb/9 */
1816 if (list_ptr(r) != 0)
1818 last_badness = badness(- (integer) x, total_shrink[normal]);
1819 if (last_badness > vbadness)
1822 print_nl("Tight \\vbox (badness ");
1823 print_int(last_badness);
1832 prints(") has occurred while \\output is active");
1835 if (pack_begin_line != 0)
1837 prints(") in alignment at lines ");
1838 print_int(abs(pack_begin_line));
1842 prints(") detected at line ");
1850 end_diagnostic(true);
1856 void append_to_vlist_(halfword b)
1861 if (prev_depth > ignore_depth)
1863 d = width(baseline_skip) - prev_depth - height(b);
1865 if (d < line_skip_limit)
1866 p = new_param_glue(line_skip_code);
1869 p = new_skip_param(baseline_skip_code);
1870 width(temp_ptr) = d;
1879 prev_depth = depth(b);
1882 halfword new_noad (void)
1886 p = get_node(noad_size);
1888 subtype(p) = normal;
1889 mem[nucleus(p)].hh = empty_field;
1890 mem[subscr(p)].hh = empty_field;
1891 mem[supscr(p)].hh = empty_field;
1896 halfword new_style_(small_number s)
1900 p = get_node(style_node_size);
1901 type(p) = style_node;
1909 halfword new_choice (void)
1913 p = get_node(style_node_size);
1914 type(p) = choice_node;
1916 display_mlist(p) = 0;
1918 script_mlist(p) = 0;
1919 script_script_mlist(p) = 0;
1924 void show_info (void)
1926 show_node_list(info(temp_ptr));
1929 halfword fraction_rule_(scaled t)
1940 halfword overbar_(halfword b, scaled k, scaled t)
1946 q = fraction_rule(t);
1950 return vpackage(p, 0, 1, 1073741823L); /* 2^30 - 1 */
1953 halfword char_box_(internal_font_number f, quarterword c)
1959 q = char_info(f, c);
1960 hd = height_depth(q);
1962 width(b) = char_width(f, q) + char_italic(f, q);
1963 height(b) = char_height(f, hd);
1964 depth(b) = char_depth(f, hd);
1973 void stack_into_box_(halfword b, internal_font_number f, quarterword c)
1978 link(p) = list_ptr(b);
1980 height(b) = height(p);
1983 scaled height_plus_depth_(internal_font_number f, quarterword c)
1988 q = char_info(f, c);
1989 hd = height_depth(q);
1990 return char_height(f, hd) + char_depth(f, hd);
1993 halfword var_delimiter_(halfword d, small_number s, scaled v)
1996 internal_font_number f, g;
1997 quarterword c, x, y;
2004 /* small_number z; */
2005 int z; /* 95/Jan/7 */
2006 /* boolean large_attempt; */
2007 int large_attempt; /* 95/Jan/7 */
2011 large_attempt = false;
2017 if ((z != 0) || (x != 0))
2030 if ((y >= font_bc[g]) && (y <= font_ec[g]))
2033 q = char_info(g, y);
2037 if (char_tag(q) == ext_tag)
2044 hd = height_depth(q);
2045 u = char_height(g, hd) + char_depth(g, hd);
2057 if (char_tag(q) == list_tag)
2072 large_attempt = true;
2079 if (char_tag(q) == ext_tag)
2082 type(b) = vlist_node;
2083 r = font_info[exten_base[f] + rem_byte(q)].qqqq;
2085 u = height_plus_depth(f, c);
2087 q = char_info(f, c);
2088 width(b) = char_width(f, q) + char_italic(f, q);
2091 if (c != min_quarterword)
2092 w = w + height_plus_depth(f, c);
2096 if (c != min_quarterword)
2097 w = w + height_plus_depth(f, c);
2101 if (c != min_quarterword)
2102 w = w + height_plus_depth(f, c);
2112 if (ext_mid(r) != min_quarterword)
2118 if (c != min_quarterword)
2119 stack_into_box(b, f, c);
2123 for (m = 1; m <= n; m++)
2124 stack_into_box(b, f, c);
2128 if (c != min_quarterword)
2130 stack_into_box(b, f, c);
2133 for (m = 1; m <= n; m++)
2134 stack_into_box(b, f, c);
2140 stack_into_box(b, f, c);
2142 depth(b) = w - height(b);
2149 width(b) = null_delimiter_space;
2152 shift_amount(b) = half(height(b) - depth(b)) - axis_height(s);
2156 /* rebox_ etc used to follow here in tex4.c */