Default font is used with PGraphicsRetina2D #2617

Closed
slambert opened this Issue Jun 27, 2014 · 14 comments

Comments

Projects
None yet
3 participants
@slambert

adding "processing.core.PGraphicsRetina2D" to size() causes the fonts loaded with createFont() to change to some default (like Lucida Grande or something).

See sample sketch and screenshots below. For the sketch to work, you may have to change FranklinATFBQ-Regular to another font you have available.

PFont myFont;

void setup() {
//  size(500, 500, "processing.core.PGraphicsRetina2D"); // font changes to some default
  size(500, 500); // font will load correctly
  smooth();

// uncomment the following two lines to get a list of available fonts
//  String[] fontList = PFont.list();
//  println(fontList);
  myFont = createFont("FranklinATFBQ-Regular", 25, true);
  textFont(myFont);
  textAlign(CENTER, CENTER);

}

void draw () {
  fill(0);
   text("Presto Change-o", 250, 250);
}

off

on

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 25, 2014

Member

That's your bug: you're not clearing the screen in draw().

Member

benfry commented Jul 25, 2014

That's your bug: you're not clearing the screen in draw().

@benfry benfry closed this Jul 25, 2014

@slambert

This comment has been minimized.

Show comment
Hide comment
@slambert

slambert Jul 25, 2014

Ben, I know you're a busy dude, but if possible can you explain a bit more or post some code?

Ben, I know you're a busy dude, but if possible can you explain a bit more or post some code?

@REAS

This comment has been minimized.

Show comment
Hide comment
@REAS

REAS Jul 25, 2014

Member

@slambert I don't think this is supported:

//  size(500, 500, "processing.core.PGraphicsRetina2D");

Why are you doing that?

Member

REAS commented Jul 25, 2014

@slambert I don't think this is supported:

//  size(500, 500, "processing.core.PGraphicsRetina2D");

Why are you doing that?

@slambert

This comment has been minimized.

Show comment
Hide comment
@slambert

slambert Jul 25, 2014

Found it here under retina support. and it says "This needs a lot of testing, so please help. There may be many bugs." So I thought I'd try to help...

Found it here under retina support. and it says "This needs a lot of testing, so please help. There may be many bugs." So I thought I'd try to help...

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 25, 2014

Member

@slambert there's no background() call at the top of draw(). What you see is the buildup of anti-aliasing artifacts after hundreds or frames are drawn.

Member

benfry commented Jul 25, 2014

@slambert there's no background() call at the top of draw(). What you see is the buildup of anti-aliasing artifacts after hundreds or frames are drawn.

@slambert

This comment has been minimized.

Show comment
Hide comment
@slambert

slambert Jul 25, 2014

@benfry - Sure sure, but the bug was about the font change.

@benfry - Sure sure, but the bug was about the font change.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 25, 2014

Member

Is that font listed in PFont.list() when using the retina display?

Member

benfry commented Jul 25, 2014

Is that font listed in PFont.list() when using the retina display?

@slambert

This comment has been minimized.

Show comment
Hide comment
@slambert

slambert Aug 9, 2014

Sorry, I've been away from my retina laptop. Just tested this and yes, the font listed does appear when using PFont.list() on the retina display. And the same bug described above appears too, unfortunately.

slambert commented Aug 9, 2014

Sorry, I've been away from my retina laptop. Just tested this and yes, the font listed does appear when using PFont.list() on the retina display. And the same bug described above appears too, unfortunately.

@REAS

This comment has been minimized.

Show comment
Hide comment
@REAS

REAS Aug 9, 2014

Member

One question and one note. I assume same behavior for all fonts? Also, @codeanticode is doing work with OpenGL related to retina displays right now. I think that work may affect this issue; hopefully will fix it. I think it's related, but I'm not sure.

Member

REAS commented Aug 9, 2014

One question and one note. I assume same behavior for all fonts? Also, @codeanticode is doing work with OpenGL related to retina displays right now. I think that work may affect this issue; hopefully will fix it. I think it's related, but I'm not sure.

@slambert

This comment has been minimized.

Show comment
Hide comment
@slambert

slambert Aug 9, 2014

Tried it with a few other fonts and getting the same results.

For the sake of organization, you may want to re-open this issue...

slambert commented Aug 9, 2014

Tried it with a few other fonts and getting the same results.

For the sake of organization, you may want to re-open this issue...

@benfry benfry reopened this Aug 12, 2014

@benfry benfry changed the title from Turning on retina support changes fonts made with createFont() to Default font is used with PGraphicsRetina2D Aug 12, 2014

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Aug 12, 2014

Member

Re-opening, finally had a chance to reproduce.

Member

benfry commented Aug 12, 2014

Re-opening, finally had a chance to reproduce.

@benfry benfry closed this in 510f4f1 Jun 13, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jun 13, 2015

Member

Fixed for beta 1.

Member

benfry commented Jun 13, 2015

Fixed for beta 1.

@slambert

This comment has been minimized.

Show comment
Hide comment
@slambert

slambert Jun 13, 2015

Exciting! Thanks.

Exciting! Thanks.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jun 13, 2015

Member

Workaround in the meantime is that if you call textFont() again inside draw(), it should work properly. (I recommend using alpha 10, which also has a lot of updates for retina support and this sort of thing.)

Member

benfry commented Jun 13, 2015

Workaround in the meantime is that if you call textFont() again inside draw(), it should work properly. (I recommend using alpha 10, which also has a lot of updates for retina support and this sort of thing.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment