Commit graph

6 commits

Author SHA1 Message Date
Sylvain Pasche
65d017a406 Add tests for the new LCD filter API 2008-08-05 16:30:37 -04:00
Chris Wilson
fc732c3aaa [cairo-scaled-font] Create error objects on demand.
In order to correctly report the error back to the user during the
creation of a scaled font, we need to support a nil object per error.
Instead of statically allocating all possible errors, lazily allocate
the nil object the first time we need to report a particular error.

This fixes the misreporting of an INVALID_MATRIX or NULL_POINTER that
are common user errors during the construction of a scaled font.
2008-02-15 13:50:42 +00:00
Chris Wilson
ad265cc9f2 [cairo-font-options] Disallow use of NULL font-options.
Partial revert of commit 0086db893c.

This is a follow to the earlier commit that allowed creation of scaled
fonts using a NULL font options (by interpreting the NULL as meaning
use the default options) to reflect the comments made by Behdad
(http://lists.cairographics.org/archives/cairo/2008-January/012714.html).

The intent is that the public font options getter/setter API has similar
defensive behaviour to that of the core objects - i.e. do not overwrite
the nil object and if the object is in error then return the default
value. For the indirect use of a NULL/nil font options (e.g. creation of
scaled fonts), then an error should be returned rather than crashing.
2008-02-15 13:50:42 +00:00
Chris Wilson
fe93038ef3 [test/font-options] Check for HAVE_FCFINI
Only pull in the fontconfig headers if we actually use FcFini().
2008-02-15 13:50:42 +00:00
Chris Wilson
d7ce0582f1 [test/font-options] Check the defaults values.
Exercise the getters by checking that a fresh cairo_font_options_t has
the default values.
2008-02-15 13:50:41 +00:00
Chris Wilson
0086db893c [cairo-font-options] Treat NULL as a default cairo_font_options_t
Interpret a NULL cairo_font_options_t as the default values - i.e
as if it were a fresh pointer returned by cairo_font_options_create().
2008-01-17 22:38:02 +00:00