Re: Using Cairo and Pango to scroll text on video
Perry Werneck <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAJdAvdLbvG+_zHncn_f-YQVVcg16DwQPwKgpCV7QS8EP5x9u0g@mail.gmail.com> |
Hi, 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 <[email protected]> > 2012/5/11 <[email protected]>: > > 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 > [email protected] > http://lists.cairographics.org/mailman/listinfo/cairo -- Perry Werneck Brasília/DF -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo