[glide] Add PDF export support for text



commit f8ac314a1ae77e834878a3aa7ec55100a446e6f4
Author: Robert Carr <racarr Valentine localdomain>
Date:   Mon Apr 26 19:37:13 2010 -0400

    Add PDF export support for text

 src/glide-text.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/glide-text.c b/src/glide-text.c
index d9a8aab..59afa2b 100644
--- a/src/glide-text.c
+++ b/src/glide-text.c
@@ -80,6 +80,8 @@
 
 #include "glide-debug.h"
 
+#include "glide-cairo-util.h"
+
 
 
 
@@ -2695,6 +2697,23 @@ glide_text_deserialize (GlideActor *actor, JsonObject *actor_obj)
 }
 
 static void
+glide_text_print (GlideActor *actor, cairo_t *cr)
+{
+  GlideText *text = GLIDE_TEXT (actor);
+  PangoLayout *layout = glide_text_get_layout (text);
+  gfloat x, y;
+  
+  clutter_actor_get_position (CLUTTER_ACTOR (text), &x, &y);
+  
+  cairo_move_to (cr, x, y);
+  
+  glide_cairo_set_clutter_color (cr, &text->priv->text_color);
+  pango_cairo_show_layout (cr, layout);
+  
+  cairo_fill (cr);
+}
+
+static void
 glide_text_class_init (GlideTextClass *klass)
 {
   GlideActorClass *glide_actor_class = GLIDE_ACTOR_CLASS (klass);
@@ -2724,6 +2743,7 @@ glide_text_class_init (GlideTextClass *klass)
   glide_actor_class->selected = glide_text_selected;
   glide_actor_class->serialize = glide_text_serialize;
   glide_actor_class->deserialize = glide_text_deserialize;
+  glide_actor_class->print = glide_text_print;
 
   /**
    * GlideText:font-name:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]