0

Okay, I'm making a game.. I want to load a custom font into the console to draw graphics in my game. And the main thing is to load the font programmatically so that another user who launches my game can immediately see this very font, and not the standard consolas or somethisng else.

I already know how to change the font / font size. I already know how to replace the standard console colors with the ones I need. But now I want to draw and upload my own font, is it possible?

Of course I'm going to draw a monospaced (even square) font.

  • 1
    why would you need a custom font in a console application? it makes no sense - console applications are not design for graphical user interfaces... –  Dec 10 '20 at 19:00
  • 1
    Does this answer your question? [Changing font in a Console window in .NET](https://stackoverflow.com/questions/1802600/changing-font-in-a-console-window-in-net) –  Dec 10 '20 at 19:01
  • @tommy99 There is no an answer. I'm making a roguelike for my dad, I definitely need to do this in the console. – Nate Zephyr Dec 10 '20 at 19:11
  • why not do in WPF or windows forms? why console? it makes zero sense. –  Dec 10 '20 at 19:12
  • @tommy99 Just because I like doing things in the console, why are you trying to convince me? I just asked how to load a custom font https://scontent-waw1-1.xx.fbcdn.net/v/t1.0-9/130966230_436907887714925_3200288775112122481_o.jpg?_nc_cat=106&ccb=2&_nc_sid=730e14&_nc_ohc=CIULj75OcugAX8qydbP&_nc_ht=scontent-waw1-1.xx&oh=aae4af5afbb2121790eca753d2405f29&oe=5FF61980 – Nate Zephyr Dec 10 '20 at 19:28
  • 3
    Because sometimes the correct answer is "just don't do it like that". If you want to make a game, maybe use Unity - that's the C#-based environment which is specifically designed for games developers. Any kind of roguelike game is going to be pretty tricky to implement (and/or produce very suboptimal results) in the console, for a lot of different reasons. Use the right tool for the job. You wouldn't use a yard brush to paint a wall, would you? – ADyson Dec 10 '20 at 19:53
  • You can try using a WinForm and Paint on the background using GDI+ API. Or use Unity. –  Dec 10 '20 at 20:13
  • 1
    So at runtime you're going to create a new font, then switch to it? You can't install all these fonts ahead of time when you install your console app, then switch to them? – Dan Csharpster Dec 10 '20 at 20:20
  • @DanCsharpster Oh, on the topic! Dude, I want to load my font to the console, I'll draw the font myself. And I also want another user, for example my dad, to be able to download / install my game and run it with this font immediately, without additional configuration. – Nate Zephyr Dec 10 '20 at 21:15
  • 1
    If you want this on a Windows based console (I'm not sure if you specified) then you are kinda past what the console was meant for. I'm not saying you couldn't do it. With enough time and effort you could build yourself a Death Star. However, in this case I think your time might be better spent creating something like a console emulator in a browser then sharing a central database of fonts between all of the connected clients. You're also going to need a console designer...in the console, right? I dunno man. Good luck! – Dan Csharpster Dec 11 '20 at 01:33
  • @DanCsharpster Browser version is an interesting idea, thanks man – Nate Zephyr Dec 12 '20 at 15:18
  • No problem. I think something like Electron or Blazor WebAssembly, the latter of which would allow you to stay in C# land, would be a good candidate for this. – Dan Csharpster Dec 12 '20 at 22:01

0 Answers0