From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106931 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Keith McKay Newsgroups: gmane.comp.tex.context Subject: Unexpected result when using PaperHeight and MetaFUun Date: Sun, 19 Apr 2020 12:15:31 +0100 Organization: The PotHole Press Message-ID: <0b512c09-2e15-7dc4-277f-cc802d894cef@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3766830136342453794==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="91997"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 19 13:15:59 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQ7va-000No4-8r for gctc-ntg-context-518@m.gmane-mx.org; Sun, 19 Apr 2020 13:15:58 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6691D1832DD; Sun, 19 Apr 2020 13:15:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UgZfyfwYS-xz; Sun, 19 Apr 2020 13:15:35 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8498818332A; Sun, 19 Apr 2020 13:15:35 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7C02618332A for ; Sun, 19 Apr 2020 13:15:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sRrtfVyNl-lL for ; Sun, 19 Apr 2020 13:15:33 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.45; helo=mail-wr1-f45.google.com; envelope-from=mckaymeister@gmail.com; receiver= Original-Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id E2F161832DD for ; Sun, 19 Apr 2020 13:15:33 +0200 (CEST) Original-Received: by mail-wr1-f45.google.com with SMTP id k1so8437371wrx.4 for ; Sun, 19 Apr 2020 04:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:organization:to:subject:message-id:date:user-agent :mime-version:content-language; bh=wnVccidBSeF1YyoplvJA/QiTkj+vxQi9EPisSiyY4VU=; b=AcU7OSDTnlbFeSue1DhqNCLrTNSPPh8d/ZZVolM+jWCE+6rK5bsDMWiUmNAjgbYLlc mzS1fjeMAZecg5U6FKPbtLp57WoeAlrtSV8nLwvpS43Xx1uQQILOy7jX7Vr7Pgx4TahS Qk58IDiVWldvTjV1xn5I7RQ58ohcke4qclfFsWgzDH2yipWJswYgPCZVRCPR3qjwV2Ip /BOdxN0DR3ra0aBlTa3M8mvHqu28lzeJHy2jL9GankNgN137FDwiVERw2O5hWCZqHEDq 28bWbIT4PTlguIbl62XIYQdXEwk7LVBQufQsPWz71Y8pIhLLelmn4mtJ1VHRJ6eIwM9g RTcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:organization:to:subject:message-id:date :user-agent:mime-version:content-language; bh=wnVccidBSeF1YyoplvJA/QiTkj+vxQi9EPisSiyY4VU=; b=OlP2MfCHHs2eNwK5PlZQzWWxpt9So554AIxkqeIUYNxzH4X+DfvYAcUaWfOWmBnozm OmApaimc0GXiQtyH3j8mtLopF7AzmrS1Hl6lcy7+YCWfdii07K4e+PNjvg/93riGMhQV 00geUeEZtjnO88o/hH5HpDZtwzPwF8rCdcNaEzYJhBW1QWHkd5Nbk3R+7u7puFD7Sk60 2+gCCA3IYXrEqoSnuPAiZ1mILfQRHKV+X03tz95oLoulAConv1wI2grlyIKGvUcjxVzF TjVLw1dp7mjx7pUGmoWD8S8ix/INLhxIjjZJ/Eex+oJ/GlmezOwaQcYFeeUGO4rKr0bl k3aQ== X-Gm-Message-State: AGi0PuYEF01n4aa1MPcVGbUs2KxjFt4ErBWc9a1snGbbWcPa8f7XI1Yr qx+CD02+L+BJgwNOMyfOWZ7TAnsc X-Google-Smtp-Source: APiQypKVUeFP1fiqypgBXXasQs3k/kX31p6XD0EVyjawR00w/Kpcm9SdeU1tEFC/rlwP8yZ9JiX3eg== X-Received: by 2002:a5d:6646:: with SMTP id f6mr13080629wrw.318.1587294933176; Sun, 19 Apr 2020 04:15:33 -0700 (PDT) Original-Received: from Keiths-Mac-mini.local (cpc100294-uddi29-2-0-cust139.20-3.cable.virginm.net. [82.42.59.140]) by smtp.googlemail.com with ESMTPSA id y20sm40904329wra.79.2020.04.19.04.15.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Apr 2020 04:15:32 -0700 (PDT) Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:106931 Archived-At: This is a multi-part message in MIME format. --===============3766830136342453794== Content-Type: multipart/alternative; boundary="------------51B5ED426D3CE6E49540BCCF" Content-Language: en-US This is a multi-part message in MIME format. --------------51B5ED426D3CE6E49540BCCF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Dear All I have problem understanding what is happening in the MWE below which is different from what I expected. I have created a shaded background using MetaFun with dimensions PaperWidth by PaperHeight which mimics \setuppapersize[A4,landscape} as expected.  I then within \starttext \startMPpage... \stopMPpage \stoptext created a stripe of the shaded background, xscaled 2cm y scaled PaperHeight, but reversed, expecting it to cover the background top to bottom. However the top of the stripe seems to start at 10.5cm which is suspiciously half the height of A4, Landscape i.e. 21cm. I confirmed this by changing the shifted command to, shifted (19cm,10.5cm), and the stripe is positioned as expected. Am I missing something obvious in how MetaFun handles coordinates? I have asumed that in MetaFun, (0,0) is the bottom left corner. Or is it how I applied the shifted command? I'm using LuaMetaTex Version 2.05.01 ConTeXt ver: 2020.04.03 10:31 MKIV beta fmt: 2020.4.6 int: english/english Thanks and stay safe. Best Wishes Keith McKay %%%%%%%%%%% MWE %%%%%%%%%%%%%%% \setuppapersize[A4,landscape] \definelayer[mybg] [x=0mm, y=0mm, width=\paperwidth, height=\paperheight] % let the layer cover the full paper \startuniqueMPgraphic{blueShade} draw lmt_shade [ path = fullsquare xyscaled(PaperWidth,PaperHeight), direction = "up", alternative = "linear", colors = { "red", "blue" }, ]; \stopuniqueMPgraphic \setlayer[mybg]{\uniqueMPgraphic{blueShade}} \setupbackgrounds[page][background={mybg}] \starttext \startMPpage StartPage ; %Result Left draw lmt_shade [ path = fullsquare xscaled 2cm yscaled PaperHeight, direction = "down", alternative = "linear", colors = { "red", "blue" }, ]shifted (12cm,0cm); %Result Right draw lmt_shade [ path = fullsquare xscaled 2cm yscaled PaperHeight, direction = "down", alternative = "linear", colors = { "red", "blue" }, ] shifted (19cm,10.5cm); StopPage ; \stopMPpage \stoptext --------------51B5ED426D3CE6E49540BCCF Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Dear All

I have problem understanding what is happening in the MWE below which is different from what I expected.

I have created a shaded background using MetaFun with dimensions PaperWidth by PaperHeight which mimics \setuppapersize[A4,landscape} as expected.  I then within \starttext \startMPpage... \stopMPpage \stoptext created a stripe of the shaded background, xscaled 2cm y scaled PaperHeight, but reversed, expecting it to cover the background top to bottom. However the top of the stripe seems to start at 10.5cm which is suspiciously half the height of A4, Landscape i.e. 21cm. I confirmed this by changing the shifted command to, shifted (19cm,10.5cm), and the stripe is positioned as expected.

Am I missing something obvious in how MetaFun handles coordinates? I have asumed that in MetaFun, (0,0) is the bottom left corner. Or is it how I applied the shifted command?

I'm using LuaMetaTex Version 2.05.01 ConTeXt ver: 2020.04.03 10:31 MKIV beta fmt: 2020.4.6 int: english/english

Thanks and stay safe.

Best Wishes

Keith McKay

%%%%%%%%%%% MWE %%%%%%%%%%%%%%% \setuppapersize[A4,landscape]

\definelayer[mybg]

[x=0mm, y=0mm,

width=\paperwidth, height=\paperheight] % let the layer cover the full paper

\startuniqueMPgraphic{blueShade}

draw lmt_shade [

path = fullsquare xyscaled(PaperWidth,PaperHeight),

direction = "up",

alternative = "linear",

colors = { "red", "blue" },

];

\stopuniqueMPgraphic

\setlayer[mybg]{\uniqueMPgraphic{blueShade}}

\setupbackgrounds[page][background={mybg}]

\starttext

\startMPpage

StartPage ;

%Result Left

draw lmt_shade [

path = fullsquare xscaled 2cm yscaled PaperHeight,

direction = "down",

alternative = "linear",

colors = { "red", "blue" },

]shifted (12cm,0cm);

%Result Right

draw lmt_shade [

path = fullsquare xscaled 2cm yscaled PaperHeight,

direction = "down",

alternative = "linear",

colors = { "red", "blue" },

] shifted (19cm,10.5cm);

StopPage ;

\stopMPpage

\stoptext

--------------51B5ED426D3CE6E49540BCCF-- --===============3766830136342453794== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============3766830136342453794==--