Hi,<div><br></div><div>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</div><div>for the text? If they´re similar the text size will not change.<br>
<br><div class="gmail_quote">2012/5/11 Maarten Bosmans <span dir="ltr"><<a href="mailto:mkbosmans@gmail.com" target="_blank">mkbosmans@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2012/5/11 <<a href="mailto:robertk54@aol.com">robertk54@aol.com</a>>:<br>
<div class="im">> Is there a way to render the entire text to a<br>
> cairo surface whole? As far as I can see one needs a cairo surface before<br>
> creating the pango layout. However, in my case, I do not know the<br>
> dimensions of the cairo surface needed until after I start working in pango.<br>
<br>
</div>You need to do it in 2 steps. First create a 1x1 surface and a<br>
corresponding layout. Then use the measured size to create a second<br>
surface to dray the text to.<br>
The layouting of the text is done twice in this approach. I don't know<br>
of a way around that, but don't think it is a problem, performance<br>
wise.<br>
<br>
Maarten<br>
--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a></blockquote></div><br><br clear="all"><div><br></div>-- <br>Perry Werneck<br>Brasília/DF<br>
<br>
</div>