Skip to content

Commit

Permalink
Rewrite console font changing.
Browse files Browse the repository at this point in the history
 * Remove the old "Vista" code path in favor of two code paths:
    - setSmallFontVista: sets a TrueType font to match the code page
    - setSmallFontXP: uses SetConsoleFont to activate the smallest
      viable font in the console's font table

 * Selecting a CJK-specific TrueType font is important so that double-width
   characters occupy two cells in the console, which is important for
   maintaining consistency between the console and the Unix terminal.
   (Perfect consistency here might be impossible, but using the appropriate
   font improves things.)  winpty currently duplicates double-width
   characters, but that will be fixed soon.
  • Loading branch information
rprichard committed Oct 11, 2015
1 parent 31ee484 commit c3999b5
Show file tree
Hide file tree
Showing 9 changed files with 591 additions and 263 deletions.
3 changes: 2 additions & 1 deletion agent/Agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "Terminal.h"
#include "NamedPipe.h"
#include "AgentAssert.h"
#include "ConsoleFont.h"
#include "../shared/DebugClient.h"
#include "../shared/AgentMsg.h"
#include "../shared/Buffer.h"
Expand Down Expand Up @@ -82,7 +83,7 @@ Agent::Agent(LPCWSTR controlPipeName,
m_bufferData.resize(BUFFER_LINE_COUNT);

m_console = new Win32Console;
m_console->setSmallFont();
setSmallFont(m_console->conout());
m_console->moveWindow(SmallRect(0, 0, 1, 1));
m_console->resizeBuffer(Coord(initialCols, BUFFER_LINE_COUNT));
m_console->moveWindow(SmallRect(0, 0, initialCols, initialRows));
Expand Down
Loading

0 comments on commit c3999b5

Please sign in to comment.