source: appstream-generator/src/asgen/bindings/fontconfig.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 3 years ago

Initial release

File size: 3.2 KB
RevLine 
[4841]1/*
2 * Copyright (C) 2016 Matthias Klumpp <matthias@tenstral.net>
3 *
4 * Licensed under the GNU Lesser General Public License Version 3
5 *
6 * This library is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the license, or
9 * (at your option) any later version.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20module asgen.bindings.fontconfig;
21
22extern(C):
23nothrow:
24@nogc:
25
26alias FcChar8 = char;
27alias FcBool = int;
28
29struct FcPattern {};
30struct FcConfig {};
31
32struct FcMatrix {};
33struct FcCharSet {};
34struct FcLangSet {};
35struct FcRange {}
36
37struct FcStrList {};
38struct FcStrSet {};
39
40struct FcBlanks {};
41
42immutable char *FC_LANG = "lang"; // String RFC 3066 langs
43immutable char *FC_STYLE = "style"; // String
44immutable char *FC_FULLNAME = "fullname"; // String
45
46struct FcFontSet {
47    int nfont;
48    int sfont;
49    FcPattern **fonts;
50};
51
52enum FcType {
53    Unknown = -1,
54    Void,
55    Integer,
56    Double,
57    String,
58    Bool,
59    Matrix,
60    CharSet,
61    FTFace,
62    LangSet
63};
64
65struct FcValue
66{
67    FcType type;
68    union {
69        const FcChar8 *s;
70        int i;
71        FcBool b;
72        double d;
73        const FcMatrix *m;
74        const FcCharSet *c;
75        void *f;
76        const FcLangSet *l;
77        const FcRange *r;
78    };
79};
80
81enum FcSetName
82{
83    System = 0,
84    Application = 1
85};
86
87enum FcResult {
88    Match,
89    NoMatch,
90    TypeMismatch,
91    NoId,
92    OutOfMemory
93};
94
95FcBool FcInit ();
96
97FcConfig *FcConfigCreate ();
98void FcConfigDestroy (FcConfig *config);
99
100void FcConfigAppFontClear (FcConfig *config);
101bool FcConfigSetCurrent (FcConfig *config);
102bool FcConfigAppFontAddFile (FcConfig *config,
103                             const char *file);
104FcFontSet *FcConfigGetFonts (FcConfig *config,
105                             FcSetName set);
106
107FcPattern *FcFreeTypeQuery (const FcChar8 *file,
108                            int id,
109                            FcBlanks *blanks,
110                            int *count);
111void FcPatternDestroy (FcPattern *p);
112
113FcResult FcPatternGet (const FcPattern *p,
114                        const char *object,
115                        int id,
116                        FcValue *v);
117FcResult FcPatternGetLangSet (const FcPattern *p,
118                              const char *object,
119                              int n,
120                              FcLangSet **ls);
121FcResult FcPatternGetString (const FcPattern *p,
122                             const char *object,
123                             int n,
124                             FcChar8 ** s);
125
126FcStrList *FcStrListCreate (FcStrSet *set);
127void FcStrListFirst (FcStrList *list);
128char *FcStrListNext (FcStrList *list);
129void FcStrListDone (FcStrList *list);
130
131FcStrSet *FcLangSetGetLangs (const FcLangSet *ls);
132void FcStrSetDestroy (FcStrSet *set);
Note: See TracBrowser for help on using the repository browser.