<div>Hmm...</div>
<div> </div>
<div>A RenderX extension that takes a line of text, a font family, a font-size, width of a block in pixels and outputs the number of lines this would fit on would be nice :)</div>
<div> </div>
<div><xsl:variable name="numlines"><rx:number-of-lines font-family="MyriadPro" font-size="12pt" width="210mm" text="This is a long line and I wonder how many lines it will end up wrapping on. Perhaps two or three, who knows?" /></xsl:variable></div>
<div> </div>
<div><xsl:choose></div>
<div><xsl:when test="$numlines = 1">.........</xsl:when></div>
<div><xsl:when test="$numlines = 2">.........</xsl:when></div>
<div><xsl:otherwise>........</xsl:otherwise></div>
<div></xsl:choose></div>
<div> </div>
<div> </div>
<div>... or even better <rx:number-of-lines> would allow nested blocks inside it for when you have words that are bolded and others which aren't.<br><br></div>
<div class="gmail_quote">2008/12/10 Jim Mott <span dir="ltr"><<a href="mailto:jmott@pubdata.com">jmott@pubdata.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">Mark,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I don't have any special insight on this, but I was thinking before when I read your first posting that the engine would not be able to know the height on just one pass precisely because of the variable height of the text. It seems to me you have to get feedback from the engine as an intermediary stage and provide the height on a second pass.</font></div>
<div><font face="Arial" size="2"></font> </div><font color="#888888">
<div><font face="Arial" size="2">Jim Mott</font></div></font>
<div>
<div></div>
<div class="Wj3C7c">
<div><font face="Arial" size="2"></font> </div>
<div>----- Original Message ----- </div>
<blockquote style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<div style="BACKGROUND: #e4e4e4; FONT: 10pt arial"><b>From:</b> <a title="markciliavincenti@gmail.com" href="mailto:markciliavincenti@gmail.com" target="_blank">Mark Cilia Vincenti</a> </div>
<div style="FONT: 10pt arial"><b>To:</b> <a title="xep-support@renderx.com" href="mailto:xep-support@renderx.com" target="_blank">xep-support@renderx.com</a> </div>
<div style="FONT: 10pt arial"><b>Sent:</b> December 10, 2008 3:33 AM</div>
<div style="FONT: 10pt arial"><b>Subject:</b> Re: [xep-support] Re: Image scaling</div>
<div><br></div>
<div>Hi Alexei,</div>
<div> </div>
<div>Thanks for your email.</div>
<div>Unfortunately it's the height I don't know, because if the text in the box wraps, then it would increase the height. I tried cheating using reference-orientation but it did not work.<br><br></div>
<div class="gmail_quote">2008/12/10 Alexei Gagarinov <span dir="ltr"><<a href="mailto:agagarinov@renderx.com" target="_blank">agagarinov@renderx.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Mark,<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><fo:block line-height="0pt"><br> <fo:external-graphic<br> content-width="scale-to-fit" content-height="scale-to-fit"<br> scaling="non-uniform" scaling-method="resample-any-method"><br>
</div>...<br></blockquote><br>You should set the viewport's area using @width and @height attributes on the fo:external-graphic element.<br><br>If @width and @height are omitted then they are treated as 'auto' and it means that viewport's area equals to the intrinsic size of the graphic.<br>
<br>And what you do is scaling the intrinsic size of the image to the ... yeah, to the same value.<br><br>So, in order to scale the graphics width to a table cell, you need the following:<br><fo:external-graphic width="100%" content-width="scale-to-fit" src="..."><br>
<br>But you cannot scale the image's height to an arbitrary block (a table cell in your example) using a percentage value because the height of this block depends of its content.<br>So you should know the height of the surrounding box ahead and specify this length as a value of @height on fo:external-graphic.<br>
<br>Regards,<br> Alexey Gagarinov<br>RenderX
<div>
<div></div>
<div><br><br>-------------------<br>(*) To unsubscribe, send a message with words 'unsubscribe xep-support'<br>in the body of the message to <a href="mailto:majordomo@renderx.com" target="_blank">majordomo@renderx.com</a> from the address<br>
you are subscribed from.<br>(*) By using the Service, you expressly agree to these Terms of Service <a href="http://www.renderx.com/terms-of-service.html" target="_blank">http://www.renderx.com/terms-of-service.html</a><br>
</div></div></blockquote></div><br></blockquote></div></div></div></blockquote></div><br>