1 package AA::Background;
7 my $b = AA::new($class, $id);
9 $b->DefSet('color', [1, 1, 1]);
15 $cairo->select_font_face('URW Palladio L', 'normal', 'normal'); # default for all objs
17 $cairo->rectangle(0, 0, 1024, 768);
18 $cairo->set_source_rgb(@{$b->Get('color')});
27 my ($class, $id) = @_;
28 my $t = AA::new($class, $id);
32 $t->DefSet('color', [0, 0, 0]);
33 $t->DefSet('size', 12);
34 $t->DefSet('text', '');
40 my $text = $t->Get('text');
41 $cairo->set_source_rgb(@{$t->Get('color')});
42 $cairo->set_font_size($t->Get('size'));
43 my $xt = $cairo->text_extents($text);
44 $cairo->move_to($t->Get("x") - $xt->{'width'}/2 - $xt->{'x_bearing'},
45 $t->Get("y") - $xt->{'height'}/2 - $xt->{'y_bearing'});
46 $cairo->show_text($text);