[cairo] Re: cairo-win32 falls over when asked for the path of a glyph from a bitmap font

Carl Worth cworth at cworth.org
Thu Apr 5 10:29:42 PDT 2007


On Thu, 5 Apr 2007 14:50:21 +0100, "Robert Longson" wrote:
> I'm not sure the 'the code we already have for
> tracing out a path from the bitmap glyph image' exists on win32.
>
> If _cairo_win32_scaled_font_glyph_init returns CAIRO_INT_STATUS_UNSUPPORTED,
> _cairo_scaled_font_glyph_path will call it again with info of
> CAIRO_SCALED_GLYPH_INFO_SURFACE
> which will cause _cairo_scaled_font_glyph_path to do ASSERT_NOT_REACHED.

Yikes! That's a really unkind code path without comment [*]:

    if ((info & CAIRO_SCALED_GLYPH_INFO_SURFACE) != 0) {
        ASSERT_NOT_REACHED;
    }

The bitmap tracing code does indeed exist. What is apparently missing
is that the cairo-win32 font backend doesn't know here how to create
an image surface from a glyph.

I'm baffled. How has cairo-win32 font stuff ever appeared to work in
the past?

I hope that someone more enlightened than me on how this stuff was
intended to work can comment.

-Carl

[*] Here's a funny thing to note: That "!= 0" thing is head-hurting
noise to me. This would be much easier for me to read without that and
without the extra parentheses.

And this in spite of the fact that I do write: "if (pointer !=
NULL)". So I don't know if my aesthetic sense is just whack and
inconsistent here.

Actually, I think the problem is that I see the masking which seems
obvious enough, (assuming the mask is a single bit), then I see the
parentheses around it and start thinking "oh there must be something
else going on here beyond the obvious test of a bit", then I see the !
and start imagining a negated test, and finally I parse "!= 0" and
have to do a head-hurting double-negative.

I don't have anything like the same experience when reading a test for
a non-NULL pointer "if (pointer != NULL)". Maybe it's the lack of
extra parentheses, or maybe that's just an idiom I've absorbed more
completely.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070405/9102dace/attachment.pgp


More information about the cairo mailing list