[cairo] cairo without fontconfig revisited
Chris Wilson
chris at chris-wilson.co.uk
Thu Jul 23 12:43:06 PDT 2009
On Thu, 2009-07-23 at 15:35 -0400, cu wrote:
> Thanks, all - and indeed I was primarily unclear as to where the patch
> is. However, more importantly, it appears that Cairo 1.9.2 has a
> configure option to disable fontconfig, as it turns out. So we took a
> plunge and switched to 1.9.2 on the platform where fontconfig gave most
> trouble. The new method works just fine and we have a much better
> control of the fonts we are using.
Excellent, please do let us know if encounter any problems. But hearing
about success stories is reassuring as well!
> The other issue was usage of the direct FreeType API. It is in the cairo
> API description, but there are no examples as far as I could see. It
> turned out to be very manageable but some additional documentation on
> the topic (perhaps a code snippet showing
> FT_New_Face/cairo_ft_font_face_create_for_ft_face/cairo_scaled_font_create
> would be helpful).
We always welcome suggestions for documentation improvements. So if you
have example, or an explanation you would like to share... ;-)
> Somewhat tangentially, it appears that once scaled font is created based
> on unscaled font, the unscaled font can be safely destroyed?
Ok, this is worrying. So long as you keep the FT_Face alive until the
font-face has been destroyed by cairo (i.e. by only calling
FT_Face_Done() from the cairo_font_face_set_user_data() destroy
function) then everything should work. You will be able to destroy your
reference to the font-face, as it will be kept alive by the scaled fonts
created from it. If you're unsure, post a small snippet highlight the
problem you have and we'll see if we can help.
Have fun using Cairo!
-ickle
More information about the cairo
mailing list