From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: Thangalin via ntg-context <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@freedom.nl>
Subject: Re: Radial and linear gradients
Date: Wed, 14 Dec 2022 09:45:30 +0100 [thread overview]
Message-ID: <95c7e359-39e6-aab1-6197-66434117980d@freedom.nl> (raw)
In-Reply-To: <CAANrE7ruzUuAHUj+CeWcXA_Bkgz_rOorm+M50mqO2srYHmvUeA@mail.gmail.com>
On 12/14/2022 5:46 AM, Thangalin via ntg-context wrote:
> Hi there!
>
> Any thoughts on implementing SVG gradients in MetaPost?
>
> % SOF
> \startbuffer[csvg]
> <svg xmlns="http://www.w3.org/2000/svg"
> xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 115.669
> 115.669"><defs><radialGradient xlink:href="#a" id="b" cx="124.515"
> cy="167.114" r="57.834" fx="124.515" fy="167.114"
> gradientTransform="translate(-17.77 -18.4)"
> gradientUnits="userSpaceOnUse"/><linearGradient id="a"><stop
> offset="0"/><stop offset="1"
> stop-opacity="0"/></linearGradient></defs><g
> transform="translate(-48.91 -90.879)"><path fill="red"
> fill-opacity=".5" d="M48.769 90.936H164.64V206.96H48.769z"/><circle
> cx="106.745" cy="148.713" r="57.834" fill="url(#b)"
> fill-rule="evenodd"/></g></svg>
> \stopbuffer
>
> \starttext
> \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
> \stoptext
> % EOF
>
> See attached a comparison of the PDF generated using ConTeXt and the
> PNG file generated by exporting from Inkscape.
these gradients definitions get crazier by the day ... does inkscape
output a bitmap or vector pdf
given what we do with context i'm not sure we should support everything
that pops up (mapping all onto mp and then pdf ...)
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2022-12-14 8:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 4:46 Thangalin via ntg-context
2022-12-14 8:45 ` Hans Hagen via ntg-context [this message]
2022-12-14 20:45 ` Thangalin via ntg-context
2022-12-14 22:29 ` Hans Hagen via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95c7e359-39e6-aab1-6197-66434117980d@freedom.nl \
--to=ntg-context@ntg.nl \
--cc=j.hagen@freedom.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).