summaryrefslogtreecommitdiff
path: root/utils/viewer-pangocairo.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-31 23:26:44 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-31 23:29:22 -0400
commitd31bb1c145737d6c75bd49995d322e5f52a651a0 (patch)
tree8e2537a068482fce8968c43eeab15c8bfb3b44d6 /utils/viewer-pangocairo.c
parent3385ecf1485f5aa6faedb92917f6e5edf2f66e6d (diff)
downloadpango-d31bb1c145737d6c75bd49995d322e5f52a651a0.tar.gz
pango-view: Add font options
Add commandline options for antialiasing, subpixel order and metrics hinting, so we can reproduce font rendering issues with pango-view.
Diffstat (limited to 'utils/viewer-pangocairo.c')
-rw-r--r--utils/viewer-pangocairo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c
index 9054b9fe..f82bd72d 100644
--- a/utils/viewer-pangocairo.c
+++ b/utils/viewer-pangocairo.c
@@ -55,10 +55,24 @@ pangocairo_view_create (const PangoViewer *klass G_GNUC_UNUSED)
{
if (opt_hinting == HINT_NONE)
cairo_font_options_set_hint_style (instance->font_options, CAIRO_HINT_STYLE_NONE);
+ else if (opt_hinting == HINT_SLIGHT ||
+ opt_hinting == HINT_AUTO)
+ cairo_font_options_set_hint_style (instance->font_options, CAIRO_HINT_STYLE_SLIGHT);
+ else if (opt_hinting == HINT_MEDIUM)
+ cairo_font_options_set_hint_style (instance->font_options, CAIRO_HINT_STYLE_MEDIUM);
else if (opt_hinting == HINT_FULL)
cairo_font_options_set_hint_style (instance->font_options, CAIRO_HINT_STYLE_FULL);
}
+ if (opt_subpixel_order != SUBPIXEL_DEFAULT)
+ cairo_font_options_set_subpixel_order (instance->font_options, (cairo_subpixel_order_t)opt_subpixel_order);
+
+ if (opt_hint_metrics != HINT_METRICS_DEFAULT)
+ cairo_font_options_set_hint_metrics (instance->font_options, (cairo_hint_metrics_t)opt_hint_metrics);
+
+ if (opt_antialias != ANTIALIAS_DEFAULT)
+ cairo_font_options_set_antialias (instance->font_options, (cairo_antialias_t)opt_antialias);
+
return instance;
}