[cairo] Rendering line fonts

Behdad Esfahbod behdad at behdad.org
Thu Nov 27 08:29:10 PST 2008

Ian Britten wrote:
> Ok, many thanks for this higher-level description!  I see what's
> going on now.  Also, I hadn't seen, nor appreciated, the difference
> between cairo_glyph_path() vs cairo_show_glyphs().  The
> cairo_glyph_path() is the key nugget that I think will solve my
> problem.  Also, I think it will also help be with some future stuff
> I'll need to support, like text "halos" [ See the text on Google Maps ]


> Now that I see what's going on, this begs the question:  Do I actually
> *need* to use any of the user font stuff?

This is a great question and it shows you really get what's going on now :).
The reason is very simple: if you do glyph_path;stroke without user fonts, you
get path in your PDF.  If you do it in user fonts, you get selectable text.


>  Why can't I just:
>      cairo_face = cairo_ft_font_face_create_for_ft_face (ft_face);
>      cairo_set_font_face(cr, cairo_face);
>      cairo_set_font_matrix(cr, matrix);
>      if (my stroke font)
>      {
>              cairo_set_line_width(width);
>              // Set whatever else...  Cap/Join/etc...
>              cairo_glyph_path (cr, &cairo_glyph, 1);
>              cairo_stroke (cr);
>      }
>      else
>      {
>              cairo_show_glyphs(cr, &cairo_glyph, 1);
>      }
> Initial hacking/playing shows positive results :) but I'm left
> wondering what I might be missing/omitting?  It sure seems
> simpler... [ Keeping in mind the framework I'm fitting into ]
> As always, many thanks for your help (And patience)!
> Ian
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list