[cairo] [PATCH] PS/PDF improve efficiency of text output

Daniel Amelang daniel.amelang at gmail.com
Mon Sep 25 11:56:31 PDT 2006

> > There can potentially be a ton of these options; I'd suggest a generic
> > cairo_surface_set_float_param or _set_int_param or _set_string_param

> What you are proposing is an explosion of parameter types. It would
> merely move the checking of whether or not a parameter is allowed for a
> given surface type to runtime checks rather than compile-time checks. If
> I had to choose, compile-time checks always win.

I think it's relevant to point out that for years, OpenGL has
successfully used a very similar technique to what Vlad proposes in
managing its state variables (see
OpenGL also has the same issue that certain parameters only make sense
for certain surfaces. So far it hasn't been a major source of problems
(AFAIK) for developers.

Doesn't mean its the Right Thing To Do, but if I had to choose,
time-tested approaches to API design would carry a lot of weight.


More information about the cairo mailing list