Cannot change powershell default font to Lucida Console

04
2013-09
  • IHaveAStupidProblem

    This is a trivial problem, but it annoys me that I can't get to the bottom of it:

    I'm running Windows 8, Powershell version 3.0. By right-clicking on the title bar I can go into the Properties and change the font, size, background colour etc without any problems.

    After closing and restarting Powershell, all of the changes I've made stick except that if I've set the font to Lucida Console then on reopening I get the Raster font.

    (Note that all of the above applies to when I run Powershell as Administrator.)

    So:

    • If I set the font to Lucida, then it switches to Lucida for the remainder of the session.
    • If I set the font to anything other than Lucida, then it stays as that after closing and reopening.
    • If I alter the window sizes or text colours or anything else, the changes persist after reopening.
    • The only thing that goes wrong is that if I set the font to Lucida, it switches to 'Raster fonts' when I reopen.
    • But cmd and powershell ISE don't have this problem - only the powershell console.

    Can anyone suggest what might be going wrong?

    (One observation I've made is that upon re-opening Powershell after setting the font to Lucida, at first the width of the window is what it would be if the font were Lucida, but then after a second, it widens slightly to accommodate the raster font.)

  • Answers
  • Pritesh Patel

    I've found this behavior before, even with Windows 7. Try this - open a PowerShell window in admin mode (right click the icon open as administrator), change the font and close the window. Now open a PowerShell window with normal user rights and your changes should stick.

  • Julian Knight

    As @aphoria suggests, I suspect that the font file may be corrupt.

    I recommend grabbing a copy of the font files from another computer, deleting the ones on your computer and copying over the known good files.

    I certainly use this font all the time with command windows and I don't have any problems.

  • charleswj81

    Very odd, I can't replicate, even on Win8/PS3. This guy seems to be experiencing the same issue as you, so there must be something to it.

    When you change the font, it writes the changes back to the .lnk file used to launch PowerShell when you click OK. To see what file that is, right-click the icon you are launching with and look at the General tab, Location: field. Does its last mod time correspond to when you change the font? Does the change show in the properties of the shortcut? How about if you make the change and then set the .lnk to read-only?

  • Pieinacup

    This guy had the problem as well. Worked for me:

    However, my shell in Windows 7 refused to save the setting and insisted on changing back to Raster Fonts when I re-opened PowerShell. It worked fine with Consolas, but I wanted Lucida dammit!

    The Workaround: Select a font size other than 12 points."

    http://www.michaeladshead.co.uk/blog/?p=145

    :-)


  • Related Question

    How to change the Windows XP console font?
  • Ashwin

    I have been using Cleartype and Vista fonts on Windows XP for quite a while now. I love the Consolas font for working with source code. I would love to have it as the font of my Windows console (command) window too. Is there a way to do this?


  • Related Answers
  • Canadian Luke
    • Create a backup of the windows registry.

    • On regedit, navigate to

      HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Console\TrueTypeFont

    • Right click on the right pane, select New -> String value.

    • Write 00 as the entry name.

    • Right click on the new entry, click on Modify.

    • Write the name of the desired font on the Value data field. That value should match one of the entries on HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Fonts

    • If you want to add additional fonts, repeat the previous steps, adding a 0 to the entry name each time (that is, the third entry should be 000 and so on).

    • Reboot your PC to apply the changes.

    • Open a console window, right click on the title bar, select Properties.

    • Select the Font tab. The new fonts should appear on the list.

    Before doing any of this, please read the article "Why are console windows limited to Lucida Console and raster fonts?", which explains in great detail why you shouldn't do that anyway.

  • John T

    This is a simple registry tweak.

    HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Console\TrueTypeFont
    

    Add a string value (REG_SZ) with the name 00 and put Consolas in the 'data' field.

    You will then need to reboot your PC, and change the default within command prompt.

    Start -> Run -> Cmd.

    Right click the title of the window -> Properties -> Fonts.

  • Arjan

    See also How to set the command prompt font on XP? on Server Fault.

  • teresko

    Well ... you can always try something like this to replace your old cmd : http://sourceforge.net/projects/console/

  • dangph

    Use ConEmu. It is way superior to the "DOS box". It's better than Console too.