Opengl/Cocoa text rendering

So for a couple years I'd been using the code from OSC's text tutorial to render fast text into opengl views. I just got lion and tried running a project that previously worked fine in 10.6 and now i get static and strange/seemingly random artifacts within the text's bounding rect. Anyone ideas or similar experiences?

I didn't see a way to download the actual project so I just copied the NSViewTexture class files into the project, then I copied all of the code from NSViewTextureTest.cpp into my projects main file.

So I tried changing both the base sdk and the deployment target but neither made a difference. Then I switched the architecture from the default 64 bit to 32 and it worked (regardless of the sdk), though I have not the slightest idea of why.

Okay, so I think I've got the first part taken care of. But there's still one issue. Using the code from the tutorial I created a routine to create textures on the fly which are deleted upon use, but the problem is that the text sitting in the supposedly deleted textures shows up in all subsequent textures.

Basically each time I call fast_text, the next text is textured over whatever text was drawn into the view from the previous call; it's as if the view itself had never been deallocated however (and thus accumulates whatever is drawn into it), from my understanding of the code, ConvenienceReleaseNSTextView() should delete the view and make is okay for me to call ConvenienceCreateNSTextView() for 'view' once again, right?

One - I've been using this code for quite some time to render text in an app I'm working on. Recently I enabled distributed objects logging via the product->edit_scheme menu as part of an unrelated debugging effort and I noticed a lot of logging activity - which for the life of me I'm unable to understand - going on as the result of the above mentioned text drawing code. Here's a sample:

And two - I was fooling around with apples code for doing opengl text (GLString) and was unable to find a way in which to constrain the text so as to keep it within the bounds of a predefined rectangle. Anyone know how to do this?

That's logging the chatter that DO uses. I don't see how this at all relates to your text rendering or how it's a problem.

As for bounding the text, I assume you mean you want to be able to create a really long string, but have it wrap, or truncate?

It looks like if you use useStaticFrame: then it'll draw the string into a frame no larger than that given size, but the text will be single-line only and cut off rather than nicely truncated.

If you want wrapping or truncation, you'll need to modify GLString. In genTexture it's using [string drawAtPoint:...]; You'll want to use drawWithRect:options: with the option NSStringDrawingUsesLineFragmentOrigin I believe (for wrapping), and setup an NSMutableParagraph style with a line break mode for truncation.