summaryrefslogtreecommitdiff
path: root/utils/viewer-pangocairo.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-08-03 16:01:54 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-08-03 16:30:23 -0400
commit3ef436bf8df0890280547ae392be03e4789a8a89 (patch)
tree43d7920950b51d0c968cf78a8e87a94568c66526 /utils/viewer-pangocairo.c
parent7d3e528978ee1a1b5f1e12eaa09ad13fa8b13606 (diff)
downloadpango-3ef436bf8df0890280547ae392be03e4789a8a89.tar.gz
pango-view: Add a --subpixel-positions option
This lets us explore the influence of subpixel positioning in various contexts without relying on gtk applications.
Diffstat (limited to 'utils/viewer-pangocairo.c')
-rw-r--r--utils/viewer-pangocairo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c
index f82bd72d..ac3b49c3 100644
--- a/utils/viewer-pangocairo.c
+++ b/utils/viewer-pangocairo.c
@@ -36,6 +36,7 @@ typedef struct
PangoFontMap *fontmap;
cairo_font_options_t *font_options;
+ gboolean subpixel_positions;
} CairoViewer;
static gpointer
@@ -73,6 +74,8 @@ pangocairo_view_create (const PangoViewer *klass G_GNUC_UNUSED)
if (opt_antialias != ANTIALIAS_DEFAULT)
cairo_font_options_set_antialias (instance->font_options, (cairo_antialias_t)opt_antialias);
+ instance->subpixel_positions = opt_subpixel_positions;
+
return instance;
}
@@ -100,6 +103,7 @@ pangocairo_view_get_context (gpointer instance)
context = pango_font_map_create_context (c->fontmap);
pango_cairo_context_set_font_options (context, c->font_options);
+ pango_context_set_round_glyph_positions (context, !c->subpixel_positions);
return context;
}