[Cairo] mouse pointer and cairo - text selection

Thomas Hunger info at teh-web.de
Wed Oct 15 00:57:16 PDT 2003


Hello, 
I wonder if it would be wrong to decompose text intro lines and splines 
directly in cairo. I can think of these advantages:

- 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.
- geometrically correct "(x,y) is in glyph-shape" could be testet to determine 
if a pointer pointed to a letter. bill: when doing this kind of calculation i 
think the normal on each trapezoid-slope can be used to determine a "distance 
squared" value. the cairo_in operator would traverse thorugh all trapezoids 
and could return smallest and biggest distance. this would work for everythng 
that can be decomposed. i need to rethink about this.
- if there will be gradient operations some time they could be applied to 
text, too,  using cairo_fill.

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

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?
Tom





More information about the cairo mailing list