~alcinnz/fontconfig-pure

ref: 8abf298021bdbd08bbac04628ff88f5b0ad69ad0 fontconfig-pure/cbits/pattern.c -rw-r--r-- 953 bytes
8abf2980 — Adrian Cochrane Fix various segfaults & exercise bridging from FcPatterns to Ft_Faces. 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <fontconfig/fontconfig.h>
#include <stddef.h>

int my_FcCHARSET_MAP_SIZE() {
    return FC_CHARSET_MAP_SIZE*sizeof(FcChar32);
}

FcBool my_FcPatternAdd(FcPattern *p, const char *object,
        FcBool binding, FcBool append, FcValue *value) {
    if (binding) {
        return FcPatternAdd(p, object, *value, append);
    } else {
        return FcPatternAddWeak(p, object, *value, append);
    }
}

int size_value() {
    return sizeof(FcValue);
}
int size_matrix() {
    return sizeof(FcMatrix);
}
int size_PatternIter() {
    return sizeof(FcPatternIter);
}

int size_ConfigFileInfoIter() {
    return sizeof(FcConfigFileInfoIter);
}

int get_fontSet_nfont(FcFontSet *fonts) {
    return fonts->nfont;
}

FcPattern *get_fontSet_font(FcFontSet *fonts, int i) {
    if (i < 0) return NULL;
    if (i >= fonts->nfont) return NULL;
    if (i >= fonts->sfont) return NULL;
    if (fonts->fonts == NULL) return NULL;
    return fonts->fonts[i];
}