Hello,
I'm working on a job to build a processing app that will output detailed construction sheets for a relatively big building project.
I've been using the Geomerative extensively and it's been of the utmost help when loading svg files, accessing the different layers, objects & al.
I'm however encountering an issue with the RFont class.
I need to replace about 23000 objects with a letter relative to their colors (there's 7 colors, and they're already organized by layers). I've successfully managed to replace the circles by the letters (by not drawing the layers with the 23000 objects, and only drawing the letters in a separate method).
The problem is that the display of the letters changes, it's as if they've all had their respective geometry simplified.
in setup i've initialised the RFont with:
font =
new RFont(
"Arial Narrow.ttf", 10, RFont.
CENTER);
and in the draw, i have a method replacing the objects by letters as such:
- public void makeColorLetters() {
- colorLetters = new RShape();
- for (RShape currentColor : myPlan.getChild("COLORS").children) {
- String layerName = currentColor.name;
- RShape letterLayer = new RShape();
- letterLayer.name = layerName;
- for (RShape hole : myPlan.getChild(layerName).children) {
- // draw letter for every dot
- pushMatrix();
- translate(hole.getCentroid().x,hole.getCentroid().y + (myPlan.getChild("ORIGIN").getWidth() / 4));
- fill(0);
- font.draw(layerName);
- popMatrix();
- }
- colorLetters.addChild(letterLayer);
- }
- colorLetters.name = "colorLetters";
- myPlan.addChild(colorLetters);
- }
- myPlan.getChild("colorLetters").draw();
I really have no clue as to what i'm doing wrong any help is greatly appreciated.
Regards,
H.
1