[NTG-context] Scale image in MetaPost, maintaining aspect ratio

Hans Hagen j.hagen at xs4all.nl
Sun Jul 8 11:21:55 CEST 2018


On 7/8/2018 11:02 AM, Marco Patzer wrote:
> On Sun, 8 Jul 2018 10:39:52 +0200
> Hans Hagen <j.hagen at xs4all.nl> wrote:
> 
>> On 7/8/2018 1:45 AM, Marco Patzer wrote:
>>> On Sat, 7 Jul 2018 14:27:38 -0600
>>> Alan Braslau <braslau.list at comcast.net> wrote:
>>>    
>>>> For "historic" reasons,
>>>>       draw externalfigure "cow" scaled 5cm ;
>>>> normalizes the figure to a square. This will not be changed as it
>>>> is a very old feature of MetaFun.
>>>>
>>>> The solution is
>>>>       draw rawtextext("\externalfigure[cow]") xsized 5cm ;
>>>> where one can use xsized, ysized or xysized (taking a pair).
>>>
>>> That works indeed. Thanks.
>> draw figure "...." ...
> 
> That's what I was looking for. Thanks.
the "externalfigure" variant is an old one that had to deal with 
dimensions in a way that avoids overflows

in a future context (read luatex 1.09+) we go one-pass-mp so we can have 
a different approach (i never wanted to add a ton of code for images) so 
there externalfigure will scale proportionally too

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list