diff src/shape_text.c @ 294:2ca0773cd48d

* Add MBAF files * Change begin_index to be start_index * fix the color setting.
author wycc
date Sun, 01 Feb 2009 09:51:12 +0800
parents 7270e368ee98
children f894b30676e9
line wrap: on
line diff
--- a/src/shape_text.c	Sun Feb 01 02:34:24 2009 +0800
+++ b/src/shape_text.c	Sun Feb 01 09:51:12 2009 +0800
@@ -83,9 +83,9 @@
 
 void sh_text_set_color(shape_t *shape, unsigned int color)
 {
-    PangoAttribute *attr = pango_attr_color_new(color);
+    PangoAttribute *attr = pango_attr_foreground_new(TEXTCOLOR_RED(color)<<8,TEXTCOLOR_GREEN(color)<<8,TEXTCOLOR_BLUE(color)<<8);
     sh_text_t *text = (sh_text_t *)shape;
-    attr->begin_index = 0;
+    attr->start_index = 0;
     attr->end_index = -1;
     pango_attr_list_change(text->attrs, attr);
 }
@@ -93,7 +93,7 @@
 {
     PangoAttribute *attr = pango_attr_weight_new(bold? PANGO_WEIGHT_BOLD:PANGO_WEIGHT_NORMAL);
     sh_text_t *text = (sh_text_t *)shape;
-    attr->begin_index = 0;
+    attr->start_index = 0;
     attr->end_index = -1;
     pango_attr_list_change(text->attrs, attr);
 }
@@ -101,7 +101,7 @@
 {
     PangoAttribute *attr = pango_attr_style_new(italic? PANGO_STYLE_ITALIC:PANGO_STYLE_NORMAL);
     sh_text_t *text = (sh_text_t *)shape;
-    attr->begin_index = 0;
+    attr->start_index = 0;
     attr->end_index = -1;
     pango_attr_list_change(text->attrs, attr);
 }
@@ -109,7 +109,7 @@
 {
     PangoAttribute *attr = pango_attr_underline_new(underline? PANGO_UNDERLINE_SINGLE:PANGO_UNDERLINE_NONE);
     sh_text_t *text = (sh_text_t *)shape;
-    attr->begin_index = 0;
+    attr->start_index = 0;
     attr->end_index = -1;
     pango_attr_list_change(text->attrs, attr);
 }
@@ -117,7 +117,7 @@
 {
     PangoAttribute *attr = pango_attr_family_new(family);
     sh_text_t *text = (sh_text_t *)shape;
-    attr->begin_index = 0;
+    attr->start_index = 0;
     attr->end_index = -1;
     pango_attr_list_change(text->attrs, attr);
 }