Skip to content

Instantly share code, notes, and snippets.

@getflourish
Last active November 24, 2015 18:47
Show Gist options
  • Save getflourish/78a2654ab95b8eac6951 to your computer and use it in GitHub Desktop.
Save getflourish/78a2654ab95b8eac6951 to your computer and use it in GitHub Desktop.
import geomerative.*;
import org.apache.batik.svggen.font.table.*;
import org.apache.batik.svggen.font.*;
RFont font;
RGroup grp;
RPoint[] points;
void setup () {
size( 800, 600);
RG.init(this);
font = new RFont("Alegreya-Regular.ttf", 72, RFont.CENTER);
grp = font.toGroup("Hello World");
RCommand.setSegmentLength(5);
RCommand.setSegmentator(RCommand.UNIFORMLENGTH);
points = grp.getPoints();
}
void draw() {
background(0);
for (int i = 0; i < points.length; i++) {
float targetX = mouseX + points[i].x;
float targetY = mouseY + points[i].y;
ellipse(targetX, targetY, 2, 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment