Mercurial > hg > xemacs-beta
annotate lwlib/lwlib-fonts.c @ 4917:fce43cb76a1c
xlike cleanup, documentation
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-02-03 Ben Wing <ben@xemacs.org>
* internals/internals.texi (Top):
* internals/internals.texi (Evaluation; Stack Frames; Bindings):
* internals/internals.texi (Ben's README):
* internals/internals.texi (Consoles; Devices; Frames; Windows):
* internals/internals.texi (Window Hierarchy):
* internals/internals.texi (The Window Object):
* internals/internals.texi (Modules for the Basic Displayable Lisp Objects):
* internals/internals.texi (Window-System Support):
* internals/internals.texi (Creating a Window-System Type):
* internals/internals.texi (Discussion -- Garbage Collection):
Update the part at the top about how to maintain the file with
more tips.
Add a chapter on "window-system support" describing in a general
way how the support for different window systems/device types
works, including the separation between device-independent and
device-dependent parts, device methods, the specific device types
and the "xlike" pseudo-type.
src/ChangeLog addition:
2010-02-03 Ben Wing <ben@xemacs.org>
* Makefile.in.in:
* Makefile.in.in (x_objs):
* Makefile.in.in (gtk_gui_objs):
* console-xlike-inc.h:
* depend:
* device-x.c:
* emacs.c:
* gccache-gtk.h:
* gccache-gtk.h (gc_cache_lookup):
* gccache-x.c:
* gccache-x.c (GCCACHE_HASH):
* gccache-x.h:
* toolbar-gtk.c:
* toolbar-gtk.c (gtk_initialize_frame_toolbars):
* toolbar-x.c:
* toolbar-x.c (x_initialize_frame_toolbars):
* toolbar-xlike.c:
* toolbar-xlike.c (xlike_draw_blank_toolbar_button):
* toolbar-xlike.c (xlike_output_toolbar_button):
* toolbar-xlike.c (xlike_get_button_size):
* toolbar-xlike.c (XLIKE_OUTPUT_BUTTONS_LOOP):
* toolbar-xlike.c (xlike_output_toolbar):
* toolbar-xlike.c (xlike_clear_toolbar):
* toolbar-xlike.c (xlike_output_frame_toolbars):
* toolbar-xlike.c (xlike_clear_frame_toolbars):
* toolbar-xlike.c (xlike_redraw_exposed_toolbar):
* toolbar-xlike.c (xlike_redraw_exposed_toolbars):
* toolbar-xlike.c (xlike_redraw_frame_toolbars):
* toolbar-xlike.h:
* toolbar-xlike.h (xlike_clear_frame_toolbars):
Rename some files to make them consistent with general naming rules:
xgccache.c -> gccache-x.c
xgccache.h -> gccache-x.h
toolbar-common.c -> toolbar-xlike.c
toolbar-common.h -> toolbar-xlike.h
Fix include-file references. Also change the names of functions
in now-named toolbar-xlike.c to be xlike_foo() instead of common_foo().
Add a longish comment in console-xlike-inc.h describing the "xlike"
system, how it works and what the various files are used for.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 03 Feb 2010 02:46:50 -0600 |
parents | a6c778975d7d |
children | c9d31263ab7d 308d34e9f07d |
rev | line source |
---|---|
3094 | 1 /* Font handling code for X and Xft. |
2 | |
3 Copyright (C) 2003 Eric Knauel | |
4 Copyright (C) 2004 Free Software Foundation, Inc. | |
5 | |
6 Author: Stephen J. Turnbull <stephen@xemacs.org> | |
7 Created: 24 Jul 2004 by Stephen J. Turnbull | |
8 | |
9 This file is part of XEmacs. | |
10 | |
11 XEmacs is free software; you can redistribute it and/or modify it | |
12 under the terms of the GNU General Public License as published by the | |
13 Free Software Foundation; either version 2, or (at your option) any | |
14 later version. | |
15 | |
16 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
19 for more details. | |
20 | |
21 You should have received a copy of the GNU General Public License | |
22 along with XEmacs; see the file COPYING. If not, write to | |
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 Boston, MA 02111-1307, USA. */ | |
25 | |
26 /* Synched up with: Not in GNU Emacs. */ | |
27 | |
28 #include <config.h> | |
29 #include <stdio.h> | |
30 #include <stdlib.h> | |
31 #include "lwlib-fonts.h" | |
32 | |
33 #if 0 | |
34 /* these are all from ../src; if we need them move the code */ | |
35 #include "lisp.h" | |
36 #include "device.h" | |
37 #include "device-impl.h" | |
38 #include "console-x-impl.h" | |
3360 | 39 #ifdef HAVE_FONTCONFIG |
3354 | 40 #include "font-mgr.h" |
3094 | 41 #endif |
3360 | 42 #endif |
3094 | 43 |
44 /* | |
45 * code for handling Xft | |
46 */ | |
47 | |
4916
a6c778975d7d
split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents:
3360
diff
changeset
|
48 #ifdef HAVE_XFT |
3094 | 49 |
50 /* helper function to correctly open Xft/core fonts by name | |
51 #### Can't we use FcParseName here? | |
52 #### Is this done so often that the logic needs to be hard-coded in C? | |
53 | |
54 Daniel Pittman sez: Older code tried to enforce that an XLFD font was | |
55 not scaled, while this version just doesn't care. I think that is a | |
56 better behavior, since if someone really wants a scaled font we should | |
57 oblige them. | |
58 | |
59 Stephen sez: This whole function was ill-conceived, and I'm not sure it | |
60 succeeds at any of the things it attempts to do. First, we should be | |
61 using fontconfig directly. I'm not sure what Xft (or fontconfig) will | |
62 try to do if passed an XLFD. As for scaled fonts, both options are | |
63 equally bad. The problem is that the X server will often scale bitmap | |
64 fonts willy-nilly; it's worth trying to avoid that, but I can't say | |
65 whether that's worth overriding somebody who knows what they're doing. | |
66 In any case, I think we should find out what Xft (fontconfig?) is able | |
67 and willing to do with XLFDs, and probably move the logic to LISP. | |
68 */ | |
69 XftFont * | |
70 xft_open_font_by_name (Display *dpy, char *name) | |
71 { | |
72 XftFont *res = NULL; | |
73 | |
74 /* if (!NILP (Fxft_xlfd_font_name_p (make_string (name, strlen (name))))) */ | |
75 /* #### this is bogus but ... */ | |
76 int count = 0; | |
77 char *pos = name; | |
78 /* extra parens shut up gcc */ | |
79 while ((pos = index (pos, '-'))) | |
80 { | |
81 count++; | |
82 pos++; | |
83 } | |
84 | |
85 /* #### hard-coding DefaultScreen is evil! */ | |
86 if (count == 14 /* fully-qualified XLFD */ | |
87 || (count < 14 /* heuristic for wildcarded XLFD */ | |
88 && count >= 5 | |
89 && index (name, '*'))) | |
90 res = XftFontOpenXlfd (dpy, DefaultScreen (dpy), name); | |
91 else | |
92 res = XftFontOpenName (dpy, DefaultScreen (dpy), name); | |
93 | |
94 /* Try for a generic monospace font | |
95 #### Why? Menus don't need to line up in columns! */ | |
96 if (!res) | |
97 res = XftFontOpenName (dpy, DefaultScreen (dpy), "monospace"); | |
98 /* Try for anything we can get */ | |
99 if (!res) | |
100 res = XftFontOpenName (dpy, DefaultScreen (dpy), ""); | |
101 | |
102 if (!res) | |
103 { | |
104 /* #### This is Just So Wrong ... ! */ | |
105 /* sorry folks ... */ | |
106 fprintf (stderr, | |
107 "Unable to find any usable XFT font, even the defaults!\n"); | |
108 abort (); | |
109 return 0; | |
110 } | |
111 | |
112 return res; | |
113 } | |
114 | |
4916
a6c778975d7d
split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents:
3360
diff
changeset
|
115 #endif /* HAVE_XFT */ |
3094 | 116 |
117 /* End of lwlib-fonts.c */ |