: options & TAB_EMPH ? &xr->fonts[XR_FONT_EMPHASIS]
: &xr->fonts[XR_FONT_PROPORTIONAL]);
struct xr_font local_font;
- if (cell->style->font)
+ if (cell->style->typeface)
{
PangoFontDescription *desc = parse_font (
- style->font,
- style->font_size ? style->font_size * 1000 * 72 / 128 : 10000,
+ style->typeface,
+ style->size ? style->size * 1000 * 72 / 128 : 10000,
style->bold, style->italic);
if (desc)
{
{
struct cell_color fg[2], bg[2];
int margin[TABLE_N_AXES][2];
- char *font;
- int font_size;
+ char *typeface;
+ int size;
bool bold, italic, underline;
};
.bg = { [0] = CELL_COLOR_WHITE, [1] = CELL_COLOR_WHITE}, \
.margin = { [TABLE_HORZ][0] = 8, [TABLE_HORZ][1] = 11, \
[TABLE_VERT][0] = 1, [TABLE_VERT][1] = 1 }, \
- .font = NULL, \
- .font_size = 0, \
+ .typeface = NULL, \
+ .size = 0, \
.bold = false, \
.italic = false, \
.underline = false, \
{
struct cell_style *new = pool_malloc (pool, sizeof *new);
*new = *old;
- if (new->font)
- new->font = pool_strdup (pool, new->font);
+ if (new->typeface)
+ new->typeface = pool_strdup (pool, new->typeface);
return new;
}
{
if (style)
{
- free (style->font);
+ free (style->typeface);
free (style);
}
}
struct cell_style *style = pool_alloc (tab->container, sizeof *style);
*style = (struct cell_style) CELL_STYLE_INITIALIZER;
- if (text_item->font)
- style->font = pool_strdup (tab->container, text_item->font);
- style->font_size = text_item->font_size;
+ if (text_item->typeface)
+ style->typeface = pool_strdup (tab->container, text_item->typeface);
+ style->size = text_item->size;
style->bold = text_item->bold;
style->italic = text_item->italic;
style->underline = text_item->underline;
struct table_item *table_item = table_item_create (&tab->table, NULL, NULL);
text_item_unref (text_item);
return table_item;
-}\f
+}
+\f
static void
text_item_destroy (struct output_item *output_item)
{
struct text_item *item = to_text_item (output_item);
free (item->text);
- free (item->font);
+ free (item->typeface);
free (item);
}
struct output_item output_item;
char *text; /* The content. */
enum text_item_type type; /* Type. */
- char *font;
- int font_size;
+ char *typeface;
+ int size;
bool bold, italic, underline, markup;
};