summaryrefslogtreecommitdiff
path: root/contrib/python/lib/fontconfig.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/python/lib/fontconfig.pyx')
-rw-r--r--contrib/python/lib/fontconfig.pyx47
1 files changed, 0 insertions, 47 deletions
diff --git a/contrib/python/lib/fontconfig.pyx b/contrib/python/lib/fontconfig.pyx
deleted file mode 100644
index 16e0289..0000000
--- a/contrib/python/lib/fontconfig.pyx
+++ /dev/null
@@ -1,47 +0,0 @@
-cdef extern from "fontconfig/fontconfig.h" :
- ctypedef struct FcPattern :
- pass
- ctypedef struct FcConfig :
- pass
- cdef enum FcResult '_FcResult' :
- FcResultMatch = 0, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
- FcResultOutOfMemory
-
- ctypedef char FcChar8
- FcPattern *FcNameParse(FcChar8 *name)
- FcPattern *FcFontMatch(FcConfig *config, FcPattern *match, FcResult *res)
- FcResult FcPatternGetInteger(FcPattern *pattern, char *typeid, int index, int *res)
- FcResult FcPatternGetString(FcPattern *pattern, char *typeid, int index, FcChar8 **res)
- void FcPatternPrint(FcPattern *pattern)
- void FcPatternDestroy(FcPattern *pattern)
-
- FcConfig *FcConfigGetCurrent()
-
-cdef class fcPattern :
- cdef FcPattern *_pattern
-
- def __init__(self, char *name) :
- cdef FcPattern *temp
- cdef FcResult res
-
- temp = FcNameParse(<FcChar8 *>name)
- self._pattern = FcFontMatch(FcConfigGetCurrent(), temp, &res)
- if res != FcResultMatch :
- print "Failed to match" + str(res)
- self._pattern = <FcPattern *>0
-
- def __destroy__(self) :
- FcPatternDestroy(self._pattern)
-
- def getInteger(self, char *typeid, int index) :
- cdef int res
- if self._pattern == <FcPattern *>0 or FcPatternGetInteger(self._pattern, typeid, index, &res) != FcResultMatch : return None
- return res
-
- def getString(self, char *typeid, int index) :
- cdef FcChar8 *res
- if self._pattern == <FcPattern *>0 or FcPatternGetString(self._pattern, typeid, index, &res) != FcResultMatch : return None
- return <char *>res
-
- def debugPrint(self) :
- FcPatternPrint(self._pattern)