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