Exemple #1
0
GtGraphics* gt_graphics_cairo_new(GtGraphicsOutType type,
                                  unsigned int width,
                                  unsigned int height)
{
  GtGraphics *g;
  g = gt_graphics_create(gt_graphics_cairo_class());
  gt_graphics_cairo_initialize(gt_graphics_cairo_cast(g), type, width, height);
  return g;
}
GtGraphics* gt_graphics_cairo_new(GtGraphicsOutType type,
                                  unsigned int width,
                                  unsigned int height)
{
  GtGraphics *g;
  GtGraphicsCairo *gc;
  char buf[64];
  g = gt_graphics_create(gt_graphics_cairo_class());
  gc = gt_graphics_cairo_cast(g);
  gt_graphics_cairo_initialize(g, type, width, height);
  gc->layout = pango_cairo_create_layout(gc->cr);
  pango_layout_set_width(gc->layout, -1);
  gt_assert(gc->layout);
  snprintf(buf, 64, "Sans %d", TEXT_SIZE_DEFAULT);
  gc->desc = pango_font_description_from_string(buf);
  pango_layout_set_font_description(gc->layout, gc->desc);
  pango_font_description_free(gc->desc);
  return g;
}