# How to scale text and distance proportionally to avoid overlap?

**URL:** <https://discourse.processing.org/t/how-to-scale-text-and-distance-proportionally-to-avoid-overlap/8763>\
**Category:** Coding Questions\
**Created:** [February 27, 2019, 11:55am UTC](https://discourse.processing.org/t/how-to-scale-text-and-distance-proportionally-to-avoid-overlap/8763 "2019-02-27T11:55:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobo](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@jacobo](https://discourse.processing.org/u/jacobo)\
**Post date:** [February 27, 2019, 11:55am UTC](https://discourse.processing.org/t/how-to-scale-text-and-distance-proportionally-to-avoid-overlap/8763/1 "2019-02-27T11:55:07Z")

</div>

Hi! I want to be able to scale text size and spacing/leading proportionally to avoid overlaps of text. I’d like to be able to scale the text from it’s current size in 5 columns to a bigger text size in for example 3 columns. Is there a clever way to do this?

Much appreciated

```auto
PFont font1;
String [] words = {"vinterjazz", "01-24 feb. 2019", "www.jazz.dk"};

void setup() {
  println(words.length);
  size (700, 1000);
  font1 = loadFont ("Akkurat-Bold-18.vlw");
  textAlign(LEFT);
  frameRate(1);
}

void draw() {

  background (0);
  textFont(font1, 16);
  for (int y = 20; y < height; y = y + 20) {
    for (int x = 10; x < width; x = x + 140) {
      fill(255);
      text(words [int(random(words.length))], x, y );
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 27, 2019, 6:52pm UTC](https://discourse.processing.org/t/how-to-scale-text-and-distance-proportionally-to-avoid-overlap/8763/2 "2019-02-27T18:52:17Z")

</div>

Glad that you were able to resolve this! There are many approaches that work – would you be willing to share your solution?
