Skip to content

pixelDensity(2) breaks the width of a tab ("\t") in JAVA2D #5625

@clankill3r

Description

@clankill3r

Processing 3.4
Mac OSX 10.12.6

In the JAVA2D renderer, when having pixelDensity(2) with a lot of fonts the width of a tab character becomes 0.

String[] fonts = PFont.list();
int i = 0;

void setup() {
   size(200, 200, JAVA2D);
   pixelDensity(2); 
   frameRate(5);
}

void draw() {
  
  String s = fonts[i++];
  textFont(createFont(s, 10));
  if (i == fonts.length) noLoop();
  
  background(0);
  text(s+"\nA\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tB", 10, 10);    
}

(side node, the width of a tab in FX2D is huge compared to P2D for example)

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