Re: [xep-support] Re: Image scaling

From: Mark Cilia Vincenti <markciliavincenti@gmail.com>
Date: Wed Dec 10 2008 - 07:08:28 PST

Hmm...

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 :)

<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>

<xsl:choose>
<xsl:when test="$numlines = 1">.........</xsl:when>
<xsl:when test="$numlines = 2">.........</xsl:when>
<xsl:otherwise>........</xsl:otherwise>
</xsl:choose>

... 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.

2008/12/10 Jim Mott <jmott@pubdata.com>

> Mark,
>
> 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.
>
> Jim Mott
>
> ----- Original Message -----
>
> *From:* Mark Cilia Vincenti <markciliavincenti@gmail.com>
> *To:* xep-support@renderx.com
> *Sent:* December 10, 2008 3:33 AM
> *Subject:* Re: [xep-support] Re: Image scaling
>
> Hi Alexei,
>
> Thanks for your email.
> 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.
>
> 2008/12/10 Alexei Gagarinov <agagarinov@renderx.com>
>
>> Hi Mark,
>>
>> <fo:block line-height="0pt">
>>> <fo:external-graphic
>>> content-width="scale-to-fit" content-height="scale-to-fit"
>>> scaling="non-uniform" scaling-method="resample-any-method">
>>> ...
>>>
>>
>> You should set the viewport's area using @width and @height attributes on
>> the fo:external-graphic element.
>>
>> 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.
>>
>> And what you do is scaling the intrinsic size of the image to the ...
>> yeah, to the same value.
>>
>> So, in order to scale the graphics width to a table cell, you need the
>> following:
>> <fo:external-graphic width="100%" content-width="scale-to-fit" src="...">
>>
>> 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.
>> So you should know the height of the surrounding box ahead and specify
>> this length as a value of @height on fo:external-graphic.
>>
>> Regards,
>> Alexey Gagarinov
>> RenderX
>>
>>
>> -------------------
>> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
>> in the body of the message to majordomo@renderx.com from the address
>> you are subscribed from.
>> (*) By using the Service, you expressly agree to these Terms of Service
>> http://www.renderx.com/terms-of-service.html
>>
>
>

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Wed Dec 10 07:37:49 2008

This archive was generated by hypermail 2.1.8 : Wed Dec 10 2008 - 07:37:56 PST