* Missing graphic in MPpage when viewing in Apple MAC Preview or GIMP 2.10 but not Adobe
@ 2020-08-15 15:39 Keith McKay
2020-08-15 17:35 ` Taco Hoekwater
0 siblings, 1 reply; 3+ messages in thread
From: Keith McKay @ 2020-08-15 15:39 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2291 bytes --]
Dear List
I have come across a problem which I don't think is due to ConTeXt but
I'm hopping the great and the good of this list may be able to explain
what is going on.
The code below produces an MPpage with a shaded background and two
graphics along with a line of outlined text. When I view in Adobe (or
the output from TeXworks) I see everything as it should be. However, I
wanted to convert the MPpage to a jpeg file and when I opened the pdf in
either Apple MAC Preview or Gimp 2.10 the two graphics are missing, and
I have no idea why.
Could someone explain a way round this? Here is the code.
Thanks
Keith
%%%%%%%%%%%%%%%%%%%%%%%%%% system >
system > ConTeXt ver: 2020.07.29 18:36 LMTX fmt: 2020.7.29 int:
english/english
system >
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setuppapersize [A5, portrait]
\usecolors[crayola]
\starttext
\startMPpage
StartPage;
width := PaperWidth ; height := PaperHeight ; unit := cm ;
definecolor [ name = "MyColor1", r = 0.781, g = 0.5, b = 0.5 ] ;
definecolor [ name = "MyColor3", r = 1, g = 1, b = 0.7983 ] ;
draw lmt_shade [
path = unitsquare xscaled 14.8cm yscaled 21cm,
direction = "up",
alternative = "linear",
colors = { "MyColor1", "MyColor3" },
] ;
z0 = (60,60);
z1 = z0 rotated 120;
z2 = z1 rotated 240;
path carre;
carre = z0--z1--z2--cycle;
picture pic;
pic := image(
numeric d; d := 0.0005;
for i=1 step -d until d:
fill carre scaled i shifted (3.9cm,17cm) withcolor((1 +
i)*(\MPcolor{VividTangerine})) ;
fill carre rotated (45) scaled i shifted (3.9cm,17cm) withcolor((1 +
i)*(\MPcolor{VividTangerine})) ;
fill carre rotated (90) scaled i shifted (3.9cm,17cm) withcolor((1 +
i)*(\MPcolor{VividTangerine})) ;
fill carre rotated (135) scaled i shifted (3.9cm,17cm) withcolor((1 +
i)*(\MPcolor{VividTangerine})) ;
fill carre rotated (180) scaled i shifted (3.9cm,17cm) withcolor((1 +
i)*(\MPcolor{VividTangerine})) ;
fill carre rotated (225) scaled i shifted (3.9cm,17cm) withcolor((1 +
i)*(\MPcolor{VividTangerine})) ;
endfor;);
draw pic rotatedaround(center pic, 270);
draw pic rotatedaround(center pic, 90) shifted (7cm,-13cm) ;
draw lmt_outline [
text = "Page 18"
kind = "draw",
drawcolor = "VividTangerine",
] xsized TextWidth shifted (1cm,7.67cm);
StopPage;
\stopMPpage
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 8054 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Missing graphic in MPpage when viewing in Apple MAC Preview or GIMP 2.10 but not Adobe
2020-08-15 15:39 Missing graphic in MPpage when viewing in Apple MAC Preview or GIMP 2.10 but not Adobe Keith McKay
@ 2020-08-15 17:35 ` Taco Hoekwater
2020-08-16 10:55 ` Keith McKay
0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2020-08-15 17:35 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Keith,
It took me a while before I saw it, but I think you wanted to type in
z0 = (60,60);
z1 = z0 rotated 120;
z2 = z0 rotated 240;
instead of
z0 = (60,60);
z1 = z0 rotated 120;
z2 = z1 rotated 240;
because the latter puts z2 at z0, resulting in a path that is a straight line. The fact that AR displays anything at all is probably some form of correction like "fill of empty path == single pixel line”.
Best wishes,
Taco
> On 15 Aug 2020, at 17:39, Keith McKay <mckaymeister@gmail.com> wrote:
>
> Dear List
>
> I have come across a problem which I don't think is due to ConTeXt but I'm hopping the great and the good of this list may be able to explain what is going on.
>
> The code below produces an MPpage with a shaded background and two graphics along with a line of outlined text. When I view in Adobe (or the output from TeXworks) I see everything as it should be. However, I wanted to convert the MPpage to a jpeg file and when I opened the pdf in either Apple MAC Preview or Gimp 2.10 the two graphics are missing, and I have no idea why.
>
> Could someone explain a way round this? Here is the code.
>
> Thanks
>
> Keith
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%
> system >
>
> system > ConTeXt ver: 2020.07.29 18:36 LMTX fmt: 2020.7.29 int: english/english
> system >
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
> \setuppapersize [A5, portrait]
> \usecolors[crayola]
> \starttext
> \startMPpage
> StartPage;
> width := PaperWidth ; height := PaperHeight ; unit := cm ;
> definecolor [ name = "MyColor1", r = 0.781, g = 0.5, b = 0.5 ] ;
> definecolor [ name = "MyColor3", r = 1, g = 1, b = 0.7983 ] ;
> draw lmt_shade [
> path = unitsquare xscaled 14.8cm yscaled 21cm,
> direction = "up",
> alternative = "linear",
> colors = { "MyColor1", "MyColor3" },
> ] ;
> z0 = (60,60);
> z1 = z0 rotated 120;
> z2 = z1 rotated 240;
> path carre;
> carre = z0--z1--z2--cycle;
> picture pic;
> pic := image(
> numeric d; d := 0.0005;
> for i=1 step -d until d:
> fill carre scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
> fill carre rotated (45) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
> fill carre rotated (90) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
> fill carre rotated (135) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
> fill carre rotated (180) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
> fill carre rotated (225) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
> endfor;);
> draw pic rotatedaround(center pic, 270);
> draw pic rotatedaround(center pic, 90) shifted (7cm,-13cm) ;
> draw lmt_outline [
> text = "Page 18"
> kind = "draw",
> drawcolor = "VividTangerine",
> ] xsized TextWidth shifted (1cm,7.67cm);
> StopPage;
> \stopMPpage
> \stoptext
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
>
Taco Hoekwater
Elvenkind BV
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Missing graphic in MPpage when viewing in Apple MAC Preview or GIMP 2.10 but not Adobe
2020-08-15 17:35 ` Taco Hoekwater
@ 2020-08-16 10:55 ` Keith McKay
0 siblings, 0 replies; 3+ messages in thread
From: Keith McKay @ 2020-08-16 10:55 UTC (permalink / raw)
To: ntg-context
Thanks Taco!
I have been playing about with an example from this site
https://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html
which was originally for a square and I obviously didn't get my angles
right. Thanks for spotting it. I'm beginning to appreciate where the Fun
in MetaFun comes from.
Best Wishes
Keith
On 15/08/2020 18:35, Taco Hoekwater wrote:
> Hi Keith,
>
> It took me a while before I saw it, but I think you wanted to type in
>
> z0 = (60,60);
> z1 = z0 rotated 120;
> z2 = z0 rotated 240;
>
> instead of
>
> z0 = (60,60);
> z1 = z0 rotated 120;
> z2 = z1 rotated 240;
>
> because the latter puts z2 at z0, resulting in a path that is a straight line. The fact that AR displays anything at all is probably some form of correction like "fill of empty path == single pixel line”.
>
> Best wishes,
> Taco
>
>> On 15 Aug 2020, at 17:39, Keith McKay <mckaymeister@gmail.com> wrote:
>>
>> Dear List
>>
>> I have come across a problem which I don't think is due to ConTeXt but I'm hopping the great and the good of this list may be able to explain what is going on.
>>
>> The code below produces an MPpage with a shaded background and two graphics along with a line of outlined text. When I view in Adobe (or the output from TeXworks) I see everything as it should be. However, I wanted to convert the MPpage to a jpeg file and when I opened the pdf in either Apple MAC Preview or Gimp 2.10 the two graphics are missing, and I have no idea why.
>>
>> Could someone explain a way round this? Here is the code.
>>
>> Thanks
>>
>> Keith
>>
>> %%%%%%%%%%%%%%%%%%%%%%%%%%
>> system >
>>
>> system > ConTeXt ver: 2020.07.29 18:36 LMTX fmt: 2020.7.29 int: english/english
>> system >
>>
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%
>>
>>
>> \setuppapersize [A5, portrait]
>> \usecolors[crayola]
>> \starttext
>> \startMPpage
>> StartPage;
>> width := PaperWidth ; height := PaperHeight ; unit := cm ;
>> definecolor [ name = "MyColor1", r = 0.781, g = 0.5, b = 0.5 ] ;
>> definecolor [ name = "MyColor3", r = 1, g = 1, b = 0.7983 ] ;
>> draw lmt_shade [
>> path = unitsquare xscaled 14.8cm yscaled 21cm,
>> direction = "up",
>> alternative = "linear",
>> colors = { "MyColor1", "MyColor3" },
>> ] ;
>> z0 = (60,60);
>> z1 = z0 rotated 120;
>> z2 = z1 rotated 240;
>> path carre;
>> carre = z0--z1--z2--cycle;
>> picture pic;
>> pic := image(
>> numeric d; d := 0.0005;
>> for i=1 step -d until d:
>> fill carre scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
>> fill carre rotated (45) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
>> fill carre rotated (90) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
>> fill carre rotated (135) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
>> fill carre rotated (180) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
>> fill carre rotated (225) scaled i shifted (3.9cm,17cm) withcolor((1 + i)*(\MPcolor{VividTangerine})) ;
>> endfor;);
>> draw pic rotatedaround(center pic, 270);
>> draw pic rotatedaround(center pic, 90) shifted (7cm,-13cm) ;
>> draw lmt_outline [
>> text = "Page 18"
>> kind = "draw",
>> drawcolor = "VividTangerine",
>> ] xsized TextWidth shifted (1cm,7.67cm);
>> StopPage;
>> \stopMPpage
>> \stoptext
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>>
>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___________________________________________________________________________________
>>
> Taco Hoekwater
> Elvenkind BV
>
>
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-16 10:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-15 15:39 Missing graphic in MPpage when viewing in Apple MAC Preview or GIMP 2.10 but not Adobe Keith McKay
2020-08-15 17:35 ` Taco Hoekwater
2020-08-16 10:55 ` Keith McKay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).