# Text problem with stroke

**URL:** <https://discourse.processing.org/t/text-problem-with-stroke/9998>\
**Category:** Coding Questions\
**Created:** [April 5, 2019, 2:39pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998 "2019-04-05T14:39:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fwtini](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fwtini](https://discourse.processing.org/u/fwtini)\
**Post date:** [April 5, 2019, 2:39pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998/1 "2019-04-05T14:39:39Z")

</div>

Hi Guys can you explain me why the stroke doesn’t work on text?

```auto
 PFont myFont;
 int x=0;
 float y;
 float r =0;
 String s="test";
 float xPosition=500;

 void setup(){
   size(500,500);
   background(0);
   myFont=loadFont("AktivGrotesk-Black-48.vlw");
  stroke(0,255,45,45);
   textFont(myFont);
  // frameRate(10);
 }
 
 
 void draw(){
   
   
  //for(x=0;x<250; x++)
  for (y=0; y<250; y=y+50)
{
//if(y>0);
 
   
   fill(255,255,255,60);
     stroke(0,255,45,45);
 translate(150,150);
    
   text(s,200,xPosition);
 
    xPosition -=0.1;  
}
 }

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 5, 2019, 2:43pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998/2 "2019-04-05T14:43:58Z")

</div>

Processing doesn’t apply `stroke` attributes when drawing text.

---

<div class="post-metadata">

**Author:** ![fwtini](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fwtini](https://discourse.processing.org/u/fwtini)\
**Post date:** [April 5, 2019, 2:47pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998/3 "2019-04-05T14:47:48Z")

</div>

oo ok! And another question. I want my text to stop in the middle of my sketch how can i do it?

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 5, 2019, 2:53pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998/4 "2019-04-05T14:53:48Z")

</div>

from  
[https://processing.org/reference/text\_.html](https://processing.org/reference/text_.html)

```auto
text(s, 10, 10, 70, 80); // Text wraps within text box

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 5, 2019, 3:08pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998/5 "2019-04-05T15:08:58Z")

</div>

> [@fwtini](#):
>
> I want my text to stop in the middle of my sketch how can i do it?

Shows one way

```auto
PFont myFont;
int x=0;
float y;
float r =0;
String s="test";
float xPosition=548;

void setup() {
  size(500, 500);
  background(0);

  textSize(48);
  // frameRate(10);
}

void draw() {
  if (xPosition > height/2) {
    fill(255, 255, 255, 60);
    text(s, 200, xPosition);
    xPosition -= 1;
  }
}

```
