output: Rename a few struct members for consistency.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 26 Dec 2018 22:14:51 +0000 (14:14 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 1 Jan 2019 06:19:40 +0000 (22:19 -0800)
src/output/cairo.c
src/output/table-provider.h
src/output/table.c
src/output/text-item.c
src/output/text-item.h

index 32369a7a0e5071e609cfbf863fc3981e676c8d8a..4584181d32a3a779365e7993682010c2231fe544 100644 (file)
@@ -1225,11 +1225,11 @@ xr_layout_cell_text (struct xr_driver *xr, const struct table_cell *cell,
                           : 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)
         {
index 14c3656e4a2958b02c5dcf27e03138919f4a312a..ab39b4b25c5fc7d1e848726a98b1e457ca0feda2 100644 (file)
@@ -50,8 +50,8 @@ struct cell_style
   {
     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;
   };
 
@@ -61,8 +61,8 @@ struct cell_style
       .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,                                       \
index b83d66fb20898ccf6148198cb61dc114e9a06f07..f909bf3ade90f925be4b13f70762a8a3ee0c8c1b 100644 (file)
@@ -135,8 +135,8 @@ cell_style_clone (struct pool *pool, const struct cell_style *old)
 {
   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;
 }
 
@@ -145,7 +145,7 @@ cell_style_free (struct cell_style *style)
 {
   if (style)
     {
-      free (style->font);
+      free (style->typeface);
       free (style);
     }
 }
index 231a5c1fb7e87008160f03b8433f58880115421d..5b18e54c5d4618c693865fb5e9d624accc8ef852 100644 (file)
@@ -101,9 +101,9 @@ text_item_to_table_item (struct text_item *text_item)
 
   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;
@@ -118,13 +118,14 @@ text_item_to_table_item (struct text_item *text_item)
   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);
 }
 
index 659a28bd0f8bf418da8433e14d909df5e1d32236..a8f1e493e92fdb7382c91d947d1fe59b6ed62479 100644 (file)
@@ -50,8 +50,8 @@ struct text_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;
   };