1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/* ghosd -- OSD with fake transparency, cairo, and pango.
* Copyright (C) 2006 Evan Martin <martine@danga.com>
*/
#include "config.h"
#include <pango/pangocairo.h>
#include "ghosd-internal.h"
#include "ghosd-text.h"
void
ghosd_text_set_position(Ghosd *ghosd, int x, int y, PangoLayout *layout) {
PangoRectangle ink_rect;
pango_layout_get_pixel_extents(layout, &ink_rect, NULL);
/*printf("rect %d %d %d %d\n",
ink_rect.x, ink_rect.y,
ink_rect.width, ink_rect.height);*/
const int width = ink_rect.x + ink_rect.width+5;
const int height = ink_rect.y + ink_rect.height+5;
ghosd_set_position(ghosd, x, y, width, height);
}
/* vim: set ts=2 sw=2 et cino=(0 : */
|