[cairo-commit] [cairo-www] src/freetypepython.mdwn
Carl Worth
cworth at freedesktop.org
Tue Nov 2 15:14:49 PDT 2010
src/freetypepython.mdwn | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 4bb55fa44ea0ddb31fd683f69451e41e87b23dd2
Author: vasya.pupkinbekov <vasya.pupkinbekov at web>
Date: Tue Nov 2 15:14:48 2010 -0700
Ubuntu 10.10 amd64 fix. Probably other x64 OSes with cairo 1.10 too.
diff --git a/src/freetypepython.mdwn b/src/freetypepython.mdwn
index 13d197f..9bafcc4 100644
--- a/src/freetypepython.mdwn
+++ b/src/freetypepython.mdwn
@@ -45,16 +45,20 @@ The resulting cairo font face however can be used normally with pycairo.
ft_face = ctypes.c_void_p()
cairo_ctx = cairo.Context (_surface)
cairo_t = PycairoContext.from_address(id(cairo_ctx)).ctx
- _cairo_so.cairo_ft_font_face_create_for_ft_face.restype = ctypes.c_void_p
if FT_Err_Ok != _freetype_so.FT_New_Face (_ft_lib, filename, faceindex, ctypes.byref(ft_face)):
raise "Error creating FreeType font face for " + filename
# create cairo font face for freetype face
+ _cairo_so.cairo_ft_font_face_create_for_ft_face.restype = ctypes.c_void_p
+ _cairo_so.cairo_ft_font_face_create_for_ft_face.argtypes = [ ctypes.c_void_p, ctypes.c_int ]
cr_face = _cairo_so.cairo_ft_font_face_create_for_ft_face (ft_face, loadoptions)
if CAIRO_STATUS_SUCCESS != _cairo_so.cairo_font_face_status (cr_face):
raise "Error creating cairo font face for " + filename
+ _cairo_so.cairo_set_font_face.argtypes = [ ctypes.c_void_p, ctypes.c_void_p ]
_cairo_so.cairo_set_font_face (cairo_t, cr_face)
+
+ _cairo_so.cairo_status.argtypes = [ ctypes.c_void_p ]
if CAIRO_STATUS_SUCCESS != _cairo_so.cairo_status (cairo_t):
raise "Error creating cairo font face for " + filename
@@ -80,4 +84,4 @@ The resulting cairo font face however can be used normally with pycairo.
del ctx
- surface.write_to_png("hello.png")
\ No newline at end of file
+ surface.write_to_png("hello.png")
More information about the cairo-commit
mailing list