*** empty log message ***
[dana/urxvt.git] / src / rxvtfont.C
index 22e677e..bdac107 100644 (file)
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *---------------------------------------------------------------------*/
 
 #include "../config.h"
@@ -132,10 +132,10 @@ const struct rxvt_fallback_font {
   { CS_UNICODE,      "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1"         },
   { CS_UNICODE,      "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1"         },
 #if XFT
-  { CS_UNICODE,      "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true"},
-  { CS_UNICODE,      "xft:Courier New:antialias=false:autohint=true" },
-  { CS_UNICODE,      "xft:Andale Mono:antialias=false"             },
-  { CS_UNICODE,      "xft:Arial Unicode MS:antialias=false"        },
+  { CS_UNICODE,      "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true" },
+  { CS_UNICODE,      "xft:Courier New:antialias=false:autohint=true"              },
+  { CS_UNICODE,      "xft:Andale Mono:antialias=false:autohint=false"             },
+  { CS_UNICODE,      "xft:Arial Unicode MS:antialias=false:autohint=false"        },
 
   // FreeMono is usually uglier than x fonts, so try last only.
   { CS_UNICODE,      "xft:FreeMono:autohint=true"                  },
@@ -718,6 +718,8 @@ rxvt_font_x11::load (const rxvt_fontprop &prop)
 
       if (replace_field (fname, list[i], 6, '0', field_str))
         diff += 10; // slightly penalize scalable fonts
+      else if (replace_field (fname, list[i], 11, '0', "0"))
+        diff += 300; // more heavily penalize what looks like scaled bitmap fotns
 
       if (!set_properties (p, fname))
         continue;
@@ -743,7 +745,7 @@ rxvt_font_x11::load (const rxvt_fontprop &prop)
       font_weight *best = fonts + count - 1;
 
       for (font_weight *w = best; w-- > fonts; )
-        if (w->diff < best->diff)
+        if (w->diff <= best->diff)
           best = w;
 
       if (!best->name
@@ -1098,7 +1100,7 @@ rxvt_font_xft::load (const rxvt_fontprop &prop)
   FcValue v;
 
   if (prop.height != rxvt_fontprop::unset
-      || (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch
+      && (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch
           && FcPatternGet (p, FC_SIZE, 0, &v) != FcResultMatch))
     FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height);