Hello, I think it would be very useful to have a function which return a path with the outmost or inmost path positions. So you could set text direct on these shapes. example of this function: cairo_path = cairo_out_path(cairo_t *cr); cairo_path = cairo_in_path(cairo_t *cr); Then you could text the text on a shape like in my attachment.
Created attachment 32384 [details] sample view
What you actually want is not very clear. Cairo might expose some functions to test if a point is in a (closed) path (depending on the fill rule), but that doesn't seem to be what you're looking for. Your examples shows two paths which are not closed and to me it seems that the text in the circle arbitrarily stops when it reaches the radiuses. Could you try explaining the feature you want more in detail?
Well, I only want to write text in shapes which I have painted. So I need at a defined position where the text inside a shape could reach out that the text can begin at a new line because everything should be written inside. What's the name of the function which returns a point of a closed path? Maybe it could be the right thing for me.
(In reply to comment #3) > Well, I only want to write text in shapes which I have painted. So I need at a > defined position where the text inside a shape could reach out that the text > can begin at a new line because everything should be written inside. > > What's the name of the function which returns a point of a closed path? Maybe > it could be the right thing for me. cairo_in_fill() and cairo_in_stroke() test if a point is inside the drawn part of a path, but I'm afraid that they are not immediately useful for your purpose. Vikloud solves a related problem (drawing a "cloud" of text strings without collisions), so you might want to have a look at its source: http://vikloud.git.sourceforge.net/ IIRC the approach used in Vikloud is checking if the text extents collide with the colored pixels of the image.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/224.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.