title: Unable to set the y of the font to 1 in the windows console
body: <p>I recently experienced some a.p.i. of the windows console in C, and, in particular, those for managing the buffer and the window.
  My goal is to treat the prompt as a window for graphics where pixels are represented by characters.
  To have a good resolution, and to be able to approximate the pixel to a character, I need to minimize the font size.
  An example I tried on my machine is 400 * 400 characters of size 1 * 1.
  On my computer (W10) I use the console api and I don't have any kind of problem, in fact I can create the aforementioned window.
  The problem arises when I start the executable on other PCs.
  Proceeding by trial and error, I came to the conclusion that the malfunction occurs only if the y dimension of the font is 1.
  For example, trying to create a 400 * 400 window of 1 * 1 characters, each character will actually have a size of 1 * 3 (in fact this leads to a rectangular window).
  Any other size works perfectly (2 * 2.1 * 2.3 * 3.1 * 5, ...).
  Furthermore, the a.p.i. they do not return any type of error.
  This is the code I am using:</p>
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;wchar.h&gt;
  
  int main()
  {
      int Ydim = 400; int Xdim = 400;
      int PY = 1; int PX = 1;
  
      HANDLE hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
      SetConsoleActiveScreenBuffer(hConsole);
  
          //  Minimize the window as the buffer may become smaller than the current size 
          //  (but it could never become smaller than 0,0,1,1)
      SMALL_RECT h = {0,0,1,1};
      if (!SetConsoleWindowInfo(hConsole, TRUE, &amp;h))
          return -1;
  
      
          // Change font dimensions
      CONSOLE_FONT_INFOEX cfx;
      cfx.cbSize = sizeof(cfx);
      cfx.dwFontSize.X = PX;
      cfx.dwFontSize.Y = PY;
      cfx.nFont = 0;
      cfx.FontFamily = FF_DONTCARE;
      cfx.FontWeight = FW_NORMAL;
      wcscpy(cfx.FaceName, L&quot;Consolas&quot;);
  
      if (!SetCurrentConsoleFontEx(hConsole, FALSE, &amp;cfx))
          return -1;
          
      
      COORD a = {Xdim,Ydim};
      if (!SetConsoleScreenBufferSize(hConsole,a))
          return -1;
      
  
          //  The physical window has the same dimension of the font
      SMALL_RECT k = {0,0,a.X - 1,a.Y - 1};
      if (!SetConsoleWindowInfo(hConsole, TRUE, &amp;k))
          return -1;
  
  
      Sleep(30000);
      return 0;
  }
  </code></pre>
  <p>Here are the screenshots (this is the same program)</p>
  <p><a href="https://i.stack.imgur.com/AajFN.png" rel="nofollow noreferrer">In my machine</a></p>
  <p><a href="https://i.stack.imgur.com/MCiEA.png" rel="nofollow noreferrer">On other machines</a></p>
  <p>You can see that i have highlited a character on each image to prove that they are different.
  I would like to specify that I am using the same version of windows on every machine.
  I hope I have explained the problem well enough. Any help in trying to solve it is greatly appreciated. Thanks in advance.</p>