xftlist.c revision c76ae52d
1/*
2 * $Id: xftlist.c,v 1.1.1.1 2008/07/30 02:49:10 mrg Exp $
3 *
4 * Copyright © 2000 Keith Packard
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission.  Keith Packard makes no
13 * representations about the suitability of this software for any purpose.  It
14 * is provided "as is" without express or implied warranty.
15 *
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 */
24
25#include "xftint.h"
26
27_X_HIDDEN FcFontSet *
28XftListFontsPatternObjects (Display	    *dpy,
29			    int		    screen,
30			    FcPattern	    *pattern,
31			    FcObjectSet    *os)
32{
33    return FcFontList (0, pattern, os);
34}
35
36_X_EXPORT FcFontSet *
37XftListFonts (Display	*dpy,
38	      int	screen,
39	      ...)
40{
41    va_list	    va;
42    FcFontSet	    *fs;
43    FcObjectSet	    *os;
44    FcPattern	    *pattern;
45    const char	    *first;
46
47    va_start (va, screen);
48
49    FcPatternVapBuild (pattern, 0, va);
50
51    first = va_arg (va, const char *);
52    FcObjectSetVapBuild (os, first, va);
53
54    va_end (va);
55
56    fs = XftListFontsPatternObjects (dpy, screen, pattern, os);
57    FcPatternDestroy (pattern);
58    FcObjectSetDestroy (os);
59    return fs;
60}
61