-
I use DrawString to write on screen but I couldn't find a way to change font size or load a font, how do I do it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
To load another font you need it to be in the PSF (PC Screen Font) format, you can do something like this to use in DrawString: PCScreenFont myFont = PCScreenFont.LoadFont(yourFontBytes); |
Beta Was this translation helpful? Give feedback.
-
I'm also trying to use a custom font (TrueType Font), but when I use: public byte[] defaultFontFile;
public PCScreenFont DefaultFont;
protected override void BeforeRun()
{
// Do initial loading.
defaultFontFile = File.ReadAllBytes(Properties.Resources.Saira);
if (defaultFontFile != null)
{
DefaultFont = PCScreenFont.LoadFont(defaultFontFile);
}
} I get the following Build error: 1>IL2CPU : error : Exception: System.Exception: Native code encountered, plug required. Check build output for more information. However, since I've only just started with COSMOS, I clearly have no idea what to do next. Obviously a Plug is required. I don't know which one, or where to find one. Is anybody able to help me out with this? :) |
Beta Was this translation helpful? Give feedback.
In PCScreenFont, Simply you can't.
You need to load a font with custom size, no option to change size.