<div>Hmm...</div>
<div>&nbsp;</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>&nbsp;</div>
<div>&lt;xsl:variable name=&quot;numlines&quot;&gt;&lt;rx:number-of-lines font-family=&quot;MyriadPro&quot; font-size=&quot;12pt&quot; width=&quot;210mm&quot; text=&quot;This is a long line and I wonder how many lines it will end up wrapping on. Perhaps two or three, who knows?&quot; /&gt;&lt;/xsl:variable&gt;</div>

<div>&nbsp;</div>
<div>&lt;xsl:choose&gt;</div>
<div>&lt;xsl:when test=&quot;$numlines = 1&quot;&gt;.........&lt;/xsl:when&gt;</div>
<div>&lt;xsl:when test=&quot;$numlines = 2&quot;&gt;.........&lt;/xsl:when&gt;</div>
<div>&lt;xsl:otherwise&gt;........&lt;/xsl:otherwise&gt;</div>
<div>&lt;/xsl:choose&gt;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>... or even better &lt;rx:number-of-lines&gt; would allow nested blocks inside it for when you have words that are bolded and others which aren&#39;t.<br><br></div>
<div class="gmail_quote">2008/12/10 Jim Mott <span dir="ltr">&lt;<a href="mailto:jmott@pubdata.com">jmott@pubdata.com</a>&gt;</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>&nbsp;</div>
<div><font face="Arial" size="2">I don&#39;t have any special insight on this, but I was thinking before&nbsp;when I read your first posting that the engine would not be able to know the height on just one pass precisely&nbsp;because of the variable height of the text. It seems to me&nbsp;you have to get feedback from the engine as an intermediary stage&nbsp;and provide the height on a second pass.</font></div>

<div><font face="Arial" size="2"></font>&nbsp;</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>&nbsp;</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>&nbsp;</div>
<div>Thanks for your email.</div>
<div>Unfortunately it&#39;s the height I don&#39;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">&lt;<a href="mailto:agagarinov@renderx.com" target="_blank">agagarinov@renderx.com</a>&gt;</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>&lt;fo:block line-height=&quot;0pt&quot;&gt;<br>&nbsp;&lt;fo:external-graphic<br>&nbsp; &nbsp; &nbsp; &nbsp;content-width=&quot;scale-to-fit&quot; content-height=&quot;scale-to-fit&quot;<br>&nbsp; &nbsp; &nbsp; &nbsp;scaling=&quot;non-uniform&quot; scaling-method=&quot;resample-any-method&quot;&gt;<br>
</div>...<br></blockquote><br>You should set the viewport&#39;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 &#39;auto&#39; and it means that viewport&#39;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>&lt;fo:external-graphic width=&quot;100%&quot; content-width=&quot;scale-to-fit&quot; src=&quot;...&quot;&gt;<br>
<br>But you cannot scale the image&#39;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>&nbsp;Alexey Gagarinov<br>RenderX 
<div>
<div></div>
<div><br><br>-------------------<br>(*) To unsubscribe, send a message with words &#39;unsubscribe xep-support&#39;<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>