summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-25 10:21:57 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-25 10:21:57 -0300
commita8f59fa1ed7d91b82a57b7cd7b31159f74835fa0 (patch)
tree25952c5ebd2f9e0da629b44d451a74ddb4b06f31 /gfx
parent8210235d69ddacacf6912b8d95a476e53ff19c1a (diff)
downloadeeshow-a8f59fa1ed7d91b82a57b7cd7b31159f74835fa0.tar.gz
eeshow-a8f59fa1ed7d91b82a57b7cd7b31159f74835fa0.tar.bz2
eeshow-a8f59fa1ed7d91b82a57b7cd7b31159f74835fa0.zip
gfx/cro.c: use_pango switches between Cairo and Pango, without further conditions
Since, ironically, Cairo was first to get overline support, the strchr(..., '~') condition no longer makes sense, and thus, since only one context will be used, neither does setting up both.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 170efbc..fae138b 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -380,7 +380,7 @@ static void cr_text_pango(void *ctx, int x, int y, const char *s, unsigned size,
static void cr_text(void *ctx, int x, int y, const char *s, unsigned size,
enum text_align align, int rot, unsigned color, unsigned layer)
{
- if (use_pango && strchr(s, '~'))
+ if (use_pango)
cr_text_pango(ctx, x, y, s, size, align, rot, color, layer);
else
cr_text_cairo(ctx, x, y, s, size, align, rot, color, layer);
@@ -457,11 +457,11 @@ static void setup_pango(struct cro_ctx *cc)
pango_font_description_from_string("Helvetica Bold");
cc->pango_layout = pango_cairo_create_layout(cc->cr);
// pango_font_description_free(cc->pango_desc);
+ // @@@ to destroy pango_layout, g_object_unref(layout);
+ } else {
+ cairo_select_font_face(cc->cr, "Helvetica",
+ CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
}
- cairo_select_font_face(cc->cr, "Helvetica",
- CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-
- // @@@ to destroy pango_layout, g_object_unref(layout);
}