[cairo-commit] 2 commits - src/cairo-ft-font.c
ç½æ¶å Jinghua Luo
jinghua at kemper.freedesktop.org
Sun Jun 18 23:49:48 PDT 2006
src/cairo-ft-font.c | 61 +++++++++++++++++++++++++++-------------------------
1 files changed, 32 insertions(+), 29 deletions(-)
New commits:
diff-tree fde08da55f293cd40927c8a1d41db0e478785e8e (from c9de7b1286309fc2da1a5ea798674b528aa2eab6)
Author: Jinghua Luo <sunmoon1997 at gmail.com>
Date: Mon Jun 19 14:49:46 2006 +0800
freetype: Don't ignore antialias in some cases.
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 27c3943..0bc9f00 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1381,38 +1381,39 @@ _cairo_ft_options_merge (cairo_ft_option
if (other->base.hint_style == CAIRO_HINT_STYLE_NONE)
options->base.hint_style = CAIRO_HINT_STYLE_NONE;
- switch (options->base.hint_style) {
- case CAIRO_HINT_STYLE_NONE:
- load_flags |= FT_LOAD_NO_HINTING;
- break;
- case CAIRO_HINT_STYLE_SLIGHT:
- load_target = FT_LOAD_TARGET_LIGHT;
- break;
- case CAIRO_HINT_STYLE_MEDIUM:
- if (options->base.antialias == CAIRO_ANTIALIAS_NONE) {
- load_target = FT_LOAD_TARGET_MONO;
- load_flags |= FT_LOAD_MONOCHROME;
- }
- break;
- case CAIRO_HINT_STYLE_FULL:
- case CAIRO_HINT_STYLE_DEFAULT:
- if (options->base.antialias == CAIRO_ANTIALIAS_NONE) {
+ if (options->base.antialias == CAIRO_ANTIALIAS_NONE) {
+ if (options->base.hint_style == CAIRO_HINT_STYLE_NONE)
+ load_flags |= FT_LOAD_NO_HINTING;
+ else
load_target = FT_LOAD_TARGET_MONO;
- load_flags |= FT_LOAD_MONOCHROME;
- } else if (options->base.antialias == CAIRO_ANTIALIAS_SUBPIXEL) {
- switch (options->base.subpixel_order) {
- case CAIRO_SUBPIXEL_ORDER_DEFAULT:
- case CAIRO_SUBPIXEL_ORDER_RGB:
- case CAIRO_SUBPIXEL_ORDER_BGR:
- load_target |= FT_LOAD_TARGET_LCD;
- break;
- case CAIRO_SUBPIXEL_ORDER_VRGB:
- case CAIRO_SUBPIXEL_ORDER_VBGR:
- load_target |= FT_LOAD_TARGET_LCD_V;
+ load_flags |= FT_LOAD_MONOCHROME;
+ } else {
+ switch (options->base.hint_style) {
+ case CAIRO_HINT_STYLE_NONE:
+ load_flags |= FT_LOAD_NO_HINTING;
+ break;
+ case CAIRO_HINT_STYLE_SLIGHT:
+ load_target = FT_LOAD_TARGET_LIGHT;
+ break;
+ case CAIRO_HINT_STYLE_MEDIUM:
+ break;
+ case CAIRO_HINT_STYLE_FULL:
+ case CAIRO_HINT_STYLE_DEFAULT:
+ if (options->base.antialias == CAIRO_ANTIALIAS_SUBPIXEL) {
+ switch (options->base.subpixel_order) {
+ case CAIRO_SUBPIXEL_ORDER_DEFAULT:
+ case CAIRO_SUBPIXEL_ORDER_RGB:
+ case CAIRO_SUBPIXEL_ORDER_BGR:
+ load_target |= FT_LOAD_TARGET_LCD;
+ break;
+ case CAIRO_SUBPIXEL_ORDER_VRGB:
+ case CAIRO_SUBPIXEL_ORDER_VBGR:
+ load_target |= FT_LOAD_TARGET_LCD_V;
break;
+ }
}
+ break;
}
- break;
}
options->load_flags = load_flags | load_target;
diff-tree c9de7b1286309fc2da1a5ea798674b528aa2eab6 (from e4736fcf76855c7ca5c9e8b922622dfffe08e4e1)
Author: Jinghua Luo <sunmoon1997 at gmail.com>
Date: Mon Jun 19 14:17:24 2006 +0800
freetype: Compare all elements in ft_options but not use memcmp.
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 3bcfb9f..27c3943 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2132,7 +2132,9 @@ _cairo_ft_font_face_create (cairo_ft_uns
font_face;
font_face = font_face->next)
{
- if (!memcmp (&font_face->ft_options, &ft_options, sizeof (cairo_ft_options_t)))
+ if (font_face->ft_options.load_flags == ft_options.load_flags &&
+ font_face->ft_options.extra_flags == ft_options.extra_flags &&
+ cairo_font_options_equal (&font_face->ft_options.base, &ft_options.base))
return cairo_font_face_reference (&font_face->base);
}
More information about the cairo-commit
mailing list