Rendering text in XNA using DirectWrite, Windows API or anything else that isn't sprite fonts

StackOverflow https://stackoverflow.com/questions/10484142

سؤال

I'm working on an XNA game that works on any arbitrary screen resolution (or window size), and while scaling the graphics down and up works just fine, scaling SpriteFonts looks just awful (not to mention that SpriteFont by itself looks bad already because of the compression used). Making a SpriteFont for each size is out of the question, since the size can be anything.

I hear that DirectWrite or even Windows API is a way of rendering actual vector (TrueType etc.) fonts in XNA, but couldn't find any examples of this.

How hard is this to implement in XNA? Are there any examples I could look at? Are there any other options?

Obviously, I'm not worried about any other platforms than Windows, so any Windows only code is fine.

هل كانت مفيدة؟

المحلول

You could look into Nuclex. They have vector text output :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top