Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text partially cut off #112

Open
jvolker opened this issue Dec 22, 2023 · 0 comments
Open

Text partially cut off #112

jvolker opened this issue Dec 22, 2023 · 0 comments

Comments

@jvolker
Copy link

jvolker commented Dec 22, 2023

I've noticed a glitch in the font rendering. The top part of the dot of the i is being cut off.

image

I've used the demo font available at https://www.fontspring.com/fonts/rene-bieder/freigeist and the following code:

// Test program for the PEmbroider library for Processing:
// Optimize each character in text individually. 

import processing.embroider.*;
PEmbroiderGraphics E;

void setup() {
  // noLoop(); 
  size (700, 400);
  PFont myFont = createFont("FONTSPRINGDEMO-FreigeistBlackItalic", 360);
  
  textAlign(CENTER, BASELINE);
  textFont(myFont);
  textSize(160);
  text("Wisdom", width/2, height/2);

  E = new PEmbroiderGraphics(this, width, height);
  E.TEXT_OPTIMIZE_PER_CHAR = false; 
  E.hatchSpacing(5);

  E.beginDraw(); 
  E.clear();
  E.textAlign(CENTER, BASELINE);
  E.textFont(myFont);
  E.textSize(160);
  E.fill(0);
  E.stroke(0); 

  E.text("Wisdom", width/2, height/2);
  //E.optimize();
  E.visualize(true, false, false);

  boolean bDoExportEmbroideryFile = false;
  if (bDoExportEmbroideryFile) {
    String outputFilePath = sketchPath("PEmbroider_text_1.vp3");
    E.setPath(outputFilePath); 
    E.endDraw();
  }
}

void draw() {
  // background(200);
  // E.visualize(true,false,false,frameCount);
}

void keyPressed() {
  if (key == ' ') {
    save("PEmbroider_optimize_per_char.png");
  }
}

Using Processing 4.3 and latest PEmbroider.

Thanks for looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant