Bug 5689 - Missing bindings for cairo_font_options_set_antialias & others.
Summary: Missing bindings for cairo_font_options_set_antialias & others.
Status: RESOLVED FIXED
Alias: None
Product: pycairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high enhancement
Assignee: Steve Chaplin
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-23 08:39 UTC by Rauli Ruohonen
Modified: 2006-01-22 20:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Rauli Ruohonen 2006-01-23 08:39:54 UTC
cairo_font_options_set_antialias and some other
font option stuff is missing bindings. Here's a patch for
two of them:

diff -u -d -r -N pycairo-1.0.2/cairo/pycairo-font.c
pycairo-1.0.2-mod/cairo/pycairo-font.c
--- pycairo-1.0.2/cairo/pycairo-font.c  2005-08-19 05:28:00.000000000 +0300
+++ pycairo-1.0.2-mod/cairo/pycairo-font.c      2006-01-21 21:11:45.000000000 +0200
@@ -349,6 +349,25 @@
     return o;
 }
 
+static PyObject *
+font_options_get_antialias (PycairoFontOptions *o)
+{
+    int aa;
+    assert (o->font_options != NULL);
+    aa = cairo_font_options_get_antialias (o->font_options)
+    return PyInt_FromLong (aa);
+}
+
+static PyObject *
+font_options_set_antialias (PycairoFontOptions *o, PyObject *args)
+{
+    cairo_antialias_t aa;
+    assert (o->font_options != NULL);
+    if (!PyArg_ParseTuple(args, "i", &aa)) return NULL;
+    cairo_font_options_set_antialias(o->font_options, aa);
+    Py_INCREF(Py_None);
+    return Py_None;
+}
 
 static PyMethodDef font_options_methods[] = {
     /* methods never exposed in a language binding:
@@ -359,11 +378,12 @@
      * copy
      * merge
      * equal (richcmp?)
-     * set/get_antialias
      * set/get_subpixel_order
      * set/get_hint_style
      * set/get_hint_metrics
      */
+    {"get_antialias", (PyCFunction)font_options_get_antialias, METH_NOARGS},
+    {"set_antialias", (PyCFunction)font_options_set_antialias, METH_VARARGS},
     {NULL, NULL, 0, NULL},
 };
Comment 1 Steve Chaplin 2006-01-23 15:03:22 UTC
Added missing bindings for cairo_font_options_set_antialias and some others:

	* cairo/cairomodule.c (init_cairo): Add cairo.SUBPIXEL_ORDER_*,
	cairo.HINT_STYLE_*, cairo.HINT_METRICS_* constants.

	* cairo/pycairo-font.c (font_options_get_antialias)
	(font_options_get_hint_metrics, font_options_get_hint_style)
	(font_options_get_subpixel_order, font_options_set_antialias)
	(font_options_set_hint_metrics, font_options_set_hint_style)
	(font_options_set_subpixel_order):
	new bindings, applied patch from raulir, with some changes,
	fixes bug #5689.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.