+ if (c->alpha != 255)
+ printf ("rgba(%d, %d, %d, %d)", c->r, c->g, c->b, c->alpha);
+ else
+ printf ("#%02"PRIx8"%02"PRIx8"%02"PRIx8, c->r, c->g, c->b);
+}
+
+void
+font_style_dump (const struct font_style *f)
+{
+ printf ("%s %dpx ", f->typeface, f->size);
+ cell_color_dump (&f->fg[0]);
+ putchar ('/');
+ cell_color_dump (&f->bg[0]);
+ if (!cell_color_equal (&f->fg[0], &f->fg[1])
+ || !cell_color_equal (&f->bg[0], &f->bg[1]))
+ {
+ printf (" alt=");
+ cell_color_dump (&f->fg[1]);
+ putchar ('/');
+ cell_color_dump (&f->bg[1]);
+ }
+ if (f->bold)
+ fputs (" bold", stdout);
+ if (f->italic)
+ fputs (" italic", stdout);
+ if (f->underline)
+ fputs (" underline", stdout);
+}
+
+bool
+font_style_equal (const struct font_style *a, const struct font_style *b)
+{
+ return (a->bold == b->bold
+ && a->italic == b->italic
+ && a->underline == b->underline
+ && a->markup == b->markup
+ && cell_color_equal (&a->fg[0], &b->fg[0])
+ && cell_color_equal (&a->fg[1], &b->fg[1])
+ && cell_color_equal (&a->bg[0], &b->bg[0])
+ && cell_color_equal (&a->bg[1], &b->bg[1])
+ && !strcmp (a->typeface ? a->typeface : "",
+ b->typeface ? b->typeface : "")
+ && a->size == b->size);
+}
+
+void
+cell_style_dump (const struct cell_style *c)
+{
+ fputs (table_halign_to_string (c->halign), stdout);
+ if (c->halign == TABLE_HALIGN_DECIMAL)
+ printf ("(%.2gpx)", c->decimal_offset);
+ printf (" %s", table_valign_to_string (c->valign));
+ printf (" %d,%d,%d,%dpx",
+ c->margin[TABLE_HORZ][0], c->margin[TABLE_HORZ][1],
+ c->margin[TABLE_VERT][0], c->margin[TABLE_VERT][1]);