174
174
ClutterColor color;
175
175
StTextDecoration decoration;
176
PangoAttrList *attribs;
176
PangoAttrList *attribs = NULL;
177
177
const PangoFontDescription *font;
179
178
StTextAlign align;
181
180
st_theme_node_get_foreground_color (theme_node, &color);
182
181
clutter_text_set_color (text, &color);
184
183
font = st_theme_node_get_font (theme_node);
185
font_string = pango_font_description_to_string (font);
186
clutter_text_set_font_name (text, font_string);
187
g_free (font_string);
189
attribs = pango_attr_list_new ();
184
clutter_text_set_font_description (text, (PangoFontDescription *) font);
191
186
decoration = st_theme_node_get_text_decoration (theme_node);
192
if (decoration & ST_TEXT_DECORATION_UNDERLINE)
194
PangoAttribute *underline = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
195
pango_attr_list_insert (attribs, underline);
197
if (decoration & ST_TEXT_DECORATION_LINE_THROUGH)
199
PangoAttribute *strikethrough = pango_attr_strikethrough_new (TRUE);
200
pango_attr_list_insert (attribs, strikethrough);
202
/* Pango doesn't have an equivalent attribute for _OVERLINE, and we deliberately
203
* skip BLINK (for now...)
189
attribs = pango_attr_list_new ();
191
if (decoration & ST_TEXT_DECORATION_UNDERLINE)
193
PangoAttribute *underline = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
194
pango_attr_list_insert (attribs, underline);
196
if (decoration & ST_TEXT_DECORATION_LINE_THROUGH)
198
PangoAttribute *strikethrough = pango_attr_strikethrough_new (TRUE);
199
pango_attr_list_insert (attribs, strikethrough);
201
/* Pango doesn't have an equivalent attribute for _OVERLINE, and we deliberately
202
* skip BLINK (for now...)
206
206
clutter_text_set_attributes (text, attribs);
208
pango_attr_list_unref (attribs);
209
pango_attr_list_unref (attribs);
210
211
align = st_theme_node_get_text_align (theme_node);
211
if(align == ST_TEXT_ALIGN_JUSTIFY) {
212
clutter_text_set_justify (text, TRUE);
213
clutter_text_set_line_alignment (text, PANGO_ALIGN_LEFT);
215
clutter_text_set_justify (text, FALSE);
216
clutter_text_set_line_alignment (text, (PangoAlignment) align);
212
if (align == ST_TEXT_ALIGN_JUSTIFY)
214
clutter_text_set_justify (text, TRUE);
215
clutter_text_set_line_alignment (text, PANGO_ALIGN_LEFT);
219
clutter_text_set_justify (text, FALSE);
220
clutter_text_set_line_alignment (text, (PangoAlignment) align);
507
511
cogl_color_set_from_4ub (&clear_color, 0, 0, 0, 0);
508
512
cogl_push_framebuffer (offscreen);
509
513
cogl_clear (&clear_color, COGL_BUFFER_BIT_COLOR);
514
cogl_translate (-box.x1, -box.y1, 0);
510
515
cogl_ortho (0, width, height, 0, 0, 1.0);
511
516
clutter_actor_paint (actor);
512
517
cogl_pop_framebuffer ();