[Cairo] mouse pointer and cairo - text selection

Carl Worth cworth at east.isi.edu
Wed Oct 15 05:53:28 PDT 2003


On Oct 15, Thomas Hunger wrote:
 > I wonder if it would be wrong to decompose text intro lines and splines 
 > directly in cairo. I can think of these advantages:

There's definitely a plan to add functions that accept a string or a
list of glyphs and append their outlines to the current path

	void
        cairo_text_path  (cairo_t *ct, const unsigned char *utf8);

        void
        cairo_glyph_path (cairo_t *ct, cairo_glyph_t *glyphs, int num_glyphs);

 > - cairo_stroke operations could be used to create outlined text with all the 
 > cairo capabilities - different cap and line styles, a tolerance to control 
 > rendering accuracy.

Yes, this will be enabled by the above functions.

 > - if there will be gradient operations some time they could be applied to 
 > text, too,  using cairo_fill.

This won't actually require converting text to paths first. Both
cairo_show_text and cairo_show_glyphs will always paint with the
current pattern.

 > a big disadvatage is that font hinting would be ignored completely.

Font hinting is, of course, very important. So the internal
implementation of cairo_show_text and cairo_show_glyphs will likely
never go through a conversion to paths.

 > I know that i am talking about a lot of work, just wanted to know what you 
 > think. Or does freetype already offer these functions?

Freetype does make the outlines available, so implementing the
functions above will likely not be too much work).

-Carl





More information about the cairo mailing list