4 * The geeky little puzzle game with a big noodly crunch!
6 * gPlanarity copyright (C) 2005 Monty <monty@xiph.org>
7 * Original Flash game by John Tantalo <john.tantalo@case.edu>
8 * Original game concept by Mary Radcliffe
10 * gPlanarity is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
15 * gPlanarity is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Postfish; see the file COPYING. If not, write to the
22 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
33 #include "gameboard.h"
35 GdkRectangle
render_text_centered(cairo_t
*c
, char *s
, int x
, int y
){
36 cairo_text_extents_t ex
;
39 cairo_text_extents (c
, s
, &ex
);
42 r
.y
=y
+(ex
.y_bearing
/2);
46 cairo_move_to (c
, r
.x
-ex
.x_bearing
, r
.y
-ex
.y_bearing
);
47 cairo_show_text (c
, s
);
52 GdkRectangle
render_border_centered(cairo_t
*c
, char *s
, int x
, int y
){
53 cairo_text_extents_t ex
;
56 cairo_text_extents (c
, s
, &ex
);
59 r
.y
=y
+(ex
.y_bearing
/2)-2;
64 cairo_move_to (c
, r
.x
-ex
.x_bearing
+2, r
.y
-ex
.y_bearing
+2 );
65 cairo_set_line_width(c
,3);
66 cairo_set_source_rgba(c
,1,1,1,.9);
67 cairo_text_path (c
, s
);
74 GdkRectangle
render_bordertext_centered(cairo_t
*c
, char *s
, int x
, int y
){
75 GdkRectangle r
= render_border_centered(c
,s
,x
,y
);
76 render_text_centered(c
,s
,x
,y
);