APPROVE COMMIT 21.5
I'm beginning to like git a lot, but this particular time it handed me
a loaded gun and I blew my foot off. Commit from the wrong branch,
double plus ungood.
My apologies to those who got spattered.
This patch puts all the various requires, provides, #includes as they
should be. Successfully built and run (ie, splash screen appeared and
I shut down normally with C-x C-c) for the --with-xft and
--without-xft variants.
This also contains a number of gratuitous documentation improvements
and two code clarifications. One in emacs.c (main_1) initializes
use_display, which is a char*, to NULL instead of 0. The other in
x-faces.el (Face-frob-property) gives an informative error if a device
type has no mapper function in `x-make-face-bold' and friends. Both
are hangovers from an experiment with turning Xft into a console type,
but seem useful. Will revert on request....
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.738
diff -u -r1.738 ChangeLog
--- lisp/ChangeLog 23 Apr 2006 20:12:25 -0000 1.738
+++ lisp/ChangeLog 25 Apr 2006 13:18:34 -0000
@@ -0,0 +1,18 @@
+2006-04-25 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Repair busted commit and gratuitous doc improvements.
+
+ * startup.el (command-line-do-help): Document options for forcing
+ initial from on a given window-system.
+
+ * faces.el (Face-frob-property): Give informative error if device
+ type has no mapper function.
+
+ * x-font-menu.el (x-font-menu-font-data-xft):
+ * x-faces.el (globally-declare-fboundp):
+ Eliminate references to `fc-font-real-pattern'.
+
+ * fontconfig.el (section header comments):
+ * x-init.el (x-init-toolbar-from-resources):
+ Improve comments.
+
Index: lwlib/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.84
diff -u -r1.84 ChangeLog
--- lwlib/ChangeLog 23 Apr 2006 16:11:25 -0000 1.84
+++ lwlib/ChangeLog 25 Apr 2006 13:18:35 -0000
@@ -1,3 +1,4 @@
-2006-04-22 Stephen J. Turnbull <stephen(a)xemacs.org>
+2006-04-16 Stephen J. Turnbull <stephen(a)xemacs.org>
- * lwlib-fonts.c: Rename xft-fonts.h to font-mgr.h.
+ * lwlib-fonts.c: Change #include to "font-mgr.h". Make
+ conditional on HAVE_FONTCONFIG, not USE_XFT.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.948
diff -u -r1.948 ChangeLog
--- src/ChangeLog 24 Apr 2006 16:09:58 -0000 1.948
+++ src/ChangeLog 25 Apr 2006 13:18:41 -0000
@@ -0,0 +1,18 @@
+2006-04-25 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Repair busted commit, plus some gratuitous doc improvements.
+
+ * emacs.c (main_1): Initialize display_use to NULL for clarity.
+
+ * objects-x.c (x_color_list):
+ (x_initialize_font_instance):
+ (x_font_instance_truename):
+ (x_find_charset_font):
+ * font-mgr.h (Qfc_font_name_encoding):
+ Qxft_font_name_encoding -> Qfc_font_name_encoding.
+
+ * console.h (header comment):
+ * font-mgr.c (vars_of_font_mgr):
+ * redisplay.c (Vwindow_system):
+ Improve comments.
+
Index: lisp/faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/faces.el,v
retrieving revision 1.37
diff -u -r1.37 faces.el
--- lisp/faces.el 26 Nov 2005 11:45:54 -0000 1.37
+++ lisp/faces.el 25 Apr 2006 13:18:34 -0000
@@ -990,8 +990,10 @@
locale tag-set devtype-spec ffpdev)
;; devtype may be nil if it fails to match DEVTYPE-SPEC
if devtype
- if (let* ((mapper (if (functionp frob-mapping) frob-mapping
- (plist-get frob-mapping devtype)))
+ if (let* ((mapper
+ (cond ((functionp frob-mapping) frob-mapping)
+ ((plist-get frob-mapping devtype))
+ (t (error 'unimplemented "mapper" devtype))))
(result
(cond
;; if a vector ...
Index: lisp/font-mgr.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font-mgr.el,v
retrieving revision 1.1
diff -u -r1.1 font-mgr.el
--- lisp/font-mgr.el 23 Apr 2006 16:11:22 -0000 1.1
+++ lisp/font-mgr.el 25 Apr 2006 13:18:34 -0000
@@ -234,16 +234,6 @@
match other font-listing APIs."
(error 'unimplemented "font-mgr library is experimental and
incomplete"))
-(when nil
- ;; #### this actually is an Xft function, should split those out
- ;; or get rid of them entirely?
- ;; #### be consistent about argument order.
-(defun fc-font-real-pattern (fontname xdevice)
- "Temporarily open FONTNAME (a string) and return the actual
-fc pattern matched by the Fc library."
- (error 'unimplemented "font-mgr library is experimental and
incomplete"))
-)
-
(defun xlfd-font-name-p (fontname)
"Check whether the string FONTNAME is a XLFD font name."
(save-match-data
Index: lisp/font.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v
retrieving revision 1.19
diff -u -r1.19 font.el
--- lisp/font.el 5 Dec 2005 09:43:37 -0000 1.19
+++ lisp/font.el 25 Apr 2006 13:18:35 -0000
@@ -796,10 +796,12 @@
"A list of font family mappings on Xft devices.")
(defun xft-font-create-object (fontname &optional device)
- "Return a font descriptor object for FONTNAME, appropriate for Xft."
+ "Return a font descriptor object for FONTNAME, appropriate for Xft.
+
+Optional DEVICE defaults to `default-x-device'."
(let* ((name fontname)
(device (or device (default-x-device)))
- (pattern (fc-font-real-pattern name device))
+ (pattern (fc-font-match device (fc-name-parse name)))
(font-obj (make-font))
(family (fc-pattern-get-family pattern 0))
(size (fc-pattern-get-size pattern 0))
Index: lisp/fontconfig.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/fontconfig.el,v
retrieving revision 1.3
diff -u -r1.3 fontconfig.el
--- lisp/fontconfig.el 23 Apr 2006 16:11:22 -0000 1.3
+++ lisp/fontconfig.el 25 Apr 2006 13:18:35 -0000
@@ -89,9 +89,8 @@
;;
;; The fontconfig pattern API
;;
-;; The basic interfaces are defined as API wrappers in C in xft-font.c
-;; #### which should be renamed to fontconfig.c. These are prefixed
-;; with "fc-pattern-". These are
+;; The basic interfaces are defined as API wrappers in C in font-mgr.c.
+;; These are prefixed with "fc-pattern-". These are
;;
;; fc-pattern-p
;; fc-pattern-create
@@ -385,13 +384,11 @@
;;
;; The fontconfig fontname UI
;;
-;; The basic interfaces are defined as API wrappers in C in xft-font.c
-;; #### which should be renamed to fontconfig.c. These are prefixed
-;; with "fc-name-". These are
+;; The basic interfaces are defined as API wrappers in C in font-mgr.c
+;; These are prefixed with "fc-name-". These are
;;
;; fc-name-parse
;; fc-name-unparse
-;; xft-name-unparse (nonfunctional and presumably obsolete)
;;
;; For interfacing with various font rendering systems, we need to be able
;; to convert the fontconfig patterns to names, and vice versa. The high-
@@ -423,14 +420,12 @@
;;
;; The fontconfig font API
;;
-;; The basic interfaces are defined as API wrappers in C in xft-font.c
-;; #### which should be renamed to fontconfig.c. These are prefixed
-;; with "fc-font-". These are
+;; The basic interfaces are defined as API wrappers in C in font-mgr.c.
+;; These are prefixed with "fc-font-". These are
;;
;; fc-font-match
;; fc-list-fonts-pattern-objects
;; fc-font-sort
-;; fc-font-real-pattern
;;
;; The high-level API is
;;
Index: lisp/startup.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/startup.el,v
retrieving revision 1.55
diff -u -r1.55 startup.el
--- lisp/startup.el 5 May 2005 16:55:41 -0000 1.55
+++ lisp/startup.el 25 Apr 2006 13:18:35 -0000
@@ -174,7 +174,7 @@
(defvar load-user-init-file-p t
"Non-nil if XEmacs should load the user's init file.")
-;; #### called `site-run-file' in FSFmacs
+;; #### called `site-run-file' in GNU Emacs
(defvar site-start-file "site-start"
"File containing site-wide run-time initializations.
@@ -285,6 +285,11 @@
-t is given. Otherwise, a TTY frame is created.
-unmapped Do not display the initial frame. Useful to create
a \"server\" that can accept `gnuclient'
connections.
+ -tty Create the initial frame on the given window system.
+ -x (Requesting an unsupported window system, or giving
+ -gtk conflicting window systems, is a fatal error.)
+ -gnome
+ -msw
Noninteractive options:
@@ -569,7 +574,7 @@
;; ;; Modify the initial frame based on what the init file puts into
;; ;; ...-frame-alist.
(frame-notice-user-settings)
- ;; ;;####FSFmacs junk
+ ;; ;;#### GNU Emacs junk
;; ;; Now we know the user's default font, so add it to the menu.
;; (if (fboundp 'font-menu-add-default)
;; (font-menu-add-default))
@@ -583,7 +588,7 @@
(if load-user-init-file-p
(maybe-migrate-user-init-file))
- ;; FSF calls precompute-menubar-bindings. We don't mix menubars
+ ;; GNU calls precompute-menubar-bindings. We don't mix menubars
;; and keymaps.
))
@@ -606,7 +611,7 @@
(string= vc "simple"))
(setq version-control 'never))))
- ;;####FSFmacs
+ ;;#### GNU Emacs
;; (if (let ((ctype
;; ;; Use the first of these three envvars that has a nonempty value.
;; (or (let ((string (getenv "LC_ALL")))
Index: lisp/x-faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-faces.el,v
retrieving revision 1.24
diff -u -r1.24 x-faces.el
--- lisp/x-faces.el 23 Apr 2006 16:11:22 -0000 1.24
+++ lisp/x-faces.el 25 Apr 2006 13:18:35 -0000
@@ -1,6 +1,6 @@
;;; x-faces.el --- X-specific face frobnication, aka black magic.
-;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1994, 1997, 2006 Free Software Foundation, Inc.
;; Copyright (C) 1995, 1996, 2002, 2004 Ben Wing.
;; Author: Jamie Zawinski <jwz(a)jwz.org>
@@ -74,11 +74,11 @@
fc-font-name-slant-oblique fc-font-name-slant-italic
fc-font-name-slant-roman))
(globally-declare-fboundp
- '(fc-font-real-pattern fc-pattern-get-size fc-copy-pattern-partial
- fc-pattern-del-weight fc-pattern-del-style fc-pattern-duplicate
- fc-pattern-add-weight fc-try-font fc-pattern-add-size
- fc-name-unparse fc-pattern-del-slant fc-pattern-add-slant
- fc-pattern-del-size fc-pattern-get-pixelsize)))
+ '(fc-pattern-del-size fc-pattern-get-size fc-pattern-add-size
+ fc-pattern-del-style fc-pattern-duplicate fc-copy-pattern-partial
+ fc-pattern-add-weight fc-pattern-del-weight fc-try-font
+ fc-pattern-del-slant fc-pattern-add-slant fc-name-unparse
+ fc-pattern-get-pixelsize)))
(defconst x-font-regexp nil)
(defconst x-font-regexp-head nil)
@@ -194,8 +194,8 @@
(x-make-font-bold-core font device)))
(defun x-make-font-bold-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let ((pattern (fc-font-match (or device (default-x-device))
+ (fc-name-parse font))))
(if pattern
(let ((size (fc-pattern-get-size pattern 0))
(copy (fc-copy-pattern-partial pattern (list "family"))))
@@ -238,8 +238,8 @@
(x-make-font-unbold-core font device)))
(defun x-make-font-unbold-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let ((pattern (fc-font-match (or device (default-x-device))
+ (fc-name-parse font))))
(when pattern
(fc-pattern-del-weight pattern)
(fc-pattern-add-weight pattern fc-font-name-weight-medium)
@@ -268,8 +268,8 @@
(x-make-font-italic-core font device)))
(defun x-make-font-italic-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let ((pattern (fc-font-match (or device (default-x-device))
+ (fc-name-parse font))))
(if pattern
(let ((size (fc-pattern-get-size pattern 0))
(copy (fc-copy-pattern-partial pattern (list "family"))))
@@ -322,8 +322,8 @@
(x-make-font-unitalic-core font device)))
(defun x-make-font-unitalic-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let ((pattern (fc-font-match (or device (default-x-device))
+ (fc-name-parse font))))
(when pattern
(fc-pattern-del-slant pattern)
(fc-pattern-add-slant pattern fc-font-name-slant-roman)
@@ -389,11 +389,11 @@
;; this is unbelievable &*@#
(defun x-font-size-xft (font)
- (let ((pattern (fc-font-real-pattern
- font (default-x-device))))
+ (let ((pattern (fc-font-match (default-x-device)
+ (fc-name-parse font))))
(when pattern
(let ((pixelsize (fc-pattern-get-pixelsize pattern 0)))
- (if (floatp pixelsize) (round pixelsize))))))
+ (if (floatp pixelsize) (round pixelsize) pixelsize)))))
(defun x-font-size-core (font)
(if (font-instance-p font) (setq font (font-instance-name font)))
@@ -521,8 +521,8 @@
(x-find-smaller-font-core font device)))
(defun x-find-xft-font-of-size (font new-size-proc &optional device)
- (let* ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let* ((pattern (fc-font-match (or device (default-x-device))
+ (fc-name-parse font))))
(when pattern
(let ((size (fc-pattern-get-size pattern 0)))
(if (floatp size)
Index: lisp/x-font-menu.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-font-menu.el,v
retrieving revision 1.15
diff -u -r1.15 x-font-menu.el
--- lisp/x-font-menu.el 23 Apr 2006 16:11:22 -0000 1.15
+++ lisp/x-font-menu.el 25 Apr 2006 13:18:35 -0000
@@ -35,7 +35,6 @@
(require 'font-menu)
(when (featurep 'xft-fonts)
- (require 'xft)
(require 'fontconfig))
(globally-declare-boundp
@@ -276,6 +275,7 @@
(x-font-menu-font-data-core face dcache))))
(defun x-font-menu-font-data-xft (face dcache name domain)
+ ;; DOMAIN is expected to be a device.
(let* ((truename (font-instance-truename
(face-font-instance face domain
(if (featurep 'mule) 'ascii))))
@@ -284,7 +284,7 @@
(progn
nil)
(progn
- (let* ((pattern (fc-font-real-pattern name domain))
+ (let* ((pattern (fc-font-match domain (fc-name-parse name)))
(family (and pattern
(fc-pattern-get-family pattern 0))))
(if (fc-pattern-get-successp family)
Index: lisp/x-init.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-init.el,v
retrieving revision 1.15
diff -u -r1.15 x-init.el
--- lisp/x-init.el 26 Jun 2005 18:04:50 -0000 1.15
+++ lisp/x-init.el 25 Apr 2006 13:18:35 -0000
@@ -271,7 +271,7 @@
(fill-paragraph nil))))))
-;; Moved from x-toolbar.el, since InfoDock doesn't dump a x-toolbar.el.
+;; Moved from x-toolbar.el, since InfoDock doesn't dump x-toolbar.el.
(defun x-init-toolbar-from-resources (locale)
(loop for (specifier . resname) in
`(( ,top-toolbar-height . "topToolBarHeight")
Index: lwlib/lwlib-fonts.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-fonts.c,v
retrieving revision 1.3
diff -u -r1.3 lwlib-fonts.c
--- lwlib/lwlib-fonts.c 23 Apr 2006 16:11:26 -0000 1.3
+++ lwlib/lwlib-fonts.c 25 Apr 2006 13:18:35 -0000
@@ -36,7 +36,9 @@
#include "device.h"
#include "device-impl.h"
#include "console-x-impl.h"
+#ifdef HAVE_FONTCONFIG
#include "font-mgr.h"
+#endif
#endif
/*
Index: src/console.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.h,v
retrieving revision 1.42
diff -u -r1.42 console.h
--- src/console.h 8 Mar 2004 15:23:02 -0000 1.42
+++ src/console.h 25 Apr 2006 13:18:41 -0000
@@ -28,20 +28,25 @@
/* Devices and consoles are similar entities. The idea is that
a console represents a physical keyboard/mouse/other-input-source
while a device represents a display where frames appear on.
+ Nowadays "multi-headed" displays with multiple physical screens
+ are becoming familiar; in the XEmacs nomenclature, this maps to a
+ "console" supporting multiple "devices".
+
In the X world, a console is a "Display" while a device is a
"Screen". Implementationally, it can sometimes get confusing:
under X, multiple devices on a single console are different
"Display" connections to what is in reality the same Display on
- the same server. Because of this, input comes from the device
- and not from the console. This is OK because events are basically
- always tagged to a particular X window (i.e. frame),
- which exists on only one screen; therefore the event won't be
- reported multiple times even if there are multiple devices on
- the same physical display. This is an implementation detail
- specific to X consoles (e.g. under NeXTstep or Windows, this
- could be different, and input would come directly from the console).
-*/
+ the same server. Furthermore, in the X model input comes from the
+ device and not from the console. This causes no confusion because
+ events are basically always tagged to a particular X window (i.e.
+ frame), which exists on only one screen; therefore the event won't
+ be reported multiple times even if there are multiple devices on
+ the same physical display.
+ This is an implementation detail specific to X consoles (e.g. under
+ NeXTstep or Windows, this could be different, and input would come
+ directly from the console).
+*/
/* GCC does not like forward enum declaration. This needs to be
defined here. What a disgust! */
Index: src/emacs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.165
diff -u -r1.165 emacs.c
--- src/emacs.c 23 Apr 2006 16:11:32 -0000 1.165
+++ src/emacs.c 25 Apr 2006 13:18:41 -0000
@@ -911,7 +911,7 @@
#endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */
noninteractive = 0;
- display_use = 0;
+ display_use = NULL;
inhibit_non_essential_conversion_operations = 1;
#ifdef NEW_GC
Index: src/font-mgr.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.c,v
retrieving revision 1.1
diff -u -r1.1 font-mgr.c
--- src/font-mgr.c 23 Apr 2006 16:11:33 -0000 1.1
+++ src/font-mgr.c 25 Apr 2006 13:18:41 -0000
@@ -32,8 +32,6 @@
/* This module provides the Lisp interface to fonts in X11, including Xft,
but (at least at first) not GTK+ or Qt.
- It should be renamed to fonts-x.h.
-
Sealevel code should be in ../lwlib/lwlib-fonts.c or
../lwlib/lwlib-colors.c.
*/
@@ -69,7 +67,7 @@
. Fontconfig fontnames are encoded in UTF-8.
*/
-Lisp_Object Qxft_font;
+Lisp_Object Qfont_mgr;
Lisp_Object Qfc_patternp;
Lisp_Object Qfc_fontsetp;
/* Lisp_Object Qfc_result_match; */ /* FcResultMatch */
@@ -122,9 +120,11 @@
is a Lisp string.
*/
#define extract_fcapi_string(str) \
- ((FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((str), Qnative))
+ ((FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((str), Qfc_font_name_encoding))
+
+/* #### This homebrew lashup should be replaced with FcConstants.
-/* fontconfig assumes that objects (property names) are statically allocated,
+ fontconfig assumes that objects (property names) are statically allocated,
and you will get bizarre results if you pass Lisp string data or strings
allocated on the stack as objects. fontconfig _does_ copy values, so we
(I hope) don't have to worry about that member.
@@ -135,12 +135,20 @@
I suspect that using symbol names or even keywords does not provide
assurance that the string won't move in memory. So we hash them
- ourselves; hash.c hashtables do not interpret the value pointers. */
-static FcChar8 *fc_standard_properties[] = {
- "antialias", "aspect", "autohint", "charset",
"dpi", "family", "file",
+ ourselves; hash.c hashtables do not interpret the value pointers.
+
+ This array should be FcChar8**, but GCC 4.x bitches about signedness. */
+static Extbyte *fc_standard_properties[] = {
+ /* treated specially, ordered first */
+ "family", "size",
+ /* remaining are alphabetized by group */
+ /* standard properties in fontconfig and Xft v.2 */
+ "antialias", "aspect", "autohint", "charset",
"dpi", "file",
"foundry", "ftface", "globaladvance",
"hinting", "index", "lang",
"minspace", "outline", "pixelsize",
"rasterizer", "rgba", "scalable",
- "scale", "size", "slant", "spacing",
"style", "verticallayout", "weight",
+ "scale", "slant", "spacing", "style",
"verticallayout", "weight",
+ /* common in modern fonts */
+ "fontformat", "fontversion",
/* obsolete after Xft v. 1 */
"charwidth", "charheight", "core", "encoding",
"render"
};
@@ -213,7 +221,7 @@
CHECK_FCPATTERN(pattern);
{
FcChar8 *temp = FcNameUnparse(XFCPATTERN_PTR(pattern));
- Lisp_Object res = build_ext_string (temp, Qxft_font_name_encoding);
+ Lisp_Object res = build_ext_string (temp, Qfc_font_name_encoding);
free (temp);
return res;
}
@@ -419,7 +427,7 @@
case FcTypeString:
return ((!NILP (type) && !EQ (type, Qstring))
? Qfc_result_type_mismatch
- : build_ext_string (fc_value.u.s, Qxft_font_name_encoding));
+ : build_ext_string (fc_value.u.s, Qfc_font_name_encoding));
case FcTypeBool:
return ((!NILP (type) && !EQ (type, Qboolean))
? Qfc_result_type_mismatch : fc_value.u.b ? Qt : Qnil);
@@ -457,7 +465,6 @@
`fc-result-no-match' and `fc-result-no-id'. */
(device, pattern))
{
- Display *dpy;
FcResult res;
struct fc_pattern *res_fcpat =
@@ -469,11 +476,15 @@
if (!DEVICE_LIVE_P(XDEVICE(device)))
return Qnil;
- dpy = DEVICE_X_DISPLAY(XDEVICE(device));
- /* More Xft vs fontconfig brain damage? */
- res_fcpat->fcpatPtr = XftFontMatch(dpy, DefaultScreen (dpy),
- XFCPATTERN_PTR(pattern), &res);
-
+ {
+ FcPattern *p = XFCPATTERN_PTR(pattern);
+ FcConfig *fcc = FcConfigGetCurrent ();
+
+ FcConfigSubstitute (fcc, p, FcMatchPattern);
+ FcDefaultSubstitute (p);
+ res_fcpat->fcpatPtr = FcFontMatch (fcc, p, &res);
+ }
+
if (res_fcpat->fcpatPtr == NULL)
switch (res) {
case FcResultNoMatch:
@@ -576,41 +587,6 @@
}
}
-/* #### this actually is an Xft function, should split those out
- or get rid of them entirely? */
-/* #### be consistent about argument order. */
-DEFUN("fc-font-real-pattern", Ffc_font_real_pattern, 2, 2, 0, /*
-Temporarily open FONTNAME (a string) and return the actual
-fc pattern matched by the Fc library. */
- (fontname, xdevice))
-{
- FcPattern *copy;
- Display *dpy;
- XftFont *font;
- struct fc_pattern *fcpat =
- ALLOC_LCRECORD_TYPE (struct fc_pattern, &lrecord_fc_pattern);
-
- CHECK_STRING (fontname); /* #### MEMORY LEAK?! maybe not ... */
- if (NILP(xdevice))
- return Qnil;
- CHECK_X_DEVICE (xdevice);
- if (!DEVICE_LIVE_P(XDEVICE(xdevice)))
- return Qnil;
-
- /* #### these gymnastics should be unnecessary, just use FcFontMatch */
- dpy = DEVICE_X_DISPLAY (XDEVICE (xdevice));
- font = XftFontOpenName (dpy, DefaultScreen(dpy),
- extract_fcapi_string (fontname));
- if (font == NULL)
- return Qnil;
- copy = FcPatternDuplicate(font->pattern);
- XftFontClose(dpy, font);
- if (copy == NULL)
- return Qnil;
- fcpat->fcpatPtr = copy;
- return wrap_fcpattern(fcpat);
-}
-
DEFUN("xlfd-font-name-p", Fxlfd_font_name_p, 1, 1, 0, /*
Check whether the string FONTNAME is a XLFD font name. */
(fontname))
@@ -744,7 +720,7 @@
DEFSYMBOL(Qfc_result_no_match);
DEFSYMBOL(Qfc_result_no_id);
DEFSYMBOL(Qfc_internal_error);
- DEFSYMBOL(Qxft_font);
+ DEFSYMBOL(Qfont_mgr);
DEFSUBR(Ffc_pattern_p);
DEFSUBR(Ffc_pattern_create);
@@ -757,14 +733,13 @@
DEFSUBR(Ffc_list_fonts_pattern_objects);
DEFSUBR(Ffc_font_sort);
DEFSUBR(Ffc_font_match);
- DEFSUBR(Ffc_font_real_pattern);
DEFSUBR(Fxlfd_font_name_p);
}
void
vars_of_font_mgr (void)
{
- /* #### These two variables need to go somewhere else. */
+ /* #### The next two functions belong somewhere else. */
/* #### I know, but the right fix is use the generic debug facility. */
DEFVAR_INT ("xft-debug-level", &debug_xft /*
@@ -780,7 +761,7 @@
*/ );
Vxft_version = make_int(XFT_VERSION);
- Fprovide (intern ("xft"));
+ Fprovide (intern ("font-mgr"));
}
void
Index: src/font-mgr.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.h,v
retrieving revision 1.1
diff -u -r1.1 font-mgr.h
--- src/font-mgr.h 23 Apr 2006 16:11:33 -0000 1.1
+++ src/font-mgr.h 25 Apr 2006 13:18:41 -0000
@@ -48,7 +48,7 @@
extern Fixnum debug_xft;
/* Standard for fontconfig. Use a macro to show we're not guessing. */
-#define Qxft_font_name_encoding Qutf_8
+#define Qfc_font_name_encoding Qutf_8
#define XE_XLFD_MAKE_LISP_STRING(s) (make_string(s, strlen(s)))
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.38
diff -u -r1.38 objects-x.c
--- src/objects-x.c 23 Apr 2006 16:11:33 -0000 1.38
+++ src/objects-x.c 25 Apr 2006 13:18:41 -0000
@@ -255,7 +255,7 @@
DECLARE_EISTRING (eistrpxft_name); \
FcChar8 *name = FcNameUnparse (pattern); \
\
- eicpy_ext(eistrpxft_name, name, Qxft_font_name_encoding); \
+ eicpy_ext(eistrpxft_name, name, Qfc_font_name_encoding); \
DEBUG_XFT1 (level, format, eidata(eistrpxft_name)); \
free (name); \
} while (0)
@@ -267,7 +267,7 @@
#define CHECKING_LANG(level,font,lang) \
do { \
DECLARE_EISTRING (eistrcl_name); \
- eicpy_ext(eistrcl_name, font, Qxft_font_name_encoding); \
+ eicpy_ext(eistrcl_name, font, Qfc_font_name_encoding); \
DEBUG_XFT2 (level, "checking if %s handles %s\n", \
eidata(eistrcl_name), lang); \
} while (0)
@@ -295,7 +295,7 @@
The problem is that the fontconfig/Xft functions work much too hard
to ensure that something is returned; but that something need not be
at all close to what we asked for. */
- LISP_STRING_TO_EXTERNAL (f->name, extname, Qxft_font_name_encoding);
+ LISP_STRING_TO_EXTERNAL (f->name, extname, Qfc_font_name_encoding);
rf = xft_open_font_by_name (dpy, extname);
#endif
LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
@@ -808,7 +808,7 @@
if (res)
{
FONT_INSTANCE_TRUENAME (f) =
- build_ext_string (res, Qxft_font_name_encoding);
+ build_ext_string (res, Qfc_font_name_encoding);
free (res);
return FONT_INSTANCE_TRUENAME (f);
}
@@ -1218,7 +1218,7 @@
DECLARE_EISTRING (eistr_longname); /* omit FC_LANG and FC_CHARSET */
DECLARE_EISTRING (eistr_fullname); /* everything */
- LISP_STRING_TO_EXTERNAL (font, patternext, Qxft_font_name_encoding);
+ LISP_STRING_TO_EXTERNAL (font, patternext, Qfc_font_name_encoding);
fcc = FcConfigGetCurrent ();
/* parse the name, do the substitutions, and match the font */
@@ -1251,7 +1251,7 @@
/* full name, including language coverage and repertoire */
name = FcNameUnparse (p);
- eicpy_ext (eistr_fullname, name, Qxft_font_name_encoding);
+ eicpy_ext (eistr_fullname, name, Qfc_font_name_encoding);
free (name);
/* long name, omitting coverage and repertoire, plus a number
@@ -1268,7 +1268,7 @@
FcPatternDel (p, FC_SCALE);
FcPatternDel (p, FC_FONTVERSION);
name = FcNameUnparse (p);
- eicpy_ext (eistr_longname, name, Qxft_font_name_encoding);
+ eicpy_ext (eistr_longname, name, Qfc_font_name_encoding);
free (name);
/* nickname, just family and size, but
@@ -1282,7 +1282,7 @@
FcPatternDel (p, FC_SCALABLE);
FcPatternDel (p, FC_DPI);
name = FcNameUnparse (p);
- eicpy_ext (eistr_shortname, name, Qxft_font_name_encoding);
+ eicpy_ext (eistr_shortname, name, Qfc_font_name_encoding);
free (name);
FcPatternDestroy (p);
Index: src/redisplay.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay.c,v
retrieving revision 1.98
diff -u -r1.98 redisplay.c
--- src/redisplay.c 26 Nov 2005 11:46:10 -0000 1.98
+++ src/redisplay.c 25 Apr 2006 13:18:41 -0000
@@ -470,9 +470,12 @@
where one page is used for Emacs and another for all else. */
int no_redraw_on_reenter;
-Lisp_Object Vwindow_system; /* nil or a symbol naming the window system
+Lisp_Object Vwindow_system; /* #### this variable is deprecated
+ nil or a symbol naming the window system
under which emacs is running
- (`x' is the only current possibility) */
+ (`x', `gtk', `mswindows', and `tty' are
+ supported -- yes, TTYs are window systems
+ for this purpose. */
Lisp_Object Vinitial_window_system;
Lisp_Object Vglobal_mode_string;
Index: src/symsinit.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symsinit.h,v
retrieving revision 1.56
diff -u -r1.56 symsinit.h
--- src/symsinit.h 23 Apr 2006 16:11:33 -0000 1.56
+++ src/symsinit.h 25 Apr 2006 13:18:41 -0000
@@ -149,7 +149,7 @@
void syms_of_menubar_x (void);
void syms_of_minibuf (void);
void syms_of_module (void);
-void syms_of_canna_api (void);
+EXTERN_C void syms_of_canna_api (void);
void syms_of_mule_ccl (void);
void syms_of_mule_charset (void);
void syms_of_mule_coding (void);
@@ -388,7 +388,7 @@
void reinit_vars_of_minibuf (void);
void vars_of_module (void);
void reinit_vars_of_module (void);
-void vars_of_canna_api (void);
+EXTERN_C void vars_of_canna_api (void);
void vars_of_mule_ccl(void);
void vars_of_mule_charset (void);
void vars_of_mule_coding (void);
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.