Closed Majirefy closed 6 years ago
For now, Ultraviolet does not support rendering TrueType fonts directly. However, the uvfont
utility can generate a CJK sprite font for you which contains only the characters that your game actually uses.
The current (1.3.15) version of uvfont
can be obtained from the TwistedLogik.Ultraviolet.Tools
package on NuGet, or if you compile the latest version of Ultraviolet from source it should show up in the Binaries/AnyCPU
folder.
If you call uvfont
without any arguments, it will list all of the possible arguments and tell you what they do.
The -sourcefile
and -sourceculture
arguments are the ones that you need. The utility will open the file specified by -sourcefile
and create a font which only contains the characters which are needed to display that text.
The source file can be any text file, but if you point it at an XML localization file that Ultraviolet understands (like this one), then it will create a font based on the localized strings for the culture specified by the -sourceculture
argument.
I realize that this may still be a limitation for games which use a very large amount of text. I'm interested in providing better support for non-Roman character sets, so if this solution doesn't help you, please let me know what functionality you'd like to see added.
Thanks!
I want to make an RPG with lots of dialogs and text, so there should cover lots of glyphs. Moreover, I want to add some functions to allow user input some text such as names. Doing so in Monogame is a nightmare. So I search for an alternative for Monogame in C# and better multi-platform support.
I'll make a note to look into adding support for vector fonts in a future release. I can't give you an ETA right now, but it's definitely something I'm interested in doing.
I realize it has been a long time since this issue was posted, but I've finally started working on adding support for the FreeType2 library. This will allow Ultraviolet to use TrueType and OpenType fonts, including CJK fonts. Barring any unexpected setbacks, my hope is to include the initial version of this functionality in the 2018.04 release.
Support for FreeType2 fonts is complete and has been included in the 2018.04 release.
UltraViolet use sprite font like Monogame. But for languages like Chinese, Japanese, and Korean(known as CJK), there are too many glyphs in these languages.
So is there a better way to draw text?Simply using a ttf font file?