rdrake's picture

TextPrinter (TextQuality.High) failure (with patch to fix)

Project:The Open Toolkit library
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Using the latest SVN TextPrinter code (yes, I realize it's bleeding edge), you must set TextQuality.Medium or TextQuality.Low, otherwise you go into a path that uses GL.BlendColor to do the coloring.

Using blending for the text coloring is fine when your current GL.Color() is set to White, but when your GL.Color is not White, you get unexpected results!

Fails (no text output):
GL.Color3(Color.Black);
---do some other drawing---
text.Begin();
text.Print(label, sans, Color.Black);
text.End();

Working:
GL.Color3(Color.White);
---do some other drawing---
text.Begin();
text.Print(label, sans, Color.Black);
text.End();

Suggested fix (attached):

Set the current color to White in GL12TextOutputProvider.SetColor().

On a related note, you also need to add AttribMask.CurrentBit to the PushAttrib() call in GL1TextOutputProvider.Print, so that PopAttrib will restore the current color. This is true regardless of whether you use this fix, because GL11TextOutputProvider changes the current color on the user.

Workaround:

For now, users must call GL.Color(Color.White) before making any call to ITextPrinter.Print()

AttachmentSize
GL12TextOutputProvider.patch1.04 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» fixed

Thanks, committed.

the Fiddler's picture

#2

Title:TextPrinter(TextQuality.High) failure (with patch to fix)» TextPrinter (TextQuality.High) failure (with patch to fix)

(Edited title, as it didn't fit in the "recent activity" box on some browers.)

the Fiddler's picture

#3

Version:0.9.x-dev»
Status:fixed» closed

Closing bugs fixed in 0.9.3.