I just uploaded a new release of Nuclex.Fonts, fixing 100% of the problems that were reported to me after the release of the 1.0.1 version!
Changes in Detail:
-
The alpha part of the drawing color is now respected, allowing semi-transparent text to be rendered
-
Fonts now use BGRA-32 bitmaps. The original release used alpha8, which turned out to be not that widely supported. Even the XBox 360 cannot cope with this format. The new release should work on the XBox 360 now!
-
Fonts now provide a bounding box that makes it easier to properly align text and calculate the line height amongst other things
-
Custom effects can be passed when rendering fonts. This allows for all kinds of distortion, recoloring and touch-up effects in the text
-
The FreeType library used by the importer has been upgraded to the new FreeType 2.3.0 release
-
New Text manager that helps queueing text until the rest of the drawing commands has been finished to ensure text is on top of everything else.
Get it from here:
http://www.nuclex.org/downloads/developers/kits/nuclex-fonts-1-1-0
Great work, well done! This
Great work, well done! This version works perfectly.
w00t!
Nice one mate! :D
Thanks!
Thanks guys! It's always great getting some positive feedback!
Still Having Texture Problems On 360
So I tried the latest release and I'm still having texture problems on the 360. :(
Specifically I'm seeing errors w/ the code at GlyphCache.cs:54. The 360 hits this line then gererates the Exception:
An unhandled exception of type 'System.ArgumentException?' occurred in Microsoft.Xna.Framework.dll
Additional information: Texture resources can only be created with the following ResourceUsage? options: AutoGenerateMipMap?, Dynamic, ResolveTarget?, Tiled, or Linear.
It's loading a Texture using SourceFormat.Color which fails on the 360. After changing it to SourceFormat.Bgr32 then it seems to create the texture
alright but begins failing on GlyphCache.cs:174. From what I can gather off the XNA boards it's a problem with just working with a portion of the textute.
Is anyone else seeing these problems? Has someone solved them?
Wrong Stack Trace
Sorry, the stack trace I mentioned in my last message is wrong... it should have been this one:
An unhandled exception of type 'System.ArgumentException?' occurred in Microsoft.Xna.Framework.dll
Additional information: The device does not support creating a texture of the given format with the given ResourceUsage?.
Already solved, just not released yet
It's already been solved in the upcoming 1.1.1 release, the solution is here. I'm still investigating whether the XBox 360's pixel format for SurfaceFormat.Color is RGBA or ARGB and whether this can affect PC graphics cards, too.
Unicode fonts
Has anyone had success with chinese or other unicode-based fonts? I have simhei.ttf on my system, and it works fine as long as I try to make a regular ascii string (chinese fonts also include all the ascii characters), but if I try to make some chinese unicode characters, eg:
string s = "你好吗"; // (ni3 hao3 ma)
chineseFont.DrawString(new Vector2(200.0f, 80.0f), s, Color.Black);
Then I get nothing displayed at all. ???
Sorry, currently not supported
Sorry, Nuclex.Fonts does not currently support unicode characters. It's not hard to add, but the importer is hardcoded to only import characters 0-128 aka the ascii set at the moment.
I am planning on adding unicode at a later time in a similar way as it has been done in the XNAExtras
BitmapFontclass, eg. you'll have to specify in your .ttfimport file which extended characters you want to import as the whole kanji set for example would be far too large to store as bitmaps.Kerning table
Great work, well done! Can you add a kerning pairs table support?
Thinking about it...
I guess it wouldn't be too hard to add. Maybe I can tackle it once I got the code refitted to run optimally on the XBox 360. No promises, thought ;)
Post new comment