diff -urN xc.orig/lib/Xft/xftfreetype.c xc/lib/Xft/xftfreetype.c --- xc.orig/lib/Xft/xftfreetype.c 2004-03-11 18:07:26.000000000 -0500 +++ xc/lib/Xft/xftfreetype.c 2004-03-13 22:45:40.000000000 -0500 @@ -372,7 +372,7 @@ double dsize; double aspect; FcMatrix *font_matrix; - FcBool hinting, vertical_layout, autohint, global_advance; + FcBool hinting, vertical_layout, autohint, global_advance, prefer_bitmaps; #ifdef FC_HINT_STYLE int hint_style; #endif @@ -496,15 +496,30 @@ else fi->render = FcFalse; + switch (FcPatternGetBool (pattern, "rh_prefer_bitmaps", 0, &prefer_bitmaps)) { + case FcResultNoMatch: + prefer_bitmaps = True; + break; + case FcResultMatch: + break; + default: + goto bail1; + } + /* * Compute glyph load flags */ fi->load_flags = FT_LOAD_DEFAULT; - - /* disable bitmaps when anti-aliasing or transforming glyphs */ - if (fi->antialias || fi->transform) - fi->load_flags |= FT_LOAD_NO_BITMAP; + /* disable bitmaps when anti-aliasing or transforming glyphs */ + /* Generally, we want to prefer bitmaps when we have them, + * even when antialiasing, because they make Han characters + * more legible. But for Japanese, we want to make the + * opposite choice, so it's controlled through fonts.conf. + */ + if ((fi->antialias && !prefer_bitmaps) || fi->transform) + fi->load_flags |= FT_LOAD_NO_BITMAP; + /* disable hinting if requested */ switch (FcPatternGetBool (pattern, FC_HINTING, 0, &hinting)) { case FcResultNoMatch: