We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Strokes (Read 548 times)
Strokes
Sep 28th, 2007, 6:49pm
 
I am just starting out using processing and was wondering if there is a way to create a stroke around letters?
If so, how?

Thanks.
Re: Strokes
Reply #1 - Oct 1st, 2007, 5:14pm
 
As far as I know : no! Letters are only filled.

You may use different tricks anyway :

* before drawing your text (say in white) draw your text 4 times in background (say in black), each time with a small offset, like this :

fill(0);
text("sample text", 20-1, 20);
text("sample text", 20+1, 20);
text("sample text", 20, 20-1);
text("sample text", 20, 20+1);
fill(255);
text("sample text", 20, 20);

* a variant : draw your text in black. then draw the same text in white and in smaller letters, over the preceding.

* use a font where only the border of the letters are drawn and the interior is empty.

Nicolas.
Re: Strokes
Reply #2 - Oct 8th, 2007, 1:38am
 
Thanks!
Page Index Toggle Pages: 1