ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* lmt_outline
@ 2021-03-11  0:38 Mohammad Hossein Bateni
  2021-03-11  4:07 ` lmt_outline Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Mohammad Hossein Bateni @ 2021-03-11  0:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1821 bytes --]

Hello,

Hans said he's in the metapost mode now :)

I have used lmt_outline in the following example and it is really an
improvement over the previous outline "effect" because one can set the
fillcolor and drawcolor separately.  (that was not possible before, right?)

\starttext
\definedfont[dejavusansmono*arabic]
\setupalign[r2l]
\startMPcode
draw lmt_outline [
  text = "سلام",
  drawcolor = "red",
  fillcolor = "white",
  kind = "reverse",
  align = "r2l",
] scaled 3mm;
\stopMPcode
\stoptext

1. This works well on a plain background.  I can specify the background
color in fillcolor and get the outline effect.  When the background is an
image, this does not work too well.  Can we use some clip trickery to allow
for "transparent" fill?  Ideally I want to set the fillcolor to a special
value that would lead to only the outlines drawn.

Now you'd say, that was already available via the outline "effect" before.
Not quite.  If a character is formed by more than one curve in the font,
then we'd see some lines drawn inside the character.  The new lmt_outline
mechanism allows one to paint over those.  Which brings me to the next
problem.

2. The current mechanism draws/fills the characters one by one.  In
Farsi/Arabic where we have joint characters, the boundaries of letters gets
drawn even in the new mechanism.  See the attached PDF of the above MWE.
The text consists of four characters, the 2nd and 3rd form a ligature which
is joined to the 1st character.  The 4th char is not joined and stands
alone.  Now you see the red connection between the 1st char and the
ligature following it.  It would be nice if the text was allowed to be
processed as a whole (or at least be broken into space delimited pieces)
which is drawn and then filled.

Thanks,
MHB

[-- Attachment #1.2: Type: text/html, Size: 2140 bytes --]

[-- Attachment #2: outline.pdf --]
[-- Type: application/pdf, Size: 5941 bytes --]

[-- Attachment #3: 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: lmt_outline
  2021-03-11  0:38 lmt_outline Mohammad Hossein Bateni
@ 2021-03-11  4:07 ` Aditya Mahajan
  2021-03-12  2:05   ` lmt_outline Mohammad Hossein Bateni
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2021-03-11  4:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

On Wed, 10 Mar 2021, Mohammad Hossein Bateni wrote:

> Hello,
> 
> Hans said he's in the metapost mode now :)
> 
> I have used lmt_outline in the following example and it is really an
> improvement over the previous outline "effect" because one can set the
> fillcolor and drawcolor separately.  (that was not possible before, right?)
> 
> \starttext
> \definedfont[dejavusansmono*arabic]
> \setupalign[r2l]
> \startMPcode
> draw lmt_outline [
>   text = "سلام",
>   drawcolor = "red",
>   fillcolor = "white",
>   kind = "reverse",
>   align = "r2l",
> ] scaled 3mm;
> \stopMPcode
> \stoptext
> 
> 1. This works well on a plain background.  I can specify the background
> color in fillcolor and get the outline effect.  When the background is an
> image, this does not work too well.  Can we use some clip trickery to allow
> for "transparent" fill?  Ideally I want to set the fillcolor to a special
> value that would lead to only the outlines drawn.

Have you seen this example on the wiki which uses nofill:

https://wiki.contextgarden.net/Cover_Pages#Empty_or_Transparent_letters

Aditya

[-- 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: lmt_outline
  2021-03-11  4:07 ` lmt_outline Aditya Mahajan
@ 2021-03-12  2:05   ` Mohammad Hossein Bateni
  0 siblings, 0 replies; 3+ messages in thread
From: Mohammad Hossein Bateni @ 2021-03-12  2:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2599 bytes --]

Thanks for the pointer, Aditya.  I had not seen this, but I couldn't get it
to do what I wanted.

I don't fully understand what nofill does and how it interacts with fill
and eofill.  I get strange results sometimes.  One complication, though, is
that the picture I get from lmt_outline seems to cover some part (small
area around the joining part) twice, so that messes up the even/odd logic
of eofill.

Here is one of the things I tried:

\starttext
\definedfont[dejavusansmono*arabic]
\setupalign[r2l]
\startMPcode
picture op; op := lmt_outline [
  text = "سلام",
  kind = "fillup",
  align = "r2l",
] scaled 6mm;
for i within op:
  nofill pathpart i;
endfor;
for i within op:
eofill pathpart i withpen pencircle scaled 1mm;
endfor;
\stopMPcode
\stoptext


On Wed, Mar 10, 2021 at 11:09 PM Aditya Mahajan <adityam@umich.edu> wrote:

> On Wed, 10 Mar 2021, Mohammad Hossein Bateni wrote:
>
> > Hello,
> >
> > Hans said he's in the metapost mode now :)
> >
> > I have used lmt_outline in the following example and it is really an
> > improvement over the previous outline "effect" because one can set the
> > fillcolor and drawcolor separately.  (that was not possible before,
> right?)
> >
> > \starttext
> > \definedfont[dejavusansmono*arabic]
> > \setupalign[r2l]
> > \startMPcode
> > draw lmt_outline [
> >   text = "سلام",
> >   drawcolor = "red",
> >   fillcolor = "white",
> >   kind = "reverse",
> >   align = "r2l",
> > ] scaled 3mm;
> > \stopMPcode
> > \stoptext
> >
> > 1. This works well on a plain background.  I can specify the background
> > color in fillcolor and get the outline effect.  When the background is an
> > image, this does not work too well.  Can we use some clip trickery to
> allow
> > for "transparent" fill?  Ideally I want to set the fillcolor to a special
> > value that would lead to only the outlines drawn.
>
> Have you seen this example on the wiki which uses nofill:
>
> https://wiki.contextgarden.net/Cover_Pages#Empty_or_Transparent_letters
>
>
> Aditya___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3847 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

end of thread, other threads:[~2021-03-12  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11  0:38 lmt_outline Mohammad Hossein Bateni
2021-03-11  4:07 ` lmt_outline Aditya Mahajan
2021-03-12  2:05   ` lmt_outline Mohammad Hossein Bateni

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