/* Copyright (C) 1989, 1990 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.uucp)
This file is part of groff.
groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
groff is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
You should have received a copy of the GNU General Public License along
with groff; see the file LICENSE. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
class limit_box
: public box
{
limit_box(box
*, box
*, box
*);
int compute_metrics(int);
box
*make_limit_box(box
*pp
, box
*qq
, box
*rr
)
return new limit_box(pp
, qq
, rr
);
limit_box::limit_box(box
*pp
, box
*qq
, box
*rr
)
: p(pp
), from(qq
), to(rr
)
spacing_type
= p
->spacing_type
;
int limit_box::compute_metrics(int style
)
printf(".nr " SIZE_FORMAT
" \\n[.s]\n", uid
);
if (!(style
<= SCRIPT_STYLE
&& one_size_reduction_flag
))
printf(".nr " SMALL_SIZE_FORMAT
" \\n[.s]\n", uid
);
res
= from
->compute_metrics(cramped_style(script_style(style
)));
int r
= to
->compute_metrics(script_style(style
));
error("multiple marks and lineups");
printf(".ps \\n[" SIZE_FORMAT
"]\n", uid
);
int r
= p
->compute_metrics(style
);
p
->compute_subscript_kern();
error("multiple marks and lineups");
printf(".nr " LEFT_WIDTH_FORMAT
" "
printf(">?(\\n[" SUB_KERN_FORMAT
"]+\\n[" WIDTH_FORMAT
"])",
printf(">?(-\\n[" SUB_KERN_FORMAT
"]+\\n[" WIDTH_FORMAT
"])",
printf(".nr " WIDTH_FORMAT
" "
printf(">?(-\\n[" SUB_KERN_FORMAT
"]+\\n[" WIDTH_FORMAT
"])",
printf(">?(\\n[" SUB_KERN_FORMAT
"]+\\n[" WIDTH_FORMAT
"])",
printf("/2+\\n[" LEFT_WIDTH_FORMAT
"]\n", uid
);
printf(".nr " WIDTH_FORMAT
" 0\\n[" WIDTH_FORMAT
"]", uid
, p
->uid
);
printf(">?\\n[" WIDTH_FORMAT
"]", to
->uid
);
printf(">?\\n[" WIDTH_FORMAT
"]", from
->uid
);
printf(".nr " MARK_REG
" +(\\n[" LEFT_WIDTH_FORMAT
"]"
"-(\\n[" WIDTH_FORMAT
"]/2))\n",
printf(".nr " SUP_RAISE_FORMAT
" %dM+\\n[" DEPTH_FORMAT
"]>?%dM+\\n[" HEIGHT_FORMAT
"]\n",
uid
, big_op_spacing1
, to
->uid
, big_op_spacing3
, p
->uid
);
printf(".nr " HEIGHT_FORMAT
" \\n[" SUP_RAISE_FORMAT
"]+\\n["
uid
, uid
, to
->uid
, big_op_spacing5
);
printf(".nr " HEIGHT_FORMAT
" \\n[" HEIGHT_FORMAT
"]\n", uid
, p
->uid
);
printf(".nr " SUB_LOWER_FORMAT
" %dM+\\n[" HEIGHT_FORMAT
"]>?%dM+\\n[" DEPTH_FORMAT
"]\n",
uid
, big_op_spacing2
, from
->uid
, big_op_spacing4
, p
->uid
);
printf(".nr " DEPTH_FORMAT
" \\n[" SUB_LOWER_FORMAT
"]+\\n["
uid
, uid
, from
->uid
, big_op_spacing5
);
printf(".nr " DEPTH_FORMAT
" \\n[" DEPTH_FORMAT
"]\n", uid
, p
->uid
);
printf("\\s[\\n[" SMALL_SIZE_FORMAT
"]]", uid
);
printf("\\Z" DELIMITER_CHAR
);
printf("\\v'-\\n[" SUP_RAISE_FORMAT
"]u'", uid
);
printf("\\h'\\n[" LEFT_WIDTH_FORMAT
"]u"
"+(-\\n[" WIDTH_FORMAT
"]u+\\n[" SUB_KERN_FORMAT
"]u/2u)'",
printf("\\Z" DELIMITER_CHAR
);
printf("\\v'\\n[" SUB_LOWER_FORMAT
"]u'", uid
);
printf("\\h'\\n[" LEFT_WIDTH_FORMAT
"]u"
"+(-\\n[" SUB_KERN_FORMAT
"]u-\\n[" WIDTH_FORMAT
"]u/2u)'",
printf("\\s[\\n[" SIZE_FORMAT
"]]", uid
);
printf("\\Z" DELIMITER_CHAR
);
printf("\\h'\\n[" LEFT_WIDTH_FORMAT
"]u"
"-(\\n[" WIDTH_FORMAT
"]u/2u)'",
printf("\\h'\\n[" WIDTH_FORMAT
"]u'", uid
);
void limit_box::debug_print()
fprintf(stderr
, " from { ");
fprintf(stderr
, " to { ");
void limit_box::check_tabs(int level
)
to
->check_tabs(level
+ 1);
from
->check_tabs(level
+ 1);
p
->check_tabs(level
+ 1);