ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Metapost label text surrounded by white border
@ 2023-11-19 15:41 Emanuel Han via ntg-context
  2023-11-19 18:33 ` [NTG-context] " Henning Hraban Ramm
  0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Han via ntg-context @ 2023-11-19 15:41 UTC (permalink / raw)
  To: ntg-context; +Cc: Emanuel Han


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

I'd like to surround black text with a white 1mm thick border in a Metapost label. Here is my code, which doesn't draw the border at all and which draws the text in white instead of black (I'm using mkiv and mkxl version 2023.09.26 18:19 on osx-arm6):

beginfig(1);
% Define the text and colors
string label_text;
label_text = "Your Text";
color text_color, border_color;
text_color = black;
border_color = white;
% Draw the label with the specified colors
label(textext(label_text) scaled 1.0, origin) withcolor text_color withpen pencircle scaled 1mm withcolor border_color;
endfig;

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

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [NTG-context] Re: Metapost label text surrounded by white border
  2023-11-19 15:41 [NTG-context] Metapost label text surrounded by white border Emanuel Han via ntg-context
@ 2023-11-19 18:33 ` Henning Hraban Ramm
  0 siblings, 0 replies; 2+ messages in thread
From: Henning Hraban Ramm @ 2023-11-19 18:33 UTC (permalink / raw)
  To: Emanuel Han via ntg-context

Am 19.11.23 um 16:41 schrieb Emanuel Han via ntg-context:
> I'd like to surround black text with a white 1mm thick border in a 
> Metapost label. Here is my code, which doesn't draw the border at all 
> and which draws the text in white instead of black (I'm using mkiv and 
> mkxl version 2023.09.26 18:19 on osx-arm6):
> 
> |
> 
> |beginfig(1);
>      % Define the text and colors
>      string label_text;
>      label_text = "Your Text";
>      color text_color, border_color;
>      text_color = black;
>      border_color = white;
>      % Draw the label with the specified colors
>      label(textext(label_text) scaled 1.0, origin) withcolor text_color 
> withpen pencircle scaled 1mm withcolor border_color;
> endfig;|

Have a look into luametafun.pdf (p.10) if lmt_outline does what you want.

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-19 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-19 15:41 [NTG-context] Metapost label text surrounded by white border Emanuel Han via ntg-context
2023-11-19 18:33 ` [NTG-context] " Henning Hraban Ramm

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