Letters In A Box With No Rules

What if the text is too long and goes over the margin?

kedama

For example, could we program a text layout and editing system just using a “field of messages” that individual text characters can sense and respond to? Laying out a “paragraph” of “ants” seems like a good place to start because it will have to work continuously while the editor is being used.

layout

Figure 1: Ants swarming around food

Figure 2: Simulation showing diffusion

The main problem is to do "word wrap" so that each word is entirely on one line. We don't want half the word at the end of one line and the other half on the next line.

Ants are a “distributed hive animal” whose “cells” communicate by a variety of means including laying down trails of chemicals which can help ants get to discovered food sources.

Start

Introduction

The goal is to create a text field and arrange its letters in an area of the screen. The letters have an order from first to last.

How To Make A Text Field From Ants

Viewpoints Research Institute, Glendale, CA

*This project is funded by NSF and private donors

Ted Kaehler, Yoshiki Ohshima

Any costume that has those properties can be placed in text, even if it is not really a letter. A letter object is rendered into the composition area on the screen using the system's normal costume rendering programs.

We want to investigate whether the “particles and fields” style of distributing messages as intrinsic parts of environments can work well for some programming problems.

In the most general case, each letter can be any costume that has shape, color, and a bounding rectangle.

*

With such a general notion of a letter, we are freed from dealing with the details of families of fonts, emphasis (bold, italic), construction of a letter of the desired size, or text color. When a glyph arrives at the layout stage, it already has the proper shape, style, size and color.

Stop

To see the default situation with no layout rules, press the blue button "layout". Since there are no rules, all of the letters pile up at the upper left of the field. A mouse click or drag on a letter does nothing.

layout

The main problem is to do "word wrap" so that each word is entirely on one line. We don't want half the word at the end of one line and the other half on the next line.

The main problem is to do "word wrap" so that each word is entirely on one line. We don't want half the word at the end of one line and the other half on the next line.

Building a Text Field from “Ants”