Informative patch to xft-sjt branch
Fixes crash in Label widget and problems with building without Xft.
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/ChangeLog,v
retrieving revision 1.418
diff -u -r1.418 ChangeLog
--- ChangeLog 14 Nov 2004 12:31:09 -0000 1.418
+++ ChangeLog 10 Dec 2004 03:34:47 -0000
@@ -0,0 +1,11 @@
+2004-12-10 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.usage: Various minor improvements.
+
+2004-12-09 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.in: Update FSF's copyright. Support --with-xft=LIST
+ syntax. Try to find a directory containing freetype/ftheader.h.
+
+ * configure.usage (--with-xft): Update.
+
Index: lwlib/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.64.2.1
diff -u -r1.64.2.1 ChangeLog
--- lwlib/ChangeLog 3 Dec 2004 07:40:58 -0000 1.64.2.1
+++ lwlib/ChangeLog 10 Dec 2004 03:34:50 -0000
@@ -0,0 +1,21 @@
+2004-12-10 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * lwlib-Xaw.c (xaw_create_button):
+ (xaw_create_progress):
+ (xaw_create_text_field):
+ Changed XtCreateManagedWidget to XtCreateWidget when child is
+ managed later in the same function.
+
+ (debug_gauge): New variable.
+ (lw_debug_print_xt_arglist):
+ (lw_debug_print_class_resources):
+ New debug functions.
+
+2004-12-09 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * xlwmenu.c (xlwMenuResources): Use "redundant" XftFont resource.
+
+ * xlwtabs.c:
+ * xlwtabsP.h:
+ Use USE_XFT_TABS consistently.
+
Index: man/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/ChangeLog,v
retrieving revision 1.269
diff -u -r1.269 ChangeLog
--- man/ChangeLog 16 Nov 2004 07:37:29 -0000 1.269
+++ man/ChangeLog 10 Dec 2004 03:34:53 -0000
@@ -0,0 +1,19 @@
+2004-11-26 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * internals/internals.texi (Better Rendering Support --
+ Configuration with the Interim Patches):
+ Add documentation of X resources, especially for GUI elements.
+ (Better Rendering Support -- Implementation):
+ More comments about specification and design issues.
+ (Better Rendering Support -- Current Status):
+ New subsubsection "Bugs Reported in sjt-xft".
+
+2004-11-26 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * internals/internals.texi (Future Work -- Better Rendering Support):
+ New node.
+ (Top):
+ (Future Work):
+ (Future Work -- Lisp Engine Replacement):
+ Add pointers to new node.
+
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.758.2.1
diff -u -r1.758.2.1 ChangeLog
--- src/ChangeLog 27 Nov 2004 05:56:00 -0000 1.758.2.1
+++ src/ChangeLog 10 Dec 2004 03:35:20 -0000
@@ -0,0 +1,26 @@
+2004-12-10 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * redisplay-x.c (x_text_width_single_run): Whitespace improvement.
+
+2004-12-09 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * glyphs-widget.c (image_instantiator_progress_gauge):
+ (image_instantiator_format_create_glyphs_widget):
+ Fix typo guage->gauge.
+
+ * emacs.c (main_1): Casting out devils (size_t).
+
+ * compiler.h (USED_IF_XFT): New variant.
+ * objects-x.c (x_font_spec_matches_charset):
+ * redisplay-x.c (x_text_width_single_run):
+ Use it.
+
+ * config.h.in: Support USE_XFT_TABS and USE_XFT_GAUGE.
+
+2004-11-28 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c (x_initialize_font_instance): Make sure
+ FONT_INSTANCE_X_FONT is cleared for Xft fonts. Add comments.
+ Fiddle whitespace.
+ (x_print_font_instance): Clarify printed font instance.
+
Index: configure.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.in,v
retrieving revision 1.233.2.1
diff -u -r1.233.2.1 configure.in
--- configure.in 25 Nov 2004 12:43:52 -0000 1.233.2.1
+++ configure.in 10 Dec 2004 03:34:49 -0000
@@ -3,7 +3,7 @@
[#### Configuration script for XEmacs. Largely divergent from FSF.
#### Guess values for system-dependent variables and create Makefiles.
#### Generated automatically using autoconf version] AC_ACVERSION [
-#### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+#### Copyright (C) 1992-2004 Free Software Foundation, Inc.
#### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
#### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
#### Copyright (C) 1995, 1996, 2002, 2003, 2004 Ben Wing.
@@ -373,7 +373,10 @@
need_modules_common=''
with_menubars=''
dnl These conflict, try to detect incompatibility early
-with_xft_menubars='no'
+with_xft_emacs='yes'
+with_xft_menubars='yes'
+with_xft_tabs='yes'
+with_xft_gauge='yes'
with_xfs='no'
with_scrollbars=''
with_widgets=''
@@ -533,7 +536,6 @@
with_hesiod | \
with_dnet | \
with_infodock | \
- with_xft | \
with_netinstall | \
with_ipv6_cname | \
external_widget | \
@@ -838,9 +840,6 @@
l | lu | luc | luci | lucid ) val=lucid ;;
mo | mot | moti | motif ) val=motif ;;
a | at | ath | athe | athen | athena ) val=athena ;;
- dnl not in xft reloaded #3
- dnl #### for menubars only; rethink this interface
- x | xf | xft ) val=xft ;;
n | no | non | none ) val=no ;;
y | ye | yes ) val=yes ;;
dnl Explicit --with-widgets on command line means yes.
@@ -853,6 +852,51 @@
eval "$opt=\"$val\""
;;
+ dnl Has the user requested Xft support?
+ dnl Borrowed from the sound code
+ dnl not in xft reloaded #3
+ "with_xft" )
+ dnl values is a subset of all,emacs,menubars,tabs,gauge
+ dnl or their negatives: none,noemacs,nomenubars,notabs,nogauge
+ for x in `echo "$val" | sed -e 's/,/ /g'` ; do
+ case "$x" in
+ dnl all and none are only permitted as the first in the list.
+ n | no | non | none ) new_fdefault=no ;;
+ a | al | all | both ) new_fdefault=yes ;;
+
+ emacs ) with_xft_emacs=yes ;;
+ # noemacs makes no sense
+
+ menubars ) with_xft_menubars=yes with_xft_emacs=yes ;;
+ nomenubars ) with_xft_menubars=no ;;
+
+ tabs ) with_xft_tabs=yes with_xft_emacs=yes ;;
+ notabs ) with_xft_tabs=no ;;
+
+ gauge ) with_xft_gauge=yes with_xft_emacs=yes ;;
+ nogauge ) with_xft_gauge=no ;;
+
+ * ) bogus_xft=yes ;;
+ esac
+ if test "$bogus_xft" -o \
+ \( -n "$new_fdefault" -a -n "$xft_notfirst" \) ; then
+ types="\`all', \`none', \`(no)menubars', \`no(tabs)', \`(no)gauge', \`emacs'."
+ USAGE_ERROR(["Valid types for the \`--$optname' option are:
+ $types.
+Option \`all' or \`none' must be first in the list.
+All of \`menubars', \`tabs', and \`gauge' force \`emacs' (buffer text) on.
+Use \`none,emacs' to have only the buffer text supporting Xft."])
+ elif test -n "$new_fdefault" ; then
+ with_xft_emacs=$new_fdefault
+ with_xft_menubars=$new_fdefault
+ with_xft_tabs=$new_fdefault
+ with_xft_gauge=$new_fdefault
+ new_fdefault= # reset this
+ fi
+ xft_notfirst=true
+ done
+ ;;
+
dnl Obsolete legacy argument? Warn, but otherwise ignore.
"use_minimal_tagbits" | \
"use_indexed_lrecord_implementation" | \
@@ -881,7 +925,7 @@
dnl Check for incompatible settings
dnl -------------------------------
-if test "$with_xfs" = "yes" -a "$with_menubars" = "xft"; then
+if test "$with_xfs" = "yes" -a "$with_xft_menubars" = "yes"; then
USAGE_ERROR("XFS and Xft in the menubars are incompatible!")
fi
@@ -3249,7 +3293,22 @@
dnl include xft/AA support?
dnl #### need to check for includes here (especially, freetype.h for v.2)
- if test "$with_xft" = "yes"; then
+ if test "$with_xft_emacs" = "yes"; then
+ AC_CHECKING([for Xrender, fontconfig, and Xft])
+ xft_includes_found=no
+ AC_CHECK_HEADER(freetype/config/ftheader.h,xft_includes_found=yes)
+
+ dnl do this for /usr/include, /sw/include, and /opt/local/include, too?
+ freetype_include_top="/usr/X11R6/include/freetype2"
+ if test "$xft_includes_found" = "no" -a "$with_xft_emacs" != "no" -a \
+ -d $freetype_include_top; then
+ save_c_switch_site="$c_switch_site"
+ c_switch_site="$c_switch_site -I$freetype_include_top"
+ AC_CHECK_HEADER(freetype/config/ftheader.h,xft_includes_found=yes)
+ if test "$xft_includes_found" != "yes"; then
+ XE_DIE(["Unable to find headers for --with-xft"])
+ fi
+ fi
AC_CHECK_LIB(Xrender, XRenderQueryExtension, XE_PREPEND(-lXrender, libs_x),
[XE_DIE(["Unable to find libXrender for --with-xft"])])
AC_CHECK_LIB(fontconfig, FcPatternCreate, XE_PREPEND(-lfontconfig, libs_x),
@@ -4022,13 +4081,13 @@
with_menubars="lucid" ;;
esac
-dnl "$with_menubars" = "xft"
dnl this is not in xft reloaded #3
-if test "$with_menubars" = "xft" ; then
- if test "$with_xft" = "yes" ; then
+if test "$with_xft_menubars" != "no" ; then
+ if test "$with_xft_emacs" = "yes" -a "$with_menubars" != "no" ; then
with_xft_menubars="yes"
+ else
+ with_xft_menubars="no"
fi
- with_menubars="lucid"
fi
case "$with_dialogs" in "" | "yes" | "lucid" )
@@ -4049,6 +4108,24 @@
fi ;;
esac
+dnl this is not in xft reloaded #3
+if test "$with_xft_tabs" != "no" ; then
+ if test "$with_xft_emacs" = "yes" -a "$with_widgets" != "no" ; then
+ with_xft_tabs="yes"
+ else
+ with_xft_tabs="no"
+ fi
+fi
+
+dnl this is not in xft reloaded #3
+if test "$with_xft_gauge" != "no" ; then
+ if test "$with_xft_emacs" = "yes" -a "$with_widgets" != "no" ; then
+ with_xft_gauge="yes"
+ else
+ with_xft_gauge="no"
+ fi
+fi
+
all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
case "$all_widgets" in
@@ -4138,6 +4215,9 @@
dnl this is not in xft reloaded #3
test "$with_xft_menubars" = "yes" && AC_DEFINE(USE_XFT_MENUBARS)
+dnl these are new in sjt-xft
+test "$with_xft_tabs" = "yes" && AC_DEFINE(USE_XFT_TABS)
+test "$with_xft_gauge" = "yes" && AC_DEFINE(USE_XFT_GAUGE)
dnl ----------------------
dnl Mule-dependent options
@@ -5565,6 +5645,17 @@
athena ) echo " Using Athena native widgets." ;;
msw ) echo " Using MS-Windows native widgets." ;;
esac
+dnl this is not in xft reloaded #3
+if test "$with_xft_tabs" = "yes"; then
+ echo " - Using Xft to render antialiased fonts in tab controls."
+ echo " WARNING: This feature will be replaced with a face."
+fi
+dnl this is not in xft reloaded #3
+if test "$with_xft_gauge" = "yes"; then
+ echo " - Using Xft to render antialiased fonts in progress bars."
+ echo " WARNING: This feature will be replaced with a face."
+ echo " WARNING: This feature not yet implemented; setting ignored."
+fi
if test "$with_dragndrop" = yes; then
echo " Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
echo " - Drag'n'Drop prototype: $dragndrop_proto."
Index: configure.usage
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.usage,v
retrieving revision 1.36.2.1
diff -u -r1.36.2.1 configure.usage
--- configure.usage 25 Nov 2004 12:43:53 -0000 1.36.2.1
+++ configure.usage 10 Dec 2004 03:34:49 -0000
@@ -2,10 +2,10 @@
Set compilation and installation parameters for XEmacs, and report.
-Note that for most of the following options, you can explicitly enable
-them using `--OPTION=yes' and explicitly disable them using `--OPTION=no'.
-This is especially useful for auto-detected options.
-The option `--without-FEATURE' is a synonym for `--with-FEATURE=no'.
+You can explicitly enable most of the following options using `--OPTION=yes'
+and explicitly disable them using `--OPTION=no'. This is especially useful
+for auto-detected options. The option `--without-FEATURE' is a synonym for
+`--with-FEATURE=no'.
Options marked with a (*) are auto-detected.
@@ -40,8 +40,8 @@
all default compiler flags except those that control
warnings.
--cflags-warning=FLAGS Override compiler flags used to control warnings.
- Normally, don't set this, as XEmacs already turns on
- the maximum safe warning level.
+ Normally, use configure's defaults, and report
+ warnings as bugs to xemacs-beta(a)xemacs.org.
--cpp=PROG C preprocessor to use (e.g. /usr/ccs/lib/cpp or cc -E)
--cppflags=FLAGS C preprocessor flags (e.g. -I/foo or -Dfoo=bar)
--libs=LIBS Additional libraries (e.g. -lfoo)
@@ -53,7 +53,7 @@
'site-libraries'
--site-runtime-libraries=PATH
List of ALL directories to search for dynamically
- linked libraries at run time
+ linked libraries at run time.
--dynamic=yes Link dynamically if supported by system.
--dynamic=no Force static linking on systems where dynamic
linking is the default.
@@ -85,33 +85,33 @@
--docdir=DIR
--moduledir=DIR
You may also control individually where various
- parts of XEmacs are installed. Note that we
- recommend against explicitly setting any of these
- variables. See the INSTALL file for a complete list
+ parts of XEmacs are installed. We recommend that you
+ accept configure's computed defaults for all of these
+ variables. See the INSTALL file for descriptions
plus the reasons we advise not changing them.
Run-time path-searching options:
--------------------------------
---with-site-lisp=yes Allow for a site-lisp directory in the XEmacs hierarchy
- searched before the installation packages.
+--with-site-lisp=yes Enable the formerly standard site-lisp directory in
+ the XEmacs hierarchy. It precedes the installation
+ packages in `load-path'. Now deprecated, with
+ installation of site LISP in the site-packages
+ hierarchy recommended.
--with-site-modules=no Disable site-modules directory in the XEmacs hierarchy,
which is searched before the installation modules.
---package-path=PATH Directories to search for packages to dump with xemacs.
- PATH splits into three parts separated by double
- colons (::), an early, a late, and a last part,
- corresponding to their position in the various
- system paths: The early part is always first,
- the late part somewhere in the middle, and the
- last part at the very back.
- Only the late part gets seen at dump time.
+--package-path=PATH Directories to search for LISP packages.
+ PATH has three parts separated by double colons (::),
+ early, late, and last. Only the late part gets seen
+ at dump time. Use of the "last" component should be
+ avoided.
If PATH has only one component, that component
is late.
If PATH has two components, the first is
early, the second is late.
---infopath=PATH Directories to search for Info documents, info dir
- and localdir files in case run-time searching
+--infopath=PATH Fallback directories to search for Info documents,
+ info dir and localdir files when run-time searching
for them fails.
@@ -134,7 +134,6 @@
widgets emulate Motif (mostly) but are faster.
*WARNING* The Motif menubar is currently broken.
Lucid menubars are the default.
- *Experimental* (xft). Xft menubar, requires --with-xft
--with-scrollbars=TYPE Use TYPE scrollbars (lucid, motif, athena, or no).
Lucid scrollbars are the default.
--with-dialogs=TYPE Use TYPE dialog boxes (lucid, motif, athena, or no).
@@ -159,6 +158,14 @@
unpredictable.
--with-xmu=no (*) For those unfortunates whose vendors don't ship Xmu.
--external-widget Compile with external widget support.
+--with-xft=TYPE[,TYPE[,...]] Compile with support for Xft. Valid types are
+ emacs (ie, in the text buffer), menubars, tabs, and
+ gauge (currently unsupported), and all and none.
+ *WARNING* This interface is UNSTABLE. `all' and
+ `none' should continue to be accepted
+ indefinitely, but the other types may
+ change WITHOUT NOTICE.
+ Non-nil values are incompatible with --with-xfs.
TTY (character terminal) options:
@@ -166,29 +173,23 @@
--with-tty=no Don't support ttys.
--with-ncurses (*) Use the ncurses library for tty support.
---with-gpm (*) Compile in GPM mouse support for ttys.
+--with-gpm (*) Support mouse pointer on ttys. Requires libgpm.
Image options:
--------------
---with-xpm (*) Compile with support for XPM images. PRACTICALLY
- REQUIRED. Although this library is nonstandard and
- a real hassle to build, many basic things (e.g.
- toolbars) depend on it, and you will run into
- many problems without it.
---with-png (*) Compile with support for PNG images. Recommended
- because the images on the About page are not viewable
- without it.
---with-jpeg (*) Compile with support for JPEG images. Useful if
- you are using a mail, news reader, or web browser
- in XEmacs, so that JPEG images can be displayed.
---with-tiff (*) Compile with support for TIFF images. Possibly
- useful, for the same reason as JPEG images.
---with-xface (*) Compile with support for X-Face mail headers.
- Requires the compface package. Of doubtful
- usefulness.
---with-gif=no Compile without the (builtin) support for GIF images.
+--with-xpm (*) Support display of XPM images. PRACTICALLY REQUIRED.
+ Many basic things (e.g. toolbars) depend on it, and
+ you will run into many problems without it.
+ Requires libXpm, not standard in older X11s.
+--with-png (*) Support display of PNG images. Recommended;
+ the About page uses PNG images. Requires libpng.
+--with-jpeg (*) Support display of JPEG images. Requires libjpeg.
+--with-tiff (*) Support display of TIFF images. Requires libtiff.
+--with-xface (*) Support display of X-Face mail headers.
+ Requires compface.
+--with-gif=no Disable builtin support for GIF images.
Sound options:
@@ -202,36 +203,34 @@
Later options override earlier ones for the same TYPE.
The default is to autodetect all sound support except
for ESD which defaults to off.
---native-sound-lib=LIB Native sound support library. Needed on Suns
- with `--with-sound=native,nas' because both sound
- libraries are called libaudio.
+--native-sound-lib=LIB Native sound support library. For Suns with
+ `--with-sound=native,nas' because both sound libraries
+ are called libaudio.
Internationalization options:
-----------------------------
---with-mule Compile with Mule (MUlti-Lingual Emacs) support,
- needed to support non-Latin-1 (including Asian)
- languages.
---with-xim=xlib Compile with support for X input methods,
---with-xim=motif (*) Used in conjunction with Mule support.
- Use either raw Xlib to provide XIM support, or
- the Motif XmIm* routines (when available).
+--with-mule Enable MUlti-Lingual Extensions to Emacs.
+ Supported interface for input and display of languages
+ not supportable with ISO 8859/1.
+--with-xim=xlib Support the X Input Method protocol with Mule.
+--with-xim=motif (*) `xlib' uses raw Xlib to provide XIM support. `motif'
+ uses the Motif XmIm* routines (when available).
NOTE: On some systems bugs in X11's XIM support
will cause XEmacs to crash, so by default,
no XIM support is compiled in, unless running
on Solaris and the XmIm* routines are detected.
---with-canna (*) Compile with support for Canna (a Japanese input method
- used in conjunction with Mule support).
---with-wnn (*) Compile with support for Wnn (a multi-language input
- method used in conjunction with Mule support).
---with-wnn6 (*) Compile with support for the commercial package Wnn6.
+--with-canna (*) Enable "native" support of Japanese input via Canna.
+ Requires libcanna.
+--with-wnn (*) Enable "native" support of Japanese input via Wnn.
+ Requires libwnn (from the FreeWnn project).
+--with-wnn6 (*) Enable "native" support of Japanese input via Wnn6.
+ Requires libwnn6, a commercial package from Omron.
--with-i18n3 Compile with I18N level 3 (support for message
- translation). This doesn't currently work.
---with-xfs Compile with XFontSet support for internationalized
- menubar. Incompatible with `--with-xim=motif'.
- `--with-menubars=lucid' (the default) is desirable.
-
+ translation). CURRENTLY BROKEN.
+--with-xfs Enable XFontSet support for localized menubar.
+ Incompatible with `--with-xim=motif' and `--with-xft'.
File-related options:
---------------------
@@ -281,6 +280,11 @@
Memory allocation options:
--------------------------
+--pdump Portable, relocatable dumper. Now stable, and
+ recommended for use on all platforms. It is the
+ default on most platforms now.
+--with-modules (*) Compile in experimental support for dynamically
+ loaded libraries (Dynamic Shared Objects).
--rel-alloc Use the relocating allocator (default for this option
is system-dependent).
--with-dlmalloc Control usage of Doug Lea malloc on systems that have
@@ -290,12 +294,16 @@
--with-debug-malloc Use the debugging malloc package.
-Emacs Lisp options:
--------------------
+Emacs LISP extension options:
+-----------------------------
--use-number-lib=TYPE Compile in support for bignums, ratios, or bigfloats
using library support. TYPE must be one of "gmp"
(for GNU MP), "mp" (for BSD MP), or "no" (disabled).
+ GNU MP is recommended over BSD MP.
+ *WARNING* The meaning of existing valid programs will
+ change on some data. Almost always this is
+ desirable, but there are a few subtle cases.
Debugging options:
@@ -317,25 +325,23 @@
XEmacs will still work (more or less) without them.
Potentially dangerous if you don't know what you're
doing. This (1) doesn't garbage-collect after loading
- each file during dumping, (2) doesn't
- automatically rebuild the DOC file (remove it by hand
- to get it rebuilt), (3) Removes config.h, lisp.h and
- associated files from the dependency lists, so changes
- to these files don't automatically cause all .c files
- to be rebuilt.
+ each file during dumping, (2) doesn't automatically
+ rebuild the DOC file (remove it by hand to get it
+ rebuilt), (3) Removes config.h, lisp.h and associated
+ files from the dependency lists, so changes to these
+ files will not force all .c files to be rebuilt.
--use-union-type Enable or disable use of a union, instead of an
int, for the fundamental Lisp_Object type; this
- provides stricter type-checking. WARNING: This has
- a tendency to trigger compiler bugs, especially in
+ provides stricter type-checking. *WARNING* This has
+ a history of triggering compiler bugs, especially in
combination with other features that increase the
complexity of expressions, for example `--with-mule'
and `--error-checking=all'. Crashes have been
- observed with union type in combination with the
- two options just mentioned under various versions of
- GCC as well as MSVC++ 6.0. Furthermore, many
- debuggers have problems (i.e. bugs) dealing with
- unions, and even for those that don't, debugging can
- be inconvenient because of no syntax for entering a
+ observed with union type in combination with the two
+ options just mentioned under various versions of GCC
+ as well as MSVC++ 6.0. Furthermore, many debuggers
+ handle unions incorrectly, and those that do display
+ them correctly may lack any syntax for entering a
union. We recommend `--use-union-type' *ONLY* for
testing purposes, not for production builds. If you
are using `-use-union-type' and get some weird
@@ -349,15 +355,7 @@
--with-workshop Support the Sun WorkShop (formerly Sparcworks)
development environment.
---pdump New, portable, relocatable dumper. Currently works
- quite well, somewhere in beta-to-late-beta, we
- might say. (Infamous for being the former
- "experimental, don't-sue-me-if-your-house-collapses-
- and-your-wife-leaves-you" portable dumper.)
--use-kkcc Enable the use of new GC algorithms. (EXPERIMENTAL)
---with-modules (*) Compile in experimental support for dynamically
- loaded libraries (Dynamic Shared Objects).
---with-xft Antialiased Fonts via Xft
If successful, configure leaves its status in config.status. If
Index: lwlib/lwlib-Xaw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-Xaw.c,v
retrieving revision 1.11
diff -u -r1.11 lwlib-Xaw.c
--- lwlib/lwlib-Xaw.c 20 Sep 2004 19:19:16 -0000 1.11
+++ lwlib/lwlib-Xaw.c 10 Dec 2004 03:34:50 -0000
@@ -52,6 +52,7 @@
static void xaw_generic_callback (Widget, XtPointer, XtPointer);
+extern int debug_xft;
Boolean
lw_xaw_widget_p (Widget widget)
@@ -738,7 +739,7 @@
lw_add_value_args_to_args (val, al, &ac);
if (!val->call_data)
- button = XtCreateManagedWidget (val->name, labelWidgetClass,
+ button = XtCreateWidget (val->name, labelWidgetClass,
instance->parent, al, ac);
else
@@ -746,20 +747,21 @@
if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
{
XtSetArg (al [ac], XtNstate, val->selected); ac++;
- button = XtCreateManagedWidget
+ button = XtCreateWidget
(val->name,
val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
instance->parent, al, ac);
}
else
{
- button = XtCreateManagedWidget (val->name, commandWidgetClass,
+ button = XtCreateWidget (val->name, commandWidgetClass,
instance->parent, al, ac);
}
XtRemoveAllCallbacks (button, XtNcallback);
XtAddCallback (button, XtNcallback, xaw_generic_callback, (XtPointer)instance);
}
+ /* #### this maybe can be folded into the XtCreateWidget calls above */
XtManageChild (button);
return button;
@@ -788,7 +790,8 @@
label = XtCreateManagedWidget (val->name, labelWidgetClass,
parent, al, ac);
- /* Do it again for arguments that have no effect until the widget is realized. */
+ /* Do it again for arguments that have no effect until the widget is realized.
+ #### Uh, but the widget isn't realized until later? Do we mean "created"? */
ac = 0;
lw_add_value_args_to_args (val, al, &ac);
if (ac > 20)
@@ -798,6 +801,60 @@
return label;
}
+static int debug_gauge = 1;
+
+static void
+lw_debug_print_xt_arglist (ArgList al, int ac)
+{
+ int i;
+ for (i = 0; i < ac; i++)
+ fprintf (stderr, "Widget has arg of type %s with value %lu.\n",
+ al[i].name, (unsigned long) al[i].value);
+}
+
+static void
+lw_debug_print_class_resources (WidgetClass class_)
+{
+ Cardinal i;
+ do {
+ Cardinal m, n = class_->core_class.num_resources;
+ XtResourceList rl;
+ fprintf (stderr, "Class is %s (%p/%p) with %d resources.\n",
+ class_->core_class.class_name, class_, &(class_->core_class), n);
+ fprintf (stderr, " Class's resources are at %p. Converting...\n",
+ class_->core_class.resources);
+ /* resources may be compiled to an internal format */
+ XtGetResourceList (class_, &rl, &m);
+ for (i = 0; i < m; i++)
+ fprintf (stderr,
+ " Class has a %s resource of type %s initialized from %s.\n",
+ rl[i].resource_class, rl[i].resource_type, rl[i].default_type);
+ /* special cases for commonly problematic resources */
+ for (i = 0; i < m; i++)
+ {
+ if (!strcmp (rl[i].resource_class, "Font"))
+ {
+ fprintf (stderr, " Class has a Font resource.\n");
+ fprintf (stderr, " Font resource is %s.\n",
+ (char *) rl[i].default_addr);
+ }
+ if (!strcmp (rl[i].resource_class, "FontSet"))
+ {
+ fprintf (stderr, " Class has a FontSet resource.\n");
+ fprintf (stderr, " FontSet resource is %s.\n",
+ (char *) rl[i].default_addr);
+ }
+ if (!strcmp (rl[i].resource_class, "International"))
+ {
+ fprintf (stderr, " Class has an International resource.\n");
+ fprintf (stderr, " International resource is %d.\n",
+ (int) rl[i].default_addr);
+ }
+ }
+ class_ = class_->core_class.superclass;
+ } while (class_ != NULL);
+}
+
static Widget
xaw_create_progress (widget_instance *instance)
{
@@ -826,12 +883,20 @@
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
- scale = XtCreateManagedWidget (val->name, gaugeWidgetClass,
- instance->parent, al, ac);
+ if (debug_gauge > 1)
+ lw_debug_print_class_resources (gaugeWidgetClass);
+ if (debug_gauge > 0)
+ lw_debug_print_xt_arglist (al, ac);
+
+ scale = XtCreateWidget (val->name, gaugeWidgetClass,
+ instance->parent, al, ac);
+
/* add the callback */
if (val->call_data)
- XtAddCallback (scale, XtNgetValue, xaw_generic_callback, (XtPointer)instance);
+ XtAddCallback (scale, XtNgetValue, xaw_generic_callback,
+ (XtPointer) instance);
+ /* #### this maybe can be folded into the XtCreateWidget call above */
XtManageChild (scale);
return scale;
@@ -864,7 +929,7 @@
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
- text = XtCreateManagedWidget (val->name, asciiTextWidgetClass,
+ text = XtCreateWidget (val->name, asciiTextWidgetClass,
instance->parent, al, ac);
/* add the callback */
Index: lwlib/lwlib-colors.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/Attic/lwlib-colors.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 lwlib-colors.c
--- lwlib/lwlib-colors.c 25 Nov 2004 12:44:04 -0000 1.1.2.1
+++ lwlib/lwlib-colors.c 10 Dec 2004 03:34:50 -0000
@@ -33,7 +33,7 @@
#include <X11/ShellP.h> /* for ShellWidget */
#include "lwlib-colors.h"
-extern int debug_xft;
+static int debug_colors = 1;
#ifdef __cplusplus
#define X_CLASSFIELD c_class
@@ -64,14 +64,15 @@
}
if (*visual == CopyFromParent || !*visual)
{
- if (debug_xft)
+ if (debug_colors > 1)
fprintf (stderr, "\nvisual_info_from_widget:"
" failed, using DefaultVisualOfScreen");
*visual = DefaultVisualOfScreen (XtScreen (widget));
/* #### Why doesn't DefaultDepth0fScreen work here? */
- *depth = DefaultDepth (XtDisplay (widget), 0);
+ /* *depth = DefaultDepth (XtDisplay (widget), 0); */
+ *depth = DefaultDepthOfScreen (XtScreen (widget));
}
- else if (debug_xft)
+ else if (debug_colors > 1)
fprintf (stderr, "\nvisual_info_from_widget: succeeded");
}
Index: lwlib/xlwmenu.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwmenu.c,v
retrieving revision 1.37.2.1
diff -u -r1.37.2.1 xlwmenu.c
--- lwlib/xlwmenu.c 25 Nov 2004 12:44:06 -0000 1.37.2.1
+++ lwlib/xlwmenu.c 10 Dec 2004 03:34:51 -0000
@@ -90,13 +90,12 @@
*fontList resource set, or at least know how to deal with this. */
XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"},
#else
-#ifdef USE_XFT_MENUBARS
- {XtNfont, XtCFont, XtRString, sizeof (String),
- offset(menu.renderFontSpec),
- XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"},
-#else
{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"},
+#ifdef USE_XFT_MENUBARS
+ {XtNxftFont, XtCXftFont, XtRString, sizeof (String),
+ offset(menu.renderFontSpec),
+ XtRString, (XtPointer) "Helvetica-12:bold"},
#endif
# ifdef USE_XFONTSET
/* #### Consider using the same method as for Motif; see the comment in
Index: lwlib/xlwmenuP.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwmenuP.h,v
retrieving revision 1.4.20.1
diff -u -r1.4.20.1 xlwmenuP.h
--- lwlib/xlwmenuP.h 25 Nov 2004 12:44:06 -0000 1.4.20.1
+++ lwlib/xlwmenuP.h 10 Dec 2004 03:34:51 -0000
@@ -32,11 +32,11 @@
XmFontList font_list_2;
XmFontList fallback_font_list;
#else
+ XFontStruct * font;
#ifdef USE_XFT_MENUBARS
+ /* #### Fix naming convention here */
String renderFontSpec;
XftFont *renderFont;
-#else
- XFontStruct * font;
#endif
# ifdef USE_XFONTSET
XFontSet font_set;
Index: lwlib/xlwtabs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwtabs.c,v
retrieving revision 1.4.2.2
diff -u -r1.4.2.2 xlwtabs.c
--- lwlib/xlwtabs.c 3 Dec 2004 07:40:58 -0000 1.4.2.2
+++ lwlib/xlwtabs.c 10 Dec 2004 03:34:52 -0000
@@ -148,7 +148,7 @@
offset(selectInsensitive), XtRImmediate, (XtPointer) True},
{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
offset(font), XtRString, (XtPointer) XtDefaultFont},
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
/* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here? */
{XtNxftFont, XtCXftFont, XtRString, sizeof (String),
offset(renderFontSpec), XtRString,
@@ -416,7 +416,7 @@
((TabsConstraints)((tab)->core.constraints))->tabs.visible)
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
extern int debug_xft; /* from lwlib-face.c */
/* #### duplicated from xlwmenu.c -- CLEAN THIS SHIT UP!
@@ -472,7 +472,7 @@
*/
newTw->tabs.tab_height = 2 * newTw->tabs.internalHeight + SHADWID ;
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
/* must get font here
to do this right, we should add a new Xt Resource type +
conversion function
@@ -487,11 +487,11 @@
newTw->tabs.tab_height += newTw->tabs.renderFont->ascent +
newTw->tabs.renderFont->descent;
#endif /* XFT_USE_HEIGHT_NOT_ASCENT_DESCENT */
-#else /* ! USE_XFT */
+#else /* ! USE_XFT_TABS */
if (newTw->tabs.font != NULL)
newTw->tabs.tab_height += newTw->tabs.font->max_bounds.ascent +
newTw->tabs.font->max_bounds.descent;
-#endif /* ! USE_XFT */
+#endif /* ! USE_XFT_TABS */
/* if size not explicitly set, set it to our preferred size now. */
@@ -666,7 +666,7 @@
int i ;
if(
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
tw->tabs.renderFont != curtw->tabs.renderFont ||
#else
tw->tabs.font != curtw->tabs.font ||
@@ -676,7 +676,7 @@
{
tw->tabs.tab_height = 2 * tw->tabs.internalHeight + SHADWID;
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
if (tw->tabs.renderFont != NULL)
#if XFT_USE_HEIGHT_NOT_ASCENT_DESCENT
tw->tabs.tab_height += tw->tabs.renderFont->height;
@@ -684,11 +684,11 @@
tw->tabs.tab_height += tw->tabs.renderFont->ascent +
tw->tabs.renderFont->descent;
#endif /* XFT_USE_HEIGHT_NOT_ASCENT_DESCENT */
-#else /* ! USE_XFT */
+#else /* ! USE_XFT_TABS */
if (tw->tabs.font != NULL)
tw->tabs.tab_height += tw->tabs.font->max_bounds.ascent +
tw->tabs.font->max_bounds.descent;
-#endif /* ! USE_XFT */
+#endif /* ! USE_XFT_TABS */
/* Tab size has changed. Resize all tabs and request a new size */
for(i=0, childP=tw->composite.children;
@@ -705,7 +705,7 @@
if (tw->core.background_pixel != curtw->core.background_pixel ||
tw->core.background_pixmap != curtw->core.background_pixmap ||
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
tw->tabs.renderFont != curtw->tabs.renderFont
#else
tw->tabs.font != curtw->tabs.font
@@ -1579,8 +1579,8 @@
GC gc ;
int x,y ;
-#ifdef USE_XFT
- if (debug_xft) fprintf (stderr, "\nDrawTab called.\n");
+#ifdef USE_XFT_TABS
+ if (debug_xft > 0) fprintf (stderr, "DrawTab called.\n");
#endif
if( !XtIsRealized((Widget)tw))
@@ -1595,7 +1595,7 @@
Window win = XtWindow((Widget)tw) ;
String lbl = tab->tabs.label != NULL ?
tab->tabs.label : XtName(child) ;
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
XftColor color;
XftColor colorBG;
Colormap cmap = tw->core.colormap;
@@ -1606,17 +1606,14 @@
colorBG = xft_convert_color (dpy, cmap, visual,
tw->core.background_pixel, 0);
- if (debug_xft)
- {
- fprintf (stderr, "\n(Re)drawing labels.");
- fprintf (stderr, "\nlbl: %s.", lbl);
- }
+ if (debug_xft > 0)
+ fprintf (stderr, "(Re)drawing labels.\n");
#endif
if (XtIsSensitive(child))
{
gc = tw->tabs.foregroundGC;
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
color = xft_convert_color (dpy, cmap, visual,
tab->tabs.foreground, 0);
#else
@@ -1638,7 +1635,7 @@
tab->tabs.greyAlloc = True;
}
gc = tw->tabs.greyGC;
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
color = xft_convert_color (dpy, cmap, visual, tab->tabs.grey, 0);
#else
XSetForeground(dpy, gc, tab->tabs.grey);
@@ -1663,14 +1660,14 @@
}
if (lbl != NULL &&
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
tw->tabs.renderFont != NULL
#else
tw->tabs.font != NULL
#endif
)
{
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
XftDraw *xftDraw = XftDrawCreate (dpy, win, visual, cmap);
XftFont *renderFont = tw->tabs.renderFont;
/* [[ #### FMH!! something is tromping on this string! ]]
@@ -1685,9 +1682,9 @@
/* #### unnecessary? */
/* draw background rect */
#if 1
- if (debug_xft)
- fprintf (stderr, "\nColor: pixel=%08lx, red=%04x,"
- " green=%04x, blue=%04x, alpha=%04x.",
+ if (debug_xft > 0)
+ fprintf (stderr, "background color: pixel=%08lx, r=%04x,"
+ " g=%04x, b=%04x, alpha=%04x.\n",
colorDBG.pixel, colorDBG.color.red,
colorDBG.color.green, colorDBG.color.blue,
colorDBG.color.alpha);
@@ -1698,7 +1695,7 @@
glyphinfo.width, glyphinfo.height);
#endif
/* draw text */
- if (debug_xft)
+ if (debug_xft > 0)
{
/* [[ #### URK! fontconfig frees size!! ]]
That has got to be an artifact of something writing
@@ -1707,17 +1704,17 @@
FcValue size;
FcPatternGet (renderFont->pattern, FC_FAMILY, 0, &name);
FcPatternGet (renderFont->pattern, FC_SIZE, 0, &size);
- fprintf (stderr, "\nlbl: %s.", lbl);
- fprintf (stderr, "\nColor: pixel=%08lx, red=%04x,"
- " green=%04x, blue=%04x, alpha=%04x.",
+ fprintf (stderr, "label: %s.", lbl);
+ fprintf (stderr, "foreground color: pixel=%08lx, r=%04x,"
+ " g=%04x, b=%04x, alpha=%04x.\n",
color.pixel, color.color.red, color.color.green,
color.color.blue, color.color.alpha);
- fprintf (stderr, "\nExtent: x=%d, y=%d, xOffset=%d,"
- " yOffset=%d, height=%d, width=%d",
+ fprintf (stderr, "extent: x=%d, y=%d, xOffset=%d,"
+ " yOffset=%d, height=%d, width=%d.\n",
glyphinfo.x, glyphinfo.y, glyphinfo.xOff,
glyphinfo.yOff, glyphinfo.height, glyphinfo.width);
- fprintf (stderr, "\nFont: name=%s-%.1f, height=%d,"
- " ascent=%d, descent=%d",
+ fprintf (stderr, "font: name=%s-%.1f,"
+ " height=%d, ascent=%d, descent=%d.\n",
name.u.s, size.u.d, renderFont->height,
renderFont->ascent, renderFont->descent);
}
@@ -1735,9 +1732,6 @@
if (child == tw->tabs.hilight)
DrawHighlight(tw, child, False);
-#ifdef USE_XFT
- if (debug_xft) fprintf (stderr, "\n");
-#endif
}
@@ -1939,7 +1933,7 @@
TabsWidget tw = (TabsWidget)XtParent(w) ;
String lbl = tab->tabs.label != NULL ?
tab->tabs.label : XtName(w);
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
XftFont *font = tw->tabs.renderFont;
#else
XFontStruct *font = tw->tabs.font;
@@ -1958,7 +1952,7 @@
if( lbl != NULL && font != NULL )
{
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
tab->tabs.width += x_xft_text_width (XtDisplay(tw), font,
lbl, (int)strlen(lbl)) + iw;
tab->tabs.l_y = (tw->tabs.tab_height
@@ -1967,12 +1961,12 @@
- tw->tabs.renderFont->descent)/2;
if (debug_xft)
{
- fprintf (stderr, "\nTab: height=%d, width=%d, baseline=%d",
- tw->tabs.tab_height, tab->tabs.width, tab->tabs.l_y);
- fprintf (stderr, "\nFont: height=%d, ascent=%d, descent=%d\n",
- tw->tabs.renderFont->height,
- tw->tabs.renderFont->ascent,
- tw->tabs.renderFont->descent);
+ fprintf (stderr, "tab: height=%d, width=%d, baseline=%d.\n",
+ tw->tabs.tab_height, tab->tabs.width, tab->tabs.l_y);
+ fprintf (stderr, "font: height=%d, ascent=%d, descent=%d.\n",
+ tw->tabs.renderFont->height,
+ tw->tabs.renderFont->ascent,
+ tw->tabs.renderFont->descent);
}
#else
tab->tabs.width += XTextWidth (font, lbl, (int)strlen(lbl)) + iw;
@@ -2364,7 +2358,7 @@
values.background = tw->core.background_pixel;
values.font =
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
None;
#else
tw->tabs.font->fid;
@@ -2374,13 +2368,13 @@
tw->tabs.foregroundGC =
XtAllocateGC(w, w->core.depth,
-#ifndef USE_XFT
+#ifndef USE_XFT_TABS
GCFont|
#endif
GCBackground|GCLineStyle,
&values,
GCForeground,
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
GCFont|
#endif
GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
@@ -2395,7 +2389,7 @@
values.background = tw->core.background_pixel;
values.font =
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
None;
#else
tw->tabs.font->fid;
@@ -2409,12 +2403,12 @@
tw->tabs.greyGC =
XtAllocateGC(w, w->core.depth,
-#ifndef USE_XFT
+#ifndef USE_XFT_TABS
GCFont|
#endif
GCBackground|GCStipple|GCFillStyle, &values,
GCForeground,
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
GCFont|
#endif
GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
@@ -2425,14 +2419,14 @@
{
tw->tabs.greyGC =
XtAllocateGC(w, w->core.depth,
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
0L,
#else
GCFont,
#endif
&values,
GCForeground,
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
GCFont|
#endif
GCBackground|GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
Index: lwlib/xlwtabsP.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwtabsP.h,v
retrieving revision 1.2.20.1
diff -u -r1.2.20.1 xlwtabsP.h
--- lwlib/xlwtabsP.h 25 Nov 2004 12:44:07 -0000 1.2.20.1
+++ lwlib/xlwtabsP.h 10 Dec 2004 03:34:52 -0000
@@ -41,7 +41,7 @@
#endif
#include "xlwtabs.h"
-#ifdef USE_XFT
+#ifdef USE_XFT_TABS
#include <X11/Xft/Xft.h>
#endif
@@ -73,10 +73,10 @@
typedef struct {
/* resources */
XFontStruct *font ;
-#ifdef USE_XFT_MENUBARS
+#ifdef USE_XFT_TABS
String renderFontSpec;
XftFont *renderFont;
#endif
Index: man/internals/internals.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/internals/internals.texi,v
retrieving revision 1.52
diff -u -r1.52 internals.texi
--- man/internals/internals.texi 16 Nov 2004 07:37:31 -0000 1.52
+++ man/internals/internals.texi 10 Dec 2004 03:35:05 -0000
@@ -638,6 +638,7 @@
* Future Work -- Display Tables::
* Future Work -- Making Elisp Function Calls Faster::
* Future Work -- Lisp Engine Replacement::
+* Future Work -- Better Rendering Support::
Future Work -- Toolbars
@@ -17523,6 +17524,7 @@
* Future Work -- Display Tables::
* Future Work -- Making Elisp Function Calls Faster::
* Future Work -- Lisp Engine Replacement::
+* Future Work -- Better Rendering Support::
@end menu
@node Future Work -- General Suggestions, Future Work -- Elisp Compatibility Package, Future Work, Future Work
@@ -22362,7 +22364,7 @@
@end itemize
-@node Future Work -- Lisp Engine Replacement, , Future Work -- Making Elisp Function Calls Faster, Future Work
+@node Future Work -- Lisp Engine Replacement, Future Work -- Better Rendering Support, Future Work -- Making Elisp Function Calls Faster, Future Work
@section Future Work -- Lisp Engine Replacement
@cindex future work, lisp engine replacement
@cindex lisp engine replacement, future work
@@ -22972,6 +22974,332 @@
ad-hocked since kingdom come, and it's high time that we make this
work properly so that it could be relied upon, and a lot of things
could "just work".
+
+
+@node Future Work -- Better Rendering Support, , Future Work -- Lisp Engine Replacement, Future Work
+@section Future Work -- Better Rendering Support
+@cindex future work, better rendering support
+@cindex better rendering support, future work
+
+This section was written by Stephen Turnbull <stephen@(a)xemacs.org>, so
+don't blame Ben (or Eric and Matthias, for that matter). Feel free to
+add, edit, and share the blame, guys!
+
+@c #### make these @urlref's!!
+As of late November 2004, this principally means adding support for the
+@file{Xft} library, which provides a more robust @emph{font
+configuration} mechanism via Keith Packard's @file{fontconfig} library
+improved glyph rendering, including antialiasing, via the
+@file{freetype} library, and client-side rendering (saving bandwidth and
+server memory) via the @file{XRender extension}. In fact, patches which
+provide Xft support have been available for several years, but the
+authors have been unwilling to deal with several important issues which
+block integration. These are @emph{Mule}, and more generally,
+@emph{face} support; @emph{widget} support (including the toolbar and
+menubar); and @emph{redisplay refactoring}.
+
+@c Describe Alexey Gladkov and Yury Konovalov's work.
+
+However, in late 2003 Eric Knauel <knauel@(a)informatik.uni-tuebingen.de>
+and Matthias Neubauer <neubauer@(a)informatik.uni-freiburg.de> put forward
+a relatively complete patch which was robust to daily use in ISO 8859-1
+locales, and Stephen Turnbull began work on the integration issues. At
+this point a (private) CVS branch is available for Stephen's patch
+(branch point tag @samp{sjt-xft-bp}, branch tag @samp{sjt-xft}), and
+one may be made available for the Knauel-Matthias patch soon.
+
+@menu
+* Better Rendering Support -- Issues::
+* Better Rendering Support -- Implementation::
+* Better Rendering Support -- Current Status::
+* Better Rendering Support -- Configuration with the Interim Patches::
+@end menu
+
+
+@node Better Rendering Support -- Issues, Better Rendering Support -- Implementation, , Future Work -- Better Rendering Support
+@subsection Better Rendering Support -- Issues
+@cindex better rendering support, issues
+@cindex issues, better rendering support
+
+Of course it's ``unfair'' to demand that the implementers of a nice
+feature like anti-aliasing support deal with accumulated cruft of the
+last few years, but somebody must, sometime soon. Even core developers
+are complaining about how slow XEmacs is in some applications, and there
+is reason to believe that some of the problem is in redisplay.
+Adding more @emph{ad hoc} features to redisplay will make the whole
+module more complex and unintelligible. Even if it doesn't inherently
+further detract from efficiency, it will surely make reform and
+refactoring harder.
+
+Similar considerations apply to Mule support. If Xft support is not
+carefully designed, or implemented with Mule support soon, it will
+undoubtedly make later Mule implementation far more difficult than it
+needs to be, and require redundant work be done (@emph{e.g.}, on
+@samp{Options} menu support).
+
+Besides the design issue---and many users are requesting more
+flexibility, primarily face support, from the widgets---with widget
+support there is also an aesthetic issue. It is horribly unimpressive to
+have clunky bitmapped fonts on the decorations when pleasant antialiased
+fonts are available in the buffer.
+
+Finally, these issues interact. Widgets and faces are inherently
+heavyweight objects, requiring orders of magnitude more computation than
+simply displaying a string in a fixed font. This will have an
+efficiency impact, of course. And they interact with each other; Mule
+was designed for use in buffers and display in Emacs windows---but a
+widget's content is usually not a buffer, and widgets need not be
+displayed in a window, but may appear in other contexts, especially in
+the gutters. So specifiers will probably have to be reworked, in order
+to properly support display of different faces in non-buffer, non-window
+contexts.
+
+@node Better Rendering Support -- Implementation, Better Rendering Support -- Current Status, Better Rendering Support -- Issues, Future Work -- Better Rendering Support
+@subsection Better Rendering Support -- Implementation
+@cindex better rendering support, implementation
+@cindex implementation, better rendering support
+
+Stephen is thinking in terms of the following components of a
+comprehensive proposal.
+
+@table @strong
+@item Font configuration
+In XEmacs, font configuration is handled via @emph{faces}. Currently
+XEmacs uses a special type of @emph{font specifier} to map XEmacs
+locales to font names. Especially under X11, this can cause annoying
+problems because of the unreliability of X servers' mappings from
+@samp{XLFD} names to X11 fonts, over which XEmacs has no influence
+whatsoever. However, the @file{fontconfig} library which is used with
+@file{Xft} provides much more reliable mapping, along with a more
+reliably parsable naming scheme similar to that used by TrueType fonts
+on MS Windows and the Macintosh. Since the capabilities of font
+specifiers and @file{fontconfig} overlap, we should consider using
+@file{fontconfig} instead of @samp{XLFD} names. This implies that use
+of @file{Xft}'s rendering functionality should be separated from use of
+@file{fontconfig}.
+
+@item Font menus
+The @samp{Options->Font} and @samp{Options->Font Sizes} menus are
+broken, by design, not just by @file{Xft}. Although they work better
+in Eric and Matthias's patch than in Stephen's, even their version has
+the problem that many fonts are unavailable because they don't match the
+current size---which is very strange, since @file{Xft} fonts are of
+course scalable. But the whole idea of requiring that the font match
+the size is strange. And the @samp{Options->Font Weights} menu is just
+disabled, and has been for eons.
+
+@item X resources
+Currently in Stephen's patch there are @emph{four} treatments of font
+resources. There are the @samp{XEmacs.(a)var{face}.attributeFont}
+resources used to set a single global font specification. In the
+widgets, some (still) have a @samp{font} resource using the automatic
+@file{Xt} resource conversion to @samp{FontStruct}, some have separate
+@samp{font} and @samp{xftFont} resources with the former automatically
+converted to @samp{FontStruct} by @file{Xt} and the latter left as a
+string, to be converted by @samp{XftParseName} later, and some have a
+single @samp{font} resource which is converted to @samp{FontStruct} by
+@file{Xt} or the latter left as a string, depending on whether
+@file{Xft} was enabled by @samp{configure} or not.
+
+Stephen thinks that all of these should be converted to use the face
+approach, perhaps with some way to set specifications for individual
+widgets, frames, or buffers. This will require some careful design work
+to incorporate face support in the widgets. We should just accept any
+or all of @samp{font}, @samp{fontSet}, and @samp{fontList} resources,
+treat them all as lists of font names, either @samp{XLFD}- or
+@file{fontconfig}-style, parse them ourselves (ie, not use the @file{Xt}
+resource manager), and add them to font specifiers as appropriate. But
+this will require a bit of thought to obey POLA vis-a-vis usual @file{Xt}
+conventions.
+
+@item Rendering engine objects
+With the introduction of the ``Xft patch,'' the X11, Macintosh, and MS
+Windows platforms are all able to support multiple font rendering
+engines in the same binary. Generically, there are several tasks that
+must be accomplished to render text on the display. In both cases the
+code is rather disorganized, with substantial cross-platform duplication
+of similar routines. While it may not be worthwhile to go the whole way
+to @samp{RENDERER_HAS_METHOD} and @samp{MAYBE_RENDMETH}, refactoring
+these modules around the notion of interfacing a ``generic rendering
+engine interface'' to ``text'' seems like a plausible way to focus this
+work.
+
+@item Colors, fonts, and faces
+Besides the rendering engine itself, the XEmacs implementations of these
+objects are poorly supported by current widget implementations,
+including the traditional menubar and toolbar, as well as the more
+recent button, tab control, and progress bar widgets. The refactoring
+suggested under ``Rendering engine objects'' should be conducted with an
+eye to making these widgets support faces, perhaps even to the extent of
+allowing rendering to X pixmaps (which some Athena widgets support,
+although they will not support rendering via Xft directly). Especially
+with @samp{XRender} technology this should not be horribly inefficient.
+
+@item Specifiers, charsets, and languages
+Traditionally Mule uses a rather rigid and low-level abstraction, the
+@emph{charset}, to characterize font repertoires. Unfortunately,
+support for a given charset is generally neither necessary nor
+sufficient to support a language. Worse, although X11's only means for
+indicating font repertoires is the font's @emph{registry}, the actual
+repertoire of many fonts is either deficient or font-dependent. The
+only convenience is that the registry maps directly to a Mule charset in
+most cases, and vice versa.
+
+To date, XEmacs Mule has supported identification of appropriate fonts
+to support a language's repertoire of characters by identifying the
+repertoire as a subset of a union of charsets. To each charset there is
+a regular expression matching the registry portion of a font name. Then
+instantiation of a font proceeds by identifying the specifier domain,
+and then walking down the list of specifications, matching the regexp
+against font names until a match is found. That font is requested from
+the system, and if not found, the process continues similarly until a
+font that can be loaded is found.
+
+This has several problems. First, there's no guarantee that the union
+will be disjoint. This problem manifests both in the case of display of
+Unicode representations of text in the @samp{POSIX} default locale,
+where glyphs are typically drawn from several inappropriate fonts. A
+similar problem often occurs, though for a different reason, in
+multilingual messages composed using @file{Gnus}'s @samp{message-mode}
+and MIME support. This problem @emph{cannot} be avoided with the
+current design; it is quite possible that a font desired in one context
+will be shadowed by a font intended to get higher priority in a
+semantically different but syntactically similar (as far as Mule can
+tell) context. (Of course, one could attach a different face as a text
+property, but that requires programming support; it can't be done by
+user configuration.) The problem is only exacerbated as more and more
+Unicode fonts, supporting large repertoires with substantial overlap
+across fonts, are designed and published.
+
+A second problem is that registry names are often inaccurate. For
+example, the Japanese JIS X 0208 standard was first published in 1978
+(as a relabelling of an older standard). It was then revised in 1983,
+again in 1990, and once again in 2000, with slight changes to the
+repertoire and mapping in each revision. Technically, these standards
+can be distinguished in properly named fonts as @samp{jisx0208.1978},
+(a)samp{jisx0208.1983}, @samp{jisx0208.1990}, @samp{jisx0208.2000}, but
+all of them are commonly simply labelled @samp{jisx0208}, and Western
+distributors, of course, generally lack the expertise to correctly
+relabel them.
+
+A third problem is that you generally can't tell if there are ``holes''
+in the repertoire until you try to display the glyph.
+
+All of this tends to break standard idioms for handling Mule fonts in
+@file{init} files because they depend on charsets being disjoint
+repertoires.
+
+The TrueType fonts (and the later OpenType standard) provides for a
+proper character set query (as a Boolean vector indexed by Unicode code
+points), as well as providing a list of supported languages.
+
+I propose that we take advantage of these latter facilities by allowing
+a font to be specified either as a string (a font name), or as a list
+whose head is the font name and whose tail is a list of languages and
+Mule charsets (for backward compatibility) that user intends to use the
+font to display. This will probably require a change to the specifier
+code.
+
+As mentioned above, specifiers will probably also have to be enhanced to
+recognize @samp{widget} locales and domains, instead of the current hack
+where special @samp{widget} and @samp{gui-element} faces are created.
+
+@item Customize
+
+Customize needs to deal with all this stuff!!
+@end table
+
+
+@node Better Rendering Support -- Current Status, Better Rendering Support -- Configuration with the Interim Patches, Better Rendering Support -- Implementation, Future Work -- Better Rendering Support
+@subsection Better Rendering Support -- Current Status
+@cindex better rendering support, current status
+@cindex current status, better rendering support
+
+Stephen has a branch containing his stuff in XEmacs CVS. The branch
+point tag is @samp{sjt-xft-bp}, roughly corresponding to XEmacs 21.5.18,
+and branch tag is @samp{sjt-xft}.
+
+@subsubsection Bugs Reported in sjt-xft
+
+@table @code
+@item ChangeLogs
+A lot of these, especially for Eric and Matthias's work, are missing.
+Mea culpa.
+
+@item Options->Font
+@itemx Options->Font Size
+These menus don't work. All fonts are greyed out. All sizes are
+available, but many (most?) faces don't change size, in particular,
+@samp{default} does not.
+@end table
+
+
+@node Better Rendering Support -- Configuration with the Interim Patches, , Better Rendering Support -- Current Status, Future Work -- Better Rendering Support
+@subsection Better Rendering Support -- Configuration with the Interim Patches
+@cindex better rendering support, configuration with the interim patches
+@cindex configuration with the interim patches, better rendering support
+
+For Stephen's @samp{sjt-xft} branch, you should keep the following in
+mind when configuring:
+
+@itemize
+@item
+The only way to configure widget fonts at the present time is to use X
+resources (or hack the source and rebuild). Currently supported widgets
+are
+@itemize
+@item
+menubars
+@item
+tab controls
+@end itemize
+
+Here are the resources I use. @strong{Warning:} @emph{This interface
+will change.} The tab control has separate Font and XftFont resources,
+and uses the X resource manager to instantiate a FontStruct from the
+Font resource. The menubar on the other hand uses Font for both, but
+converts to FontStruct if Xft is not compiled in, and leaves it as a
+string if Xft is compiled in. There is no equivalent facility for
+XftFont yet, and creating one that handles both FontStruct and XftFont
+depending on XEmacs's configuration and the font name seems error-prone
+at best. Probably we will revert to a simple string representation for
+this resource, and convert to a face in XEmacs rather than a font in
+Xt/Xft.
+@example
+XEmacs*Tabs.xftFont: Bitstream Vera Sans-18
+XEmacs*menubar.font: Bitstream Vera Sans-18
+XEmacs.modeline.attributeFont: Bitstream Charter-26
+XEmacs.default.attributeFont: Bitstream Vera Sans Mono-24
+@end example
+No, I don't understand why I need to use different point sizes to get
+what looks like good balance to my eyes. I do highly recommend use of a
+proportional font in the modeline because it allows a lot more text to
+fit there.
+
+@item
+Because fonts supporting other languages tend to support English as
+well, if you want to use one font for English and another for the other
+language, you must use the @code{append} method when adding font
+specifications for the other language.
+
+However, this leaves you with a problem if you want to change the other
+language's font: you have to remove the existing specification so it
+won't shadow the new one when you append.
+
+I use @code{define-specifier-tag} like this:
+
+@example
+(define-specifier-tag 'lang-ja)
+;; No, I don't try to do real work with this font! But it makes it
+;; obvious that I got the requested font. :-)
+(set-face-font 'default "AirCut-14")
+(set-face-font 'default "Kochi Mincho-14" nil '(lang-ja) 'append)
+;; Oops, too sober. Try something to match AirCut.
+(set-face-font 'default "Mikachan-14"
+ nil '(lang-ja) 'remove-tag-set-append)
+@end example
+@end itemize
+
@node Future Work Discussion, Old Future Work, Future Work, Top
@chapter Future Work Discussion
Index: src/compiler.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/compiler.h,v
retrieving revision 1.8
diff -u -r1.8 compiler.h
--- src/compiler.h 4 Nov 2004 23:06:17 -0000 1.8
+++ src/compiler.h 10 Dec 2004 03:35:20 -0000
@@ -215,6 +215,11 @@
# else
# define USED_IF_MULE_OR_CHECK_TEXT(decl) UNUSED (decl)
# endif
+# ifdef USE_XFT
+# define USED_IF_XFT(decl) decl
+# else
+# define USED_IF_XFT(decl) UNUSED (decl)
+# endif
#endif /* UNUSED */
#ifdef DEBUG_XEMACS
Index: src/config.h.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/config.h.in,v
retrieving revision 1.95.2.1
diff -u -r1.95.2.1 config.h.in
--- src/config.h.in 25 Nov 2004 12:44:11 -0000 1.95.2.1
+++ src/config.h.in 10 Dec 2004 03:35:20 -0000
@@ -207,9 +207,10 @@
/* Compile with support for Xft? */
#undef USE_XFT
-
-/* Compile with support for Xft menubars? */
+/* Per-widget stuff will go away? */
#undef USE_XFT_MENUBARS
+#undef USE_XFT_TABS
+#undef USE_XFT_GAUGE
/* Defines for building X applications */
#ifdef HAVE_X_WINDOWS
Index: src/emacs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.150.2.1
diff -u -r1.150.2.1 emacs.c
--- src/emacs.c 25 Nov 2004 12:44:12 -0000 1.150.2.1
+++ src/emacs.c 10 Dec 2004 03:35:21 -0000
@@ -954,7 +954,9 @@
if (argmatch (argv, argc, "-si", "--show-inline-info", 0, NULL, &skip_args))
{
#if defined (PDUMP) && !defined (WIN32_NATIVE)
- printf ("%u %u\n", dumped_data_max_size (), dumped_data_align_offset ());
+ /* #### We really should check for sizeof (size_t) > sizeof (long) */
+ printf ("%lu %lu\n", (unsigned long) dumped_data_max_size (),
+ (unsigned long) dumped_data_align_offset ());
#else
printf ("Portable dumper not configured or windows native; -si just forces exit.\n");
#endif
Index: src/glyphs-widget.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-widget.c,v
retrieving revision 1.17
diff -u -r1.17 glyphs-widget.c
--- src/glyphs-widget.c 4 Nov 2004 23:06:33 -0000 1.17
+++ src/glyphs-widget.c 10 Dec 2004 03:35:22 -0000
@@ -1819,7 +1819,7 @@
IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face);
}
-static void image_instantiator_progress_guage (void)
+static void image_instantiator_progress_gauge (void)
{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (progress_gauge, "progress-gauge");
IIFORMAT_HAS_SHARED_METHOD (progress_gauge, validate, widget);
@@ -1927,7 +1927,7 @@
image_instantiator_edit_fields();
image_instantiator_combo_box();
image_instantiator_scrollbar();
- image_instantiator_progress_guage();
+ image_instantiator_progress_gauge();
image_instantiator_tree_view();
image_instantiator_tab_control();
image_instantiator_labels();
Index: src/glyphs-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-x.c,v
retrieving revision 1.80.2.1
diff -u -r1.80.2.1 glyphs-x.c
--- src/glyphs-x.c 25 Nov 2004 12:44:14 -0000 1.80.2.1
+++ src/glyphs-x.c 10 Dec 2004 03:35:23 -0000
@@ -2325,22 +2325,27 @@
bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
lw_add_widget_value_arg (wv, XtNbackground, bcolor.pixel);
- /* #### What to do about Xft? */
+ {
+ /* #### What to do about Xft? */
+ Lisp_Object face = IMAGE_INSTANCE_WIDGET_FACE (ii);
+ XFontStruct *fs =
+ FONT_INSTANCE_X_FONT (XFONT_INSTANCE (query_string_font
+ (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+ face,
+ domain)));
#ifdef LWLIB_WIDGETS_MOTIF
- fontList = XmFontListCreate
- (FONT_INSTANCE_X_FONT
- (XFONT_INSTANCE (query_string_font
- (IMAGE_INSTANCE_WIDGET_TEXT (ii),
- IMAGE_INSTANCE_WIDGET_FACE (ii),
- domain))), XmSTRING_DEFAULT_CHARSET);
- lw_add_widget_value_arg (wv, XmNfontList, (XtArgVal)fontList);
+ fontList = XmFontListCreate (fs, XmSTRING_DEFAULT_CHARSET);
+ lw_add_widget_value_arg (wv, XmNfontList, (XtArgVal)fontList);
#endif
- lw_add_widget_value_arg
- (wv, XtNfont, (XtArgVal)FONT_INSTANCE_X_FONT
- (XFONT_INSTANCE (query_string_font
- (IMAGE_INSTANCE_WIDGET_TEXT (ii),
- IMAGE_INSTANCE_WIDGET_FACE (ii),
- domain))));
+ /* #### This is an unacceptable hack. */
+ if (fs)
+ lw_add_widget_value_arg (wv, XtNfont, (XtArgVal) fs);
+ else
+ warn_when_safe_lispobj
+ (intern ("xft"), Qwarning,
+ Fcons (build_string ("missing font in update_widget_face"),
+ Fface_name (face)));
+ }
wv->change = VISIBLE_CHANGE;
/* #### Megahack - but its just getting too complicated to do this
in the right place. */
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.26.2.3
diff -u -r1.26.2.3 objects-x.c
--- src/objects-x.c 3 Dec 2004 07:41:10 -0000 1.26.2.3
+++ src/objects-x.c 10 Dec 2004 03:35:24 -0000
@@ -206,16 +210,18 @@
Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device));
Extbyte *extname;
XFontStruct *fs = NULL; /* _F_ont _S_truct */
- /* always initialize; then constant folding should optimize away anything
- that depends on rf != NULL, and we can eliminate most of the #ifdefs */
+#ifdef USE_XFT
XftFont *rf = NULL; /* _R_ender _F_ont (X Render extension) */
+#else
+#define rf (0)
+#endif
LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
+#ifdef USE_XFT
if (debug_xft > 0)
stderr_out ("attempting to initialize font spec %s\n", extname);
/* #### serialize (optimize) these later... */
-#ifdef USE_XFT
/* #### This function really needs to go away.
The problem is that the fontconfig/Xft functions work much too hard
to ensure that something is returned; but that something need not be
@@ -229,8 +235,6 @@
/* #### should this refer to X and/or Xft? */
maybe_signal_error (Qgui_error, "Couldn't load font", f->name,
Qfont, errb);
- if (debug_xft > 0)
- stderr_out ("failed to initialize font spec %s\n", extname);
return 0;
}
@@ -250,13 +254,11 @@
fear that the finalize method may get fucked. */
f->data = xnew (struct x_font_instance_data);
- /* handle Xft fonts */
+#ifdef USE_XFT
+ FONT_INSTANCE_X_XFTFONT (f) = rf;
if (rf)
+ /* Have an Xft font, initialize font info from it. */
{
- if (fs)
- XFreeFont (dpy, fs);
- FONT_INSTANCE_X_XFTFONT (f) = rf;
- FONT_INSTANCE_X_FONT (f) = NULL;
if (f->ascent < rf->ascent)
f->ascent = rf->ascent;
if (f->descent < rf->descent)
@@ -271,9 +273,16 @@
if (debug_xft > 0)
stderr_out ("initialized Xft font %s\n", extname);
}
-
- else if (fs)
- /* Handle a core font. */
+ else
+ {
+ if (debug_xft > 0)
+ stderr_out ("couldn't initialize Xft font %s\n", extname);
+ }
+#endif
+
+ FONT_INSTANCE_X_FONT (f) = fs;
+ if (fs && !rf) /* fs && rf is unlikely, but play it safe */
+ /* Have to use a core font, initialize font info from it. */
{
FONT_INSTANCE_X_FONT (f) = fs;
FONT_INSTANCE_X_XFTFONT (f) = NULL;
@@ -335,15 +344,20 @@
f->proportional_p = (fs->min_bounds.width != fs->max_bounds.width ||
(x_handle_non_fully_specified_fonts &&
!fs->all_chars_exist));
- if (debug_xft > 0)
- stderr_out ("initialized Xft font %s\n", extname);
}
- /* #### check for weirdness */
- if (f->height < f->width)
- if (debug_xft > 0)
- stderr_out ("width of font %s is %d, larger than its height %d\n",
- extname, f->width, f->height);
+#ifdef USE_XFT
+ if (debug_xft > 0)
+ {
+ /* #### check for weirdness */
+ if (f->height < f->width)
+ stderr_out ("width of font %s is %d, larger than its height %d\n",
+ extname, f->width, f->height);
+ stderr_out ("initialized Xft font %s\n", extname);
+ }
+#else
+#undef rf
+#endif
return 1;
}
@@ -368,10 +382,13 @@
x_finalize_font_instance (Lisp_Font_Instance *f)
{
+#ifdef USE_XFT
if (debug_xft > 0)
stderr_out ("finalizing %s", (STRINGP (f->name)
? (char *) XSTRING_DATA (f->name)
: "no font name"));
+#endif
+
if (f->data)
{
if (DEVICE_LIVE_P (XDEVICE (f->device)))
@@ -686,19 +703,19 @@
{
struct device *d = XDEVICE (f->device);
Display *dpy = DEVICE_X_DISPLAY (d);
-#ifndef USE_XFT
Extbyte *nameext;
char* xlfd;
-#else
- FcChar8* xlfd;
+#ifdef USE_XFT
+ FcChar8* fcfont;
#endif
+#ifdef USE_XFT
+ /* First, try an Xft font. */
if (NILP (FONT_INSTANCE_TRUENAME (f)))
{
-#ifdef USE_XFT
int core;
FcPattern *pat = FONT_INSTANCE_X_XFTFONT (f)->pattern;
- FcResult res_xlfd = FcPatternGetString (pat, XFT_XLFD, 0, &xlfd);
+ FcResult res_xlfd = FcPatternGetString (pat, XFT_XLFD, 0, &fcfont);
FcResult res_core = FcPatternGetBool (pat, XFT_CORE, 0, &core);
if (res_xlfd == FcResultTypeMismatch || res_core == FcResultTypeMismatch)
@@ -730,19 +747,25 @@
/* #### Why isn't this appropriate for core fonts, too? */
FONT_INSTANCE_TRUENAME (f) =
build_ext_string (truename_via_XListFonts (dpy,
- (Extbyte *) &xlfd[0]),
+ (Extbyte *) &fcfont[0]),
Qx_font_name_encoding);
}
-#else
+ }
+#endif
+
+ /* OK, fall back to core font. */
+ if (NILP (FONT_INSTANCE_TRUENAME (f)))
+ {
nameext = &xlfd[0];
LISP_STRING_TO_EXTERNAL (f->name, nameext, Qx_font_name_encoding);
FONT_INSTANCE_TRUENAME (f) =
x_font_truename (dpy, nameext, FONT_INSTANCE_X_FONT (f));
-#endif
}
+
if (NILP (FONT_INSTANCE_TRUENAME (f)))
{
+ /* Urk, no luck. Whine about our bad luck and exit. */
Lisp_Object font_instance = wrap_font_instance (f);
@@ -752,6 +775,8 @@
(This is only used by Fequal() right now.) */
return f->name;
}
+
+ /* Return what we found. */
return FONT_INSTANCE_TRUENAME (f);
}
@@ -764,7 +789,8 @@
Display *dpy = DEVICE_X_DISPLAY (d);
XFontProp *props = NULL;
- /* #### really should hack Xft fonts, too */
+ /* #### really should hack Xft fonts, too
+ Strategy: fontconfig must have an iterator for this purpose. */
if (! FONT_INSTANCE_X_FONT (f)) return result;
props = FONT_INSTANCE_X_FONT (f)->properties;
@@ -847,7 +873,8 @@
#ifdef MULE
static int
-x_font_spec_matches_charset (struct device *d, Lisp_Object charset,
+x_font_spec_matches_charset (struct device * USED_IF_XFT (d),
+ Lisp_Object charset,
const Ibyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length,
int stage)
@@ -922,6 +949,7 @@
ERROR_ME, 0) >= 0);
}
+#ifdef USE_XFT
/* #### debug functions: find a better place for us */
const char *FcResultToString (FcResult r);
const char *
@@ -976,6 +1004,7 @@
return buffer;
}
}
+#endif
/* find a font spec that matches font spec FONT and also matches
(the registry of) CHARSET. */
@@ -1002,10 +1031,10 @@
/* #### does Xft permit/require a different encoding? */
LISP_STRING_TO_EXTERNAL (font, patternext, Qx_font_name_encoding);
- if (debug_xft > 0)
- stderr_out ("confirming charset for font instance %s\n", patternext);
#ifdef USE_XFT
+ if (debug_xft > 0)
+ stderr_out ("confirming charset for font instance %s\n", patternext);
/* #### totally lazy, let's just get something out the door */
waste = FcInit ();
if (waste) /* I don't think this can fail */
@@ -1090,14 +1119,15 @@
}
else if (debug_xft > 0)
stderr_out ("Failed fontconfig initialization\n");
+
+ if (debug_xft > 0)
+ stderr_out ("shit happens, try X11 charset match for %s\n", patternext);
#endif
names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
patternext, MAX_FONT_COUNT, &count);
/* #### This code seems awfully bogus -- mrb */
/* #### fontconfig does it better -- sjt */
- if (debug_xft > 0)
- stderr_out ("shit happens, try X11 charset match for %s\n", patternext);
for (i = 0; i < count; i ++)
{
const Ibyte *intname;
@@ -1152,17 +1182,10 @@
CONSOLE_HAS_METHOD (x, valid_color_name_p);
CONSOLE_HAS_METHOD (x, initialize_font_instance);
- /* #### both of these #ifndef USE_XFT are pretty bogus
- they cause "defined but not used warnings"
- one or the other must use x_font_truename, which also warns */
-#ifndef USE_XFT
CONSOLE_HAS_METHOD (x, print_font_instance);
-#endif
CONSOLE_HAS_METHOD (x, finalize_font_instance);
CONSOLE_HAS_METHOD (x, font_instance_truename);
-#ifndef USE_XFT
CONSOLE_HAS_METHOD (x, font_instance_properties);
-#endif
CONSOLE_HAS_METHOD (x, list_fonts);
#ifdef MULE
CONSOLE_HAS_METHOD (x, find_charset_font);
Index: src/redisplay-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-x.c,v
retrieving revision 1.39.2.1
diff -u -r1.39.2.1 redisplay-x.c
--- src/redisplay-x.c 25 Nov 2004 12:44:16 -0000 1.39.2.1
+++ src/redisplay-x.c 10 Dec 2004 03:35:24 -0000
@@ -299,7 +299,8 @@
/****************************************************************************/
static int
-x_text_width_single_run (struct frame *f, struct face_cachel *cachel, struct textual_run *run)
+x_text_width_single_run (struct frame * USED_IF_XFT (f),
+ struct face_cachel *cachel, struct textual_run *run)
{
Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
Lisp_Font_Instance *fi = XFONT_INSTANCE (font_ins