summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-08-24 14:50:26 +0200
committerMatthias Clasen <mclasen@redhat.com>2019-08-25 07:17:22 +0200
commit3d8f685443e6f0ddac7f3e7402169cf82ea79d88 (patch)
tree2149480517ba2afff3938b70460324b62242485a
parent321385d88cdac8ba20a43572456dd7b23a336ab9 (diff)
downloadpango-hinting.tar.gz
cairo: Adjust hinting to subpixel positioninghinting
If we are not rounding glyph positions, assume we are doing subpixel positioning, and reduce the hint style to slight hinting and turn metrics hinting off.
-rw-r--r--pango/pangocairo-context.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pango/pangocairo-context.c b/pango/pangocairo-context.c
index 5949c448..e8b8cc5d 100644
--- a/pango/pangocairo-context.c
+++ b/pango/pangocairo-context.c
@@ -321,6 +321,22 @@ _pango_cairo_context_get_merged_font_options (PangoContext *context)
cairo_font_options_merge (info->merged_options, info->surface_options);
if (info->set_options)
cairo_font_options_merge (info->merged_options, info->set_options);
+
+ if (!pango_context_get_round_glyph_positions (context))
+ {
+ switch (cairo_font_options_get_hint_style (info->merged_options))
+ {
+ case CAIRO_HINT_STYLE_DEFAULT:
+ case CAIRO_HINT_STYLE_NONE:
+ case CAIRO_HINT_STYLE_SLIGHT:
+ break;
+ case CAIRO_HINT_STYLE_MEDIUM:
+ case CAIRO_HINT_STYLE_FULL:
+ cairo_font_options_set_hint_style (info->merged_options, CAIRO_HINT_STYLE_SLIGHT);
+ break;
+ }
+ cairo_font_options_set_hint_metrics (info->merged_options, CAIRO_HINT_METRICS_OFF);
+ }
}
return info->merged_options;