Author Topic: Changing the font and the font size of a console via API  (Read 15362 times)

jj2007

  • Member
  • *****
  • Posts: 12479
  • Assembler is fun ;-)
    • MasmBasic
Re: Changing the font and the font size of a console via API
« Reply #15 on: December 19, 2012, 05:26:38 AM »
Changing Console Fonts :

http://blogs.microsoft.co.il/blogs/pavely/archive/2009/07/23/changing-console-fonts.aspx

Good link. I thought of using Dave's enumeration together with SetConsoleFont, but it is still unclear to me how to get from the enum to having the index that SetConsoleFont asks for.

Donkey

  • Member
  • **
  • Posts: 201
  • ASS-embler
    • Donkey's Stable
Re: Changing the font and the font size of a console via API
« Reply #16 on: December 19, 2012, 05:39:38 AM »
Good link. I thought of using Dave's enumeration together with SetConsoleFont, but it is still unclear to me how to get from the enum to having the index that SetConsoleFont asks for.

Tough call since Microsoft has been actively eliminating everything that allows you to manipulate the console fonts programmatically since Windows 2000. If you do find a way there is little guarantee that it will survive a service pack let alone a version upgrade. Microsoft decided years ago that allowing programmatic changes introduced far too much instability in the console has been removing it.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q247815

Quote
In Windows 2000, the installation of Console Fonts is no longer automated. This was done to give the console window greater stability in multilanguage environments.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Changing the font and the font size of a console via API
« Reply #17 on: December 19, 2012, 05:49:20 AM »
my enum code uses EnumFontFamiliesEx
that may not be the best choice for what you want to do

there is EnumFonts(Ex) and, perhaps, GetFontData
beyond that, you may have to select a font into a DC in order to get more info

as you can see from the lucida console font, true-type font files can embed mono-space fonts
the font is both true-type and mono-space   :P
if you get really interested, you can research info on how to create font files

personally, i think it is way too much effort to put into a console app - lol
« Last Edit: February 12, 2016, 07:34:14 PM by dedndave »