16
draw_timesig (GdkPixmap * pixmap, GdkGC * gc, GdkFont * font, gint xx, gint y,
16
draw_timesig (cairo_t *cr, gint xx, gint y,
17
17
gint time1, gint time2)
19
PangoContext *context =
20
gdk_pango_context_get_for_screen (gdk_drawable_get_screen (pixmap));;
21
PangoLayout *layout = pango_layout_new (context);
22
PangoFontDescription *desc =
23
pango_font_description_from_string (TIMESIGFONT);
24
19
static GString *timesigtop;
25
20
static GString *timesigbottom;
33
28
g_string_sprintf (timesigbottom, "%d", time2);
36
pango_layout_set_text (layout, timesigtop->str, -1);
37
pango_layout_set_font_description (layout, desc);
38
31
gint extra = LINE_SPACE / 2;
39
gdk_draw_layout (pixmap, gc, xx, y - extra, layout); //hard coded LINESPACE*0.5
41
pango_layout_set_text (layout, timesigbottom->str, -1);
42
pango_layout_set_font_description (layout, desc);
43
extra = (3 * LINE_SPACE) / 2;
44
gdk_draw_layout (pixmap, gc, xx, y + extra, layout); //hardcoded LINESPACE * 1.5
45
pango_font_description_free (desc);
32
cairo_select_font_face( cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL );
33
cairo_set_font_size( cr, 24.0 );
35
cairo_move_to( cr, xx,y+20 );
36
cairo_show_text( cr, timesigtop->str );
38
cairo_move_to( cr, xx,y+40 );
39
cairo_show_text( cr, timesigbottom->str );