[cairo] Custom UserFont sizing questions [RESOLVED]
Behdad Esfahbod
behdad at behdad.org
Fri Dec 12 08:38:38 PST 2008
Ian Britten wrote:
> Behdad Esfahbod wrote:
>
> > What closing? There is no closing automatically added.
>
> Well, _someone_ is adding a closing stroke to all my open glyph
> paths, and it certainly isn't me...
It's FreeType then. So yeah, you should do the same kind of processing on the
cairo_glyph_path() output.
>> If you removed your duplicating hack,
>
> I have - Sorry I didn't clarify that...
>
>> it should be just a matter of:
>>
>> cairo_glyph_path()
>> cairo_stroke()
>>
>> I still am not sure why you insist that you need special processing :P.
>
> Are you saying that's all I should need? If so, then sorry but
> I'm confused what your path suggestions were for... ?
I thought your only problem left was caused by the duplicating (you said your
problem now is to do with the caps).
> Because, using just those two calls was what I originally started
> with, and is why I put in my own calls to FT_Outline_Decompose().
Ok, I suggest:
cairo_glyph_path()
cairo_copy_path()
cairo_new_path()
process path here and add back to cairo_t
cairo_stroke()
All this in your UserFont render callback.
> Drawing my (open) glyphs with just those calls (None of the new path
> stuff you were talking about) results in the problematic closing
> strokes.
No I'm not saying. But I didn't know that's happening. Previously you said
if you fill them it happens, and that's expected because fill() does implicit
close_path. But cairo_stroke doesn't. If it's happening with cairo_stroke(),
then the closing is coming from FreeType, which actually I'm not surprised at
all, since FreeType is designed for contour fonts.
behdad
> Are you saying it shouldn't? I had naively assumed that
> cairo_glyph_path() eventually called FT_Outline_Decompose()
> itself, since it's an FT font I'm rendering. If Cairo does, then
> that's who is adding the extra point (And what I'm trying to bypass).
> OTOH, if Cairo is extracting the outlines from the FT_Face itself,
> then it might be in there somewhere...
>
> [ Note I'm outputting to PDF - Might there maybe be some sort of
> 'closepath' instruction being issues, as opposed to an extra
> data point? Dunno (And I don't know how to read a PDF file) ]
>
> Sorry if I'm being dense, but I suddenly feel like I'm going in
> a circle...
> Ian
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
More information about the cairo
mailing list