Re: Using Cairo and Pango to scroll text on video

Maarten Bosmans <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CA+CvcKRBdW_p--jkS_3SpNMXQ+O8QEQUw=VG62+93zr++Y+feg@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.