diff --git a/config.h.in b/config.h.in index b9c7e0c..ead1f1f 100644 --- a/config.h.in +++ b/config.h.in @@ -24,6 +24,9 @@ /* Define if you want your background to use the parent window background */ #undef ENABLE_TRANSPARENCY +/* Define if you want add space when testing character width */ +#undef ENABLE_USE_SPACE + /* Define if you want to display wide glyphs */ #undef ENABLE_WIDE_GLYPHS diff --git a/configure b/configure index 6b50a6b..a89170f 100755 --- a/configure +++ b/configure @@ -741,6 +741,7 @@ enable_font_styles enable_wide_glyphs enable_font_width enable_line_spacing +enable_use_space enable_pixbuf enable_startup_notification enable_transparency @@ -1418,6 +1419,7 @@ Optional Features: --enable-wide-glyphs enable displaying of wide glyphs --enable-font-width enable proper way to calculate character width --enable-line-spacing enable line spacing fix + --enable-use-space enable add space to extent test characters --enable-pixbuf enable integration with gdk-pixbuf for background images --enable-startup-notification enable freedesktop startup notification support --enable-transparency enable transparent backgrounds @@ -5001,6 +5003,7 @@ support_iso14755=yes support_styles=yes support_font_width=no support_line_spacing=no +support_use_space=no support_perl=yes codesets=all @@ -5034,6 +5037,7 @@ then : support_wide_glyphs=no support_font_width=no support_line_spacing=no + support_use_space=no support_perl=no codesets= fi @@ -5062,6 +5066,7 @@ then : support_wide_glyphs=yes support_font_width=yes support_line_spacing=yes + support_use_space=yes support_perl=yes codesets=all fi @@ -5205,6 +5210,15 @@ then : fi +# Check whether --enable-use-space was given. +if test ${enable_use_space+y} +then : + enableval=$enable_use_space; if test x$enableval = xyes -o x$enableval = xno; then + support_use_space=$enableval + fi +fi + + # Check whether --enable-pixbuf was given. if test ${enable_pixbuf+y} then : @@ -7719,6 +7733,11 @@ if test x$support_line_spacing = xyes; then printf "%s\n" "#define ENABLE_LINE_SPACING 1" >>confdefs.h +fi +if test x$support_use_space = xyes; then + +printf "%s\n" "#define ENABLE_USE_SPACE 1" >>confdefs.h + fi if test x$support_iso14755 = xyes; then diff --git a/configure.ac b/configure.ac index 1cffda6..f623818 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,7 @@ support_iso14755=yes support_styles=yes support_font_width=no support_line_spacing=no +support_use_space=no support_perl=yes codesets=all @@ -128,6 +129,7 @@ AC_ARG_ENABLE(everything, support_wide_glyphs=no support_font_width=no support_line_spacing=no + support_use_space=no support_perl=no codesets= fi @@ -156,6 +158,7 @@ AC_ARG_ENABLE(everything, support_wide_glyphs=yes support_font_width=yes support_line_spacing=yes + support_use_space=yes support_perl=yes codesets=all fi @@ -247,6 +250,12 @@ AC_ARG_ENABLE(line-spacing, support_line_spacing=$enableval fi]) +AC_ARG_ENABLE(use-space, + [ --enable-use-space enable add space to extent test characters], + [if test x$enableval = xyes -o x$enableval = xno; then + support_use_space=$enableval + fi]) + AC_ARG_ENABLE(pixbuf, [ --enable-pixbuf enable integration with gdk-pixbuf for background images], [if test x$enableval = xyes -o x$enableval = xno; then @@ -678,6 +687,9 @@ fi if test x$support_line_spacing = xyes; then AC_DEFINE(ENABLE_LINE_SPACING, 1, Define if you want line spacing fix) fi +if test x$support_use_space = xyes; then + AC_DEFINE(ENABLE_USE_SPACE, 1, Define if you want add space when testing character width) +fi if test x$support_iso14755 = xyes; then AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support) fi diff --git a/src/rxvtfont.C b/src/rxvtfont.C index 9420a22..27b0958 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -155,7 +155,11 @@ static const struct rxvt_fallback_font { // these characters are used to guess the font height and width // pango uses a similar algorithm and doesn't trust the font either. static uint16_t extent_test_chars[] = { +#ifdef ENABLE_USE_SPACE + ' ', '0', '1', '8', 'a', 'd', 'x', 'm', 'y', 'g', 'W', 'X', '\'', '_', +#else '0', '1', '8', 'a', 'd', 'x', 'm', 'y', 'g', 'W', 'X', '\'', '_', +#endif 0x00cd, 0x00d5, 0x0114, 0x0177, 0x0643, // ÍÕĔŷﻙ 0x304c, 0x672c, // が本 };