Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

P2D renders images with alpha channels incorrectly if large VLW fonts are used #5645

Copy link
Copy link
@Sardtok

Description

@Sardtok
Issue body actions

Description

When setting the font to a large VLW font, rendering text and images in a sketch using the P2D renderer, something happens to the transparency mode that makes images render incorrectly.

Expected Behavior

Transparent pixels in the image should be transparent instead of having the image background color or other colors from elsewhere in the same row.

Using the Java 2D (JAVA2D or unspecified) or JavaFX (FX2D), results in the correct behaviour.
Downgrading to Processing 3.3.7 results in the correct behaviour.

Current Behavior

Transparent pixels are not rendered as transparent, and the color is not necessarily as expected. It can look a bit like

Steps to Reproduce

1.Create a font with the font creation tool, e.g. Serif.bold at 72px (seems the threshold is 40px).
2. Include a PNG with an alpha channel (might require 8-bit alpha).
3. Set the font to use the VLW with textFont and loadFont.
4. Make sure you use P2D or P3D renderer.
5. Draw some text and the image in draw.

PImage button;

void setup() {
  size(800, 800, P2D);
  button = loadImage("button-green2.png");
  textFont(loadFont("Serif.bold-72.vlw"));
}

void draw() {
  background(0);
  image(button, 200, 200, 400, 400);
  text("TEST", 0, 50);
}

Your Environment

  • Processing version: 3.4
  • Operating System and OS version: Windows 10 (1803 / 17134.228)
  • Other information:
    nVidia GeForce GTX 1050 and Intel UHD Graphics 620 (same result on both)
    Tested in 4K (pixel density 2) and 1080p (pixel density 1).
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.