From 501e5cc8839e104ec21a5aba61cff3580d34f26b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 8 Aug 2006 06:12:13 -0400 Subject: Restructure subpixel_order handling such that the code doesn't look suspicious! Shouldn't make /any/ difference at all in any case. --- src/cairo-ft-font.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index ca78d62ca..daa9e9de8 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -1233,6 +1233,8 @@ _get_pattern_ft_options (FcPattern *pattern) antialias = FcTrue; if (antialias) { + cairo_subpixel_order_t subpixel_order; + if (!bitmap) ft_options.load_flags |= FT_LOAD_NO_BITMAP; @@ -1247,25 +1249,28 @@ _get_pattern_ft_options (FcPattern *pattern) switch (rgba) { case FC_RGBA_RGB: - ft_options.base.subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB; + subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB; break; case FC_RGBA_BGR: - ft_options.base.subpixel_order = CAIRO_SUBPIXEL_ORDER_BGR; + subpixel_order = CAIRO_SUBPIXEL_ORDER_BGR; break; case FC_RGBA_VRGB: - ft_options.base.subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB; + subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB; break; case FC_RGBA_VBGR: - ft_options.base.subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR; + subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR; break; case FC_RGBA_UNKNOWN: case FC_RGBA_NONE: default: + subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT; break; } - if (ft_options.base.subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT) + if (subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT) { + ft_options.base.subpixel_order = subpixel_order; ft_options.base.antialias = CAIRO_ANTIALIAS_SUBPIXEL; + } #ifdef FC_HINT_STYLE if (FcPatternGetInteger (pattern, -- cgit v1.2.1