I just packed up a new release of Nuclex.Fonts!
The TextManager class in this new release drastically
accelerates font rendering performance by allowing the BitmapFont
class to fully utilize the vertex batching facilities in Nuclex.Fonts. So if
you ever felt the need to plaster your entire screen with random letters
high above your monitor's refresh rate, here's your chance!

Uhm... never mind, just toying around with some exotic fonts ;)
Complete list of changes:
-
1.1.0 still had problems with the XBox 360 because the XBox apparently is unable to update smaller regions within a texture or vertex buffer.
Thanks to Peter Pashley, these issues have finally been adressed and the remaining XBox 360 issues with Nuclex.Fonts should be solved.
There are some minor performance issues left on the XBox360 that will be adressed at a later time. Namely, the first time a character is used, it will eat up some performance. Successive frames won't be affected, however, since the character will be in the cache after that.
-
The TextManager component now greatly improves rendering speed by making better use of vertex batching.
For the curious: the DrawString() method has to flush the vertices to the graphics card after each call to ensure no unwanted surprises in the drawing order when you mix text rendering with other drawing calls. Thus, it could not make effective use of vertex batching.
-
Due to popular demand, newline ('\n') support has been added!
This is still a work-in-progress feature. It will not yet yield the correct results when used for centered or right-aligned text. Automatic word-wise line breaking and tab ('\t') spacing haven't been completed either and will be provided with a future release.
-
The font character bounding box is now expressed in pixels. The importer in 1.1.0 had a minor glitch that would save the font's bounding box in font units rather than pixels.
Using font class
I was playing with the animation class for XNA and using yours to write the FPS to the screen. I noticed that when I call the DrawString method, part of the model (the face of the dwarf) vanished. If I commented out the DrawString method, the model rendered fine.
I got the animation class from here:
http://www.codeplex.com/animationcomponents
(thanks for the tool)
It's caused by render state changes
This happens due to Nuclex.Fonts changing the render states of the
GraphicsDevice.I decided not to save the render states because some of the changes are rather costly in terms of performance (especially if you draw a lot of strings and save/restore all the states needlessly multiple times).
There's a solution here:
Problem with Transparency
For the next release, I'm planning on getting rid of this issue by actually saving and restoring the render state, but providing some optional methods like
BitmapFont.Begin()andBitmapFont.End()to keep Nuclex.Fonts the fastest font rendering solution out there ;)Please check this forum post
Looks exactly like the problem skelman was having, only that your uninitialized texture regions appear to be empty whereas his testers' were filled with random noise:
Fonts show up garbled for some users
I'm still thinking that this entire thing might be an implementation issue of the video driver's texture subregion locking mechanism. My reply in the forum post linked above has something you can try that will either solve the problem or at least verify to me that it's something entirely different. Please try and see if it helps!
Post new comment