processing / processing/processing4

Tools > Create Font unable to disable smoothing on macOS

Open
#278 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

has attachment macos
Dominant language
Java
Stars
494
Forks
183
Avg merge
4h 39m
Merged PRs (30d)
3

Description

Created by: kylemcdonald

Description

When using createFont() or the Create Font tool to create a PFont for a bitmap pixel font with smoothing disabled, there are still grays in the generated font.

Expected Behavior

Created by thresholding the result in Photoshop:

Screen Shot 2021-10-01 at 10 32 50

Current Behavior

Generated directly by Processing:

Screen Shot 2021-10-01 at 10 31 11

Steps to Reproduce

Here is a link to the font I am using: sg08.zip

PFont font;

void setup() {
  size(512, 512);
  font = createFont("SHAKAGRAPHICS08", 8, false);
  noSmooth();
  textFont(font, 8);
  textAlign(LEFT, TOP);
}

void draw() {
  background(255);
  fill(0);
  noStroke();
  String str = "Forsaking monastic tradition,\ntwelve jovial friars gave up\ntheir vocation for a questionable\nexistence on the flying trapeze.";
  text(str, 20, 20);
}

Your Environment

  • Processing version: 4.0b1
  • Operating System and OS version: MacOS 11.6

Possible Causes / Solutions

I did some basic checks to see that this is happening at font generation time, and not in the rendering. I don't know the Processing internals enough to advise beyond this. Last time I tried this font was circa 2011 and I know it worked correctly Processing back then :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on macOS with the supplied sg08.zip font and the sketch using createFont("SHAKAGRAPHICS08", 8, false). Trace the Create Font tool and createFont() font-generation path to determine where smoothing is introduced. Done means the generated bitmap font has no unintended gray pixels when smoothing is disabled, while normal font behavior remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.