Open kylemcdonald opened 13 years ago
arggg - that will break so much!! :)
.... but agreed, logic makes sense. however it would be a SUPER rough one to change. hmm, Zach, Arturo??
yeah unlike ofSetColor, which is confined to only a handful of the apps, ofDrawBitmapString shows up in pretty much everything. including ofxControlPanel ;)
but i think for consistency's sake this is something that should be changed. for some of these smaller issues that are non-backwards-compatible, maybe it's best to just get a few people together some day and do a wardrive through the OF core.
what about this? now tht ofDrawBitmapString has some options perhaps it can be a parameter? the default would be top left but it could be changed to bottom left for backwards compatibility
@arturoc hmm I disagree - both ttf and ofDrawBitmapString do bottom left for a good reason. baseline is the normal reference point for drawing with type.
processing defaults to baseline ( which is what we have ). see: http://processing.org/reference/textAlign_.html
I think an equivilant of text align could be VERY useful though. ( centered text etc )
mmh, yeah that makes sense. we should move to a higher level library like pango and solve also utf issues anyway, not for 007 though : )
El dom, 13-03-2011 a las 14:11 -0700, ofTheo escribió:
@arturoc hmm I disagree - both ttf and ofDrawBitmapString do bottom left for a good reason. baseline is the normal reference point for drawing with type.
processing defaults to baseline ( which is what we have ). see: http://processing.org/reference/textAlign_.html
I think an equivilant of text align could be VERY useful though. ( centered text etc 0
https://github.com/openframeworks/openFrameworks/issues/271#comment_866867
yeah, i've reversed my position on this now as well -- i'm with theo, it should be 'baseline' rendering, same as processing's default. but the other options would be very welcome. i suggest 008 be dedicated solely to utf compatibility, and 009 solely to namespace migration ;)
i was just working with ofDrawBitmapString() and i'm not convinced it's actually at 'baseline' right now.
http://i52.tinypic.com/2ugjrex_th.png
that's from this code:
ofBackground(0);
ofSetColor(255);
ofNoFill();
ofRect(100, 100, 100, 100);
ofDrawBitmapString("++||--__qpgFy\nM\n*\n`\n~\n^\n%\n#\n,\n-", 100, 100);
so it's actually 2 pixels too low. or 3 depending on where you think the _ should be.
this explains why, whenever you try to draw text on a line, or on a rect, it always intersects it rather than sitting on top... i'm sure you ran into this, theo, while working on ofxControlPanel... :)
So... I guess no central text alignment on ofDrawBitmapString? 😄
Hi,
We are trying to clean out the many issues that we have. Many versions of OF have been released since this was issued.
Can you help us by checking if this issue is still present in the latest version ?
In case of inactivity, we'll close this issue by end of january, 2020.
Thanks
This is still an issue but should be considered alongside a deprecation strategy as part of a 1.0 strategy as it would have a lot of repercussions.
bottom left corner is inconsistent with every other drawing command in OF, should be top left instead.