int n[TABLE_N_AXES];
int h[TABLE_N_AXES][2];
- /* cp[H] represents x positions within the table.
+ /* "Cell positions".
+
+ cp[H] represents x positions within the table.
cp[H][0] = 0.
cp[H][1] = the width of the leftmost vertical rule.
cp[H][2] = cp[H][1] + the width of the leftmost column.
{
switch (type)
{
- case TAL_0:
+ case TAL_NONE:
return RENDER_LINE_NONE;
- case TAL_1:
+ case TAL_SOLID:
return RENDER_LINE_SINGLE;
- case TAL_2:
+ case TAL_DASHED:
+ return RENDER_LINE_DASHED;
+ case TAL_THICK:
+ return RENDER_LINE_THICK;
+ case TAL_THIN:
+ return RENDER_LINE_THIN;
+ case TAL_DOUBLE:
return RENDER_LINE_DOUBLE;
default:
NOT_REACHED ();
enum table_axis b = !a;
unsigned int rules;
int d[TABLE_N_AXES];
- int width;
/* Determine all types of rules that are present, as a bitmap in 'rules'
where rule type 't' is present if bit 2**t is set. */
if the device doesn't support margins, make sure that there is at least a
small gap between cells (but we don't need any at the left or right edge
of the table). */
- if (rules & (1u << TAL_0))
+ if (rules & (1u << TAL_NONE))
{
- rules &= ~(1u << TAL_0);
+ rules &= ~(1u << TAL_NONE);
if (z > 0 && z < table->n[a] && !params->supports_margins && a == H)
- rules |= 1u << TAL_1;
+ rules |= 1u << TAL_SOLID;
}
/* Calculate maximum width of the rules that are present. */
- width = 0;
- if (rules & (1u << TAL_1)
- || (z > 0 && z < table->n[a] && rules & (1u << TAL_0)))
- width = params->line_widths[a][RENDER_LINE_SINGLE];
- if (rules & (1u << TAL_2))
- width = MAX (width, params->line_widths[a][RENDER_LINE_DOUBLE]);
+ int width = 0;
+ for (size_t i = 0; i < N_LINES; i++)
+ if (rules & (1u << i))
+ width = MAX (width, params->line_widths[a][rule_to_render_type (i)]);
return width;
}
bb[V][0] = clip[V][0] = ofs[V] + page->cp[V][cell->d[V][0] * 2 + 1];
bb[V][1] = clip[V][1] = ofs[V] + page->cp[V][cell->d[V][1] * 2];
+ int valign = (cell->n_contents
+ ? cell->contents->options & TAB_VALIGN
+ : TAB_TOP);
+ if (valign != TAB_TOP)
+ {
+ int height = page->params->measure_cell_height (
+ page->params->aux, cell, bb[H][1] - bb[H][0]);
+ int extra = bb[V][1] - bb[V][0] - height;
+ if (extra > 0)
+ {
+ if (valign == TAB_MIDDLE)
+ extra /= 2;
+ bb[V][0] += extra;
+ }
+ }
+
of = find_overflow (page, cell->d[H][0], cell->d[V][0]);
if (of)
{
for (size_t i = 0; i < n_footnotes; i++)
if (f[i])
{
- tab_text (t, 0, i, TAB_LEFT, "");
- tab_add_footnote (t, 0, i, f[i]);
+ tab_text_format (t, 0, i, TAB_LEFT, "%s.", f[i]->marker);
tab_text (t, 1, i, TAB_LEFT, f[i]->content);
}
render_pager_add_table (p, &t->table);