diff options
Diffstat (limited to 'xc/lib/Xft/xftdpy.c')
-rw-r--r-- | xc/lib/Xft/xftdpy.c | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/xc/lib/Xft/xftdpy.c b/xc/lib/Xft/xftdpy.c index 94136fd64..94d7928c1 100644 --- a/xc/lib/Xft/xftdpy.c +++ b/xc/lib/Xft/xftdpy.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftdpy.c,v 1.4 2000/12/17 08:30:45 keithp Exp $ + * $XFree86: xc/lib/Xft/xftdpy.c,v 1.6 2001/01/26 20:51:15 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -22,6 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ +#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <X11/Xlibint.h> @@ -81,6 +82,34 @@ _XftDisplayInfoGet (Display *dpy) info->defaults = 0; info->coreFonts = 0; info->hasRender = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != 0; + if (_XftFontDebug () & XFT_DBG_RENDER) + { + Visual *visual = DefaultVisual (dpy, DefaultScreen (dpy)); + XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); + + printf ("XftDisplayInfoGet Default visual 0x%x ", + (int) visual->visualid); + if (format) + { + if (format->type == PictTypeDirect) + { + printf ("format %d,%d,%d,%d\n", + format->direct.alpha, + format->direct.red, + format->direct.green, + format->direct.blue); + } + else + { + printf ("format indexed\n"); + } + } + else + printf ("No Render format for default visual\n"); + + printf ("XftDisplayInfoGet initialized, hasRender set to \"%s\"\n", + info->hasRender ? "True" : "False"); + } info->next = _XftDisplayInfo; _XftDisplayInfo = info; @@ -89,6 +118,10 @@ _XftDisplayInfoGet (Display *dpy) bail1: free (info); bail0: + if (_XftFontDebug () & XFT_DBG_RENDER) + { + printf ("XftDisplayInfoGet failed to initialize, Xft unhappy\n"); + } return 0; } @@ -209,6 +242,8 @@ _XftDefaultInit (Display *dpy) goto bail1; if (!_XftDefaultInitBool (dpy, pat, XFT_ANTIALIAS)) goto bail1; + if (!_XftDefaultInitBool (dpy, pat, XFT_MINSPACE)) + goto bail1; return pat; @@ -344,6 +379,12 @@ XftDefaultSubstitute (Display *dpy, int screen, XftPattern *pattern) XftDefaultGetInteger (dpy, XFT_RGBA, screen, XFT_RGBA_NONE)); } + if (XftPatternGet (pattern, XFT_MINSPACE, 0, &v) == XftResultNoMatch) + { + XftPatternAddBool (pattern, XFT_MINSPACE, + XftDefaultGetBool (dpy, XFT_MINSPACE, screen, + False)); + } if (XftPatternGet (pattern, XFT_PIXEL_SIZE, 0, &v) == XftResultNoMatch) { int pixels, mm; @@ -369,8 +410,8 @@ XftDefaultSubstitute (Display *dpy, int screen, XftPattern *pattern) } scale = XftDefaultGetDouble (dpy, XFT_SCALE, screen, 1.0); size *= scale; - pixels = DisplayHeight (dpy, DefaultScreen (dpy)); - mm = DisplayHeightMM (dpy, DefaultScreen (dpy)); + pixels = DisplayHeight (dpy, screen); + mm = DisplayHeightMM (dpy, screen); size = size / 72.0; size = size * 25.4; size = size * pixels / mm; |