User: stephent
Date: 06/04/25 16:02:15
Modified: xemacs/src ChangeLog console.h emacs.c font-mgr.c font-mgr.h
objects-x.c redisplay.c symsinit.h
Log:
Repair broken commit to Xft code. <87aca9n4in.fsf(a)tleepslib.sk.tsukuba.ac.jp>
Revision Changes Path
1.739 +18 -0 XEmacs/xemacs/lisp/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.738
retrieving revision 1.739
diff -u -p -r1.738 -r1.739
--- ChangeLog 2006/04/23 20:12:25 1.738
+++ ChangeLog 2006/04/25 14:01:52 1.739
@@ -1,3 +1,21 @@
+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.
+
2006-04-23 Aidan Kehoe <kehoea(a)parhasard.net>
* cl.el (push):
1.38 +4 -2 XEmacs/xemacs/lisp/faces.el
Index: faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/faces.el,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -p -r1.37 -r1.38
--- faces.el 2005/11/26 11:45:54 1.37
+++ faces.el 2006/04/25 14:01:52 1.38
@@ -990,8 +990,10 @@ multi-charset environments."
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 ...
1.2 +0 -10 XEmacs/xemacs/lisp/font-mgr.el
Index: font-mgr.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font-mgr.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- font-mgr.el 2006/04/23 16:11:22 1.1
+++ font-mgr.el 2006/04/25 14:01:53 1.2
@@ -234,16 +234,6 @@ stable.
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
1.20 +4 -2 XEmacs/xemacs/lisp/font.el
Index: font.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- font.el 2005/12/05 09:43:37 1.19
+++ font.el 2006/04/25 14:01:53 1.20
@@ -796,10 +796,12 @@ The type may be the strings \"px\", \"pi
"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))
1.4 +6 -11 XEmacs/xemacs/lisp/fontconfig.el
Index: fontconfig.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/fontconfig.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- fontconfig.el 2006/04/23 16:11:22 1.3
+++ fontconfig.el 2006/04/25 14:01:53 1.4
@@ -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 @@ A new object is allocated and returned."
;;
;; 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 @@ A new object is allocated and returned."
;;
;; 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
;;
1.56 +9 -4 XEmacs/xemacs/lisp/startup.el
Index: startup.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/startup.el,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -p -r1.55 -r1.56
--- startup.el 2005/05/05 16:55:41 1.55
+++ startup.el 2006/04/25 14:01:53 1.56
@@ -174,7 +174,7 @@ Otherwise, XEmacs will offer migration t
(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 @@ Display options:
-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 @@ Type ^H^H^H (Control-h Control-h Control
;; ;; 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 @@ Type ^H^H^H (Control-h Control-h Control
(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 @@ Type ^H^H^H (Control-h Control-h Control
(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")))
1.25 +19 -19 XEmacs/xemacs/lisp/x-faces.el
Index: x-faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-faces.el,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- x-faces.el 2006/04/23 16:11:22 1.24
+++ x-faces.el 2006/04/25 14:01:54 1.25
@@ -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 @@ If it fails, it returns nil."
(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 @@ If it fails, it returns nil."
(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 @@ If it fails, it returns nil."
(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 @@ If it fails, it returns nil."
(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 @@ X fonts can be specified (by the user) i
;; 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 @@ Otherwise, it returns the next smaller v
(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)
1.16 +2 -2 XEmacs/xemacs/lisp/x-font-menu.el
Index: x-font-menu.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-font-menu.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- x-font-menu.el 2006/04/23 16:11:22 1.15
+++ x-font-menu.el 2006/04/25 14:01:54 1.16
@@ -35,7 +35,6 @@
(require 'font-menu)
(when (featurep 'xft-fonts)
- (require 'xft)
(require 'fontconfig))
(globally-declare-boundp
@@ -276,6 +275,7 @@ or if you change your font path, you can
(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 @@ or if you change your font path, you can
(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)
1.16 +1 -1 XEmacs/xemacs/lisp/x-init.el
Index: x-init.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-init.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- x-init.el 2005/06/26 18:04:50 1.15
+++ x-init.el 2006/04/25 14:01:54 1.16
@@ -271,7 +271,7 @@ based on Unicode. "
(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")
1.85 +3 -2 XEmacs/xemacs/lwlib/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -p -r1.84 -r1.85
--- ChangeLog 2006/04/23 16:11:25 1.84
+++ ChangeLog 2006/04/25 14:02:04 1.85
@@ -1,6 +1,7 @@
-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.
2006-03-31 Stephen J. Turnbull <stephen(a)xemacs.org>
1.4 +2 -0 XEmacs/xemacs/lwlib/lwlib-fonts.c
Index: lwlib-fonts.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-fonts.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- lwlib-fonts.c 2006/04/23 16:11:26 1.3
+++ lwlib-fonts.c 2006/04/25 14:02:04 1.4
@@ -36,7 +36,9 @@ Boston, MA 02111-1307, USA. */
#include "device.h"
#include "device-impl.h"
#include "console-x-impl.h"
+#ifdef HAVE_FONTCONFIG
#include "font-mgr.h"
+#endif
#endif
/*
1.949 +18 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.948
retrieving revision 1.949
diff -u -p -r1.948 -r1.949
--- ChangeLog 2006/04/24 16:09:58 1.948
+++ ChangeLog 2006/04/25 14:02:05 1.949
@@ -1,3 +1,21 @@
+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.
+
2006-04-22 Jerry James <james(a)xemacs.org>
* event-stream.c (copy_command_builder): Also copy the console.
1.43 +14 -9 XEmacs/xemacs/src/console.h
Index: console.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- console.h 2004/03/08 15:23:02 1.42
+++ console.h 2006/04/25 14:02:08 1.43
@@ -28,20 +28,25 @@ Boston, MA 02111-1307, USA. */
/* 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! */
1.166 +1 -1 XEmacs/xemacs/src/emacs.c
Index: emacs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -p -r1.165 -r1.166
--- emacs.c 2006/04/23 16:11:32 1.165
+++ emacs.c 2006/04/25 14:02:08 1.166
@@ -911,7 +911,7 @@ main_1 (int argc, Wexttext **argv, Wextt
#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
1.2 +31 -56 XEmacs/xemacs/src/font-mgr.c
Index: font-mgr.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- font-mgr.c 2006/04/23 16:11:33 1.1
+++ font-mgr.c 2006/04/25 14:02:08 1.2
@@ -32,8 +32,6 @@ Boston, MA 02111-1307, USA. */
/* 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 @@ Boston, MA 02111-1307, USA. */
. 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 @@ static void string_list_to_fcobjectset (
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 @@ static void string_list_to_fcobjectset (
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 @@ Unparse an fc pattern object to a string
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 @@ Xft v.2: encoding, charwidth, charheigh
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 @@ given pattern, or an error code. Possib
`fc-result-no-match' and `fc-result-no-id'. */
(device, pattern))
{
- Display *dpy;
FcResult res;
struct fc_pattern *res_fcpat =
@@ -469,11 +476,15 @@ given pattern, or an error code. Possib
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 @@ match other font-listing APIs. */
}
}
-/* #### 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 @@ syms_of_font_mgr (void)
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 @@ syms_of_font_mgr (void)
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 +755,7 @@ The major version number of the Xft libr
*/ );
Vxft_version = make_int(XFT_VERSION);
- Fprovide (intern ("xft"));
+ Fprovide (intern ("font-mgr"));
}
void
1.2 +1 -1 XEmacs/xemacs/src/font-mgr.h
Index: font-mgr.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- font-mgr.h 2006/04/23 16:11:33 1.1
+++ font-mgr.h 2006/04/25 14:02:09 1.2
@@ -48,7 +48,7 @@ Boston, MA 02111-1307, USA. */
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)))
1.39 +8 -8 XEmacs/xemacs/src/objects-x.c
Index: objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -r1.38 -r1.39
--- objects-x.c 2006/04/23 16:11:33 1.38
+++ objects-x.c 2006/04/25 14:02:09 1.39
@@ -255,7 +255,7 @@ x_color_list (void)
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 @@ x_color_list (void)
#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 @@ x_initialize_font_instance (Lisp_Font_In
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 @@ x_font_instance_truename (Lisp_Font_Inst
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 @@ x_find_charset_font (Lisp_Object device,
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 @@ x_find_charset_font (Lisp_Object device,
/* 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 @@ x_find_charset_font (Lisp_Object device,
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 @@ x_find_charset_font (Lisp_Object device,
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);
1.99 +5 -2 XEmacs/xemacs/src/redisplay.c
Index: redisplay.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -p -r1.98 -r1.99
--- redisplay.c 2005/11/26 11:46:10 1.98
+++ redisplay.c 2006/04/25 14:02:09 1.99
@@ -470,9 +470,12 @@ Lisp_Object Vvisible_bell; /* If true an
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;
1.57 +2 -2 XEmacs/xemacs/src/symsinit.h
Index: symsinit.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symsinit.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- symsinit.h 2006/04/23 16:11:33 1.56
+++ symsinit.h 2006/04/25 14:02:09 1.57
@@ -149,7 +149,7 @@ void syms_of_menubar_mswindows (void);
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 vars_of_minibuf (void);
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);