Geomeritive - Eliminating "Left-Over Lines"

edited April 2015 in Library Questions

When I run this I have "left over lines" that connect the letters to each other. I want to eliminate them to make a "clean" typographic study. Anybody have any suggestions about killing off those "between letter lines"?

import geomerative.*;
RFont font;
String myText = "SAITO GROUP";
String myTextTwo = "a";
void setup() {
  size(800, 300);
  background(255);
  smooth();
  RG.init(this); 
  font = new RFont("FreeSans.ttf", 100, CENTER);
  noFill();
  translate(width/2, height/1.7);
}
void draw() {
  RCommand.setSegmentLength(mouseX);//TRY DIFFERENT VALUES HERE
  RCommand.setSegmentator(RCommand.UNIFORMLENGTH);
  RGroup myGroup = font.toGroup(myText);
  //RGroup myGroupTwo = font.toGroup(myTextTwo);
  RPoint[] myPoints = myGroup.getPoints();
  //RPoint[] myPointsTwo = myGroupTwo.getPoints();
  //beginShape();
  background(0);
  //fill(50,50);
  //rect(0,0,width,height);
  translate(411, 178);
  stroke(255);
  beginShape(POLYGON);//THIS CHANGES DRAMATICALLY THE FORM.
  //POINTS, LINES, TRIANGLES, TRIANGLE_FAN, 
  //TRIANGLE_STRIP, QUADS, QUAD_STRIP, POLYGON;
  for (int i=0; i<myPoints.length; i++) {
    vertex(myPoints[i].x, myPoints[i].y);
    //TRY CURVEVERTEX TOO BUT CHOOSE POLYGON MODE IN BEGINSHAPE()
    //curveVertex(myPoints[i].x, myPoints[i].y);
  }
  //  translate(60,0);
  //  for (int i=0; i<myPointsTwo.length; i++) {
  //    vertex(myPointsTwo[i].x, myPointsTwo[i].y);
  //  }
  endShape(); // -- CLOSE?
}
Tagged:

Answers

  • edited May 2015

    Here is another example. This is some kind of quirk of the library that I am look for a high level solution for. Trying to eliminate those strange connection lines. You need to have a ttf font installed in your system to check it.

        import geomerative.*;
        String textVariable = "What Up";
        int variableOne = 0;
        int variableTwo = 0;
        boolean firstSwitch = false;
        boolean secondSwitch = false;
        RShape[] firstSplit;
        RShape secondSplit;
        RFont font;
        RShape grp;
        void setup() {
          size(displayWidth, displayHeight, P3D);
          //smooth();
          RG.init(this); 
          font = new RFont("Neou-Thin.ttf", 10, CENTER);
          grp = RG.getText(textVariable, "Neou-Thin.ttf", 150, CENTER);
          firstSplit = grp.splitPaths(.5);
    
    
        }
        void draw() {
          background(0);
          //noCursor();
          translate(width/2, height/2);
          noFill();
          //fill(255, 50);
          strokeWeight(1);
          stroke(255, 100);
          firstSplit[1].draw();
        }
    
  • there are examples in the zip file, do they help?

    all i can see is that you are calling font.toGroup() which gives you everything with no way of telling you where the characters end. perhaps one of the other methods on rfont will be better suited. you might have to do it a character at a time and space them yourself.

    RGroup toGroup(java.lang.String text)
    Use this method to get the outlines of a string in the form of an RGroup.
    
    RPolygon toPolygon(char character)
    Use this method to get the outlines of a character in the form of an RPolygon.
    
    RShape toShape(char character)
    Use this method to get the outlines of a character in the form of an RShape.
    
Sign In or Register to comment.