PangoLayout & PangoMatrix
- From: "Leonel Freire" <leonelfreire gmail com>
- To: gtk-app-devel-list gnome org
- Subject: PangoLayout & PangoMatrix
- Date: Tue, 7 Aug 2007 22:36:34 -0300
#include <gtk/gtk.h>
static gboolean cb
(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
gtk_paint_layout(
widget->style,
widget->window,
GTK_WIDGET_STATE(widget),
FALSE,
&event->area,
widget,
"drawingarea",
0, 0,
PANGO_LAYOUT(data));
}
int main(int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *da;
PangoContext *context;
PangoLayout *layout;
PangoFontDescription *fd;
PangoMatrix matrix = PANGO_MATRIX_INIT;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
da = gtk_drawing_area_new();
gtk_container_add(GTK_CONTAINER(window), da);
context = gtk_widget_get_pango_context(da);
pango_matrix_scale(&matrix, 2, 1); /*
<============================================== here! */
pango_context_set_matrix(context, &matrix);
layout = pango_layout_new(context);
pango_layout_set_text(layout, "Text1 Text2", -1);
g_signal_connect(
G_OBJECT(da), "expose-event",
G_CALLBACK(cb), (gpointer) layout);
gtk_widget_show(da);
gtk_widget_show(window);
gtk_main();
return 0;
}
Well...
What I'm trying to do is a "double width" text, but with the normal
height... what's wrong with this code? It shows just a bad formated text,
nothing that I was expecting...
--
Leonel Freire
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]