diff --git a/ChangeLog b/ChangeLog index 7cfd69e..4fdb3fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-04-15 Gregory John Casamento + * configure.in: Added check to determine if libXft contains + XftDrawStringUtf8 which is used to draw unicode strings. + 2002-04-15 Adam Fedor * Source/x11/XGServerWindow.m ([XGServer diff --git a/Source/xlib/XftFontInfo.m b/Source/xlib/XftFontInfo.m index 89989a3..94e5e82 100644 --- a/Source/xlib/XftFontInfo.m +++ b/Source/xlib/XftFontInfo.m @@ -259,6 +259,7 @@ static NSMutableDictionary *_globalFontDictionary = nil; XDestroyRegion(xregion); } +#ifdef HAVE_UTF8 /* do it */ if (NSUTF8StringEncoding == mostCompatibleStringEncoding) { @@ -266,6 +267,7 @@ static NSMutableDictionary *_globalFontDictionary = nil; xp.x, xp.y, (XftChar8 *)s, length); } else +#endif { XftDrawString8(xftdraw, &xftcolor, font_info, xp.x, xp.y, (XftChar8*)s, length); @@ -279,6 +281,7 @@ static NSMutableDictionary *_globalFontDictionary = nil; { XGlyphInfo extents; +#ifdef HAVE_UTF8 if (mostCompatibleStringEncoding == NSUTF8StringEncoding) XftTextExtentsUtf8([XGServer currentXDisplay], font_info, @@ -286,6 +289,7 @@ static NSMutableDictionary *_globalFontDictionary = nil; len, &extents); else +#endif XftTextExtents8([XGServer currentXDisplay], font_info, (XftChar8*)s, diff --git a/configure b/configure index 98026a7..819a23b 100755 --- a/configure +++ b/configure @@ -2170,7 +2170,7 @@ EOF fi #-------------------------------------------------------------------- -# Extended font support +# Extended font support & UTF8 support #-------------------------------------------------------------------- WITH_XFT=no save_header=${CPPFLAGS} @@ -2258,6 +2258,53 @@ if test "$have_xft" = yes -a "$ac_cv_header_X11_Xft_Xft_h" = yes; then #define HAVE_XFT 1 EOF + echo $ac_n "checking for XftDrawStringUtf8 in -lXft""... $ac_c" 1>&6 +echo "configure:2263: checking for XftDrawStringUtf8 in -lXft" >&5 +ac_lib_var=`echo Xft'_'XftDrawStringUtf8 | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lXft $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_utf8=yes +else + echo "$ac_t""no" 1>&6 +have_utf8=no +fi + + if test "$have_utf8" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_UTF8 1 +EOF + + fi fi CPPFLAGS="${save_header}" LIBS="${save_libs}" @@ -2322,7 +2369,7 @@ if test $gs_cv_have_wraster = no -o $set_x_paths = yes; then CPPFLAGS="${with_jpeg_library} ${with_jpeg_include} ${CPPFLAGS}" echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:2326: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:2373: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2330,7 +2377,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2364,9 +2411,9 @@ fi if test "$jpeg_ok" = yes; then echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:2368: checking for jpeglib.h" >&5 +echo "configure:2415: checking for jpeglib.h" >&5 cat > conftest.$ac_ext < #undef PACKAGE @@ -2375,7 +2422,7 @@ echo "configure:2368: checking for jpeglib.h" >&5 #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2439,7 +2486,7 @@ if test $gs_cv_have_wraster = no -o $set_x_paths = yes; then tiff_check_lib_save_libs=${LIBS} CPPFLAGS="${with_tiff_library} ${JPEG_LIB} ${with_tiff_include} ${JPEG_INCLUDE} ${CPPFLAGS}" echo $ac_n "checking for main in -lz""... $ac_c" 1>&6 -echo "configure:2443: checking for main in -lz" >&5 +echo "configure:2490: checking for main in -lz" >&5 ac_lib_var=`echo z'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2447,14 +2494,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2477,17 +2524,17 @@ fi echo $ac_n "checking for -ltiff without -ljpeg nor -lz""... $ac_c" 1>&6 -echo "configure:2481: checking for -ltiff without -ljpeg nor -lz" >&5 +echo "configure:2528: checking for -ltiff without -ljpeg nor -lz" >&5 LIBS="-ltiff -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* jpeg_notneeded=yes else @@ -2506,17 +2553,17 @@ fi if test $HAVE_LIBZ = 1; then echo $ac_n "checking for -ltiff without -lz""... $ac_c" 1>&6 -echo "configure:2510: checking for -ltiff without -lz" >&5 +echo "configure:2557: checking for -ltiff without -lz" >&5 LIBS="-ltiff $JPEG -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* libz_notneeded=yes else @@ -2534,7 +2581,7 @@ rm -f conftest* fi echo $ac_n "checking for TIFFReadScanline in -ltiff""... $ac_c" 1>&6 -echo "configure:2538: checking for TIFFReadScanline in -ltiff" >&5 +echo "configure:2585: checking for TIFFReadScanline in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFReadScanline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2542,7 +2589,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltiff $JPEG -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2577,17 +2624,17 @@ fi if test "$tiff_ok" = yes; then ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:2581: checking for tiffio.h" >&5 +echo "configure:2628: checking for tiffio.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2637,17 +2684,17 @@ save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="$CPPFLAGS $GRAPHIC_CFLAGS" ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6 -echo "configure:2641: checking for X11/extensions/XShm.h" >&5 +echo "configure:2688: checking for X11/extensions/XShm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2741,7 +2788,7 @@ fi echo $ac_n "checking Backend Server""... $ac_c" 1>&6 -echo "configure:2745: checking Backend Server" >&5 +echo "configure:2792: checking Backend Server" >&5 if test "x$enable_win32" = "xyes"; then BUILD_WIN32=yes @@ -2764,7 +2811,7 @@ EOF fi echo $ac_n "checking Backend Graphics""... $ac_c" 1>&6 -echo "configure:2768: checking Backend Graphics" >&5 +echo "configure:2815: checking Backend Graphics" >&5 if test "x$enable_winlib" = "xyes"; then BUILD_WINLIB=yes @@ -2807,7 +2854,7 @@ if test "${with_name+set}" = set; then fi echo $ac_n "checking Backend name""... $ac_c" 1>&6 -echo "configure:2811: checking Backend name" >&5 +echo "configure:2858: checking Backend name" >&5 if test "x$with_name" = "x"; then BACKEND_NAME=back else diff --git a/configure.in b/configure.in index 61827de..fd45502 100644 --- a/configure.in +++ b/configure.in @@ -185,7 +185,7 @@ if test "x$enable_xim" = "xyes"; then fi #-------------------------------------------------------------------- -# Extended font support +# Extended font support & UTF8 support #-------------------------------------------------------------------- WITH_XFT=no save_header=${CPPFLAGS} @@ -198,6 +198,10 @@ if test "$have_xft" = yes -a "$ac_cv_header_X11_Xft_Xft_h" = yes; then GRAPHIC_LIBS="-lXft ${GRAPHIC_LIBS}" WITH_XFT=yes AC_DEFINE(HAVE_XFT) + AC_CHECK_LIB(Xft, XftDrawStringUtf8, have_utf8=yes, have_utf8=no) + if test "$have_utf8" = yes; then + AC_DEFINE(HAVE_UTF8) + fi fi CPPFLAGS="${save_header}" LIBS="${save_libs}"