[cairo] Using Cairo and Pango to scroll text on video

Perry Werneck perry.werneck at gmail.com
Sat May 12 07:35:19 PDT 2012


I *think* this 1x1 surface is not needed; Why not use the original surface
as reference to get the text extents and then create a similar surface
for the text? If they´re similar the text size will not change.

2012/5/11 Maarten Bosmans <mkbosmans at gmail.com>

> 2012/5/11  <robertk54 at aol.com>:
> > Is there a way to render the entire text to a
> > cairo surface whole?  As far as I can see one needs a cairo surface
> before
> > creating the pango layout.  However, in my case, I do not know the
> > dimensions of the cairo surface needed until after I start working in
> pango.
> You need to do it in 2 steps. First create a 1x1 surface and a
> corresponding layout. Then use the measured size to create a second
> surface to dray the text to.
> The layouting of the text is done twice in this approach. I don't know
> of a way around that, but don't think it is a problem, performance
> wise.
> Maarten
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

Perry Werneck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120512/67952fe6/attachment.html>

More information about the cairo mailing list