Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>This is a bug in Windows.</strong></p> <p>As mentioned in the errata by <a href="https://stackoverflow.com/users/17034/hans-passant">Hans Passant</a>:</p> <blockquote> <p>I repro too, VS2008 on Win7. Cool bug. Changing the console font fixes it.</p> </blockquote> <p>Let's use this bug isolation. I recognize this font as <a href="https://en.wikipedia.org/wiki/Point_%28typography%29#Traditional_point-size_names" rel="nofollow noreferrer">Petite</a> <a href="https://en.wikipedia.org/wiki/Terminal_(typeface)" rel="nofollow noreferrer">Terminal</a>, which implies you both most likely configured this project as a Win32 Console Application. The additional repro with GCC confirms this hypothesis, and we will assume, from a practical standpoint, that all of you were getting a 32-bit console application running inside of a Windows terminal.</p> <p>The question becomes <em>why</em> it's writing exactly one additional column of pixels in the context of the default terminal font, color 8, and backwards writing into a <a href="http://msdn.microsoft.com/en-us/library/ms682088%28v=VS.85%29.aspx#_win32_character_attributes" rel="nofollow noreferrer">console screen buffer.</a></p> <p>Specifically, let's break this problem up into its component pieces:</p> <ol> <li>When a write is issued, a character is written to a location in the terminal array</li> <li>When the default color (7) is selected, pixels do not overflow into other buffers within the array</li> <li>When color 8 is selected, an additional column of pixels is written to the next region of the buffer, which is only visible when the text is recited backwards</li> </ol> <p>Because of the presence of overspill in (3), this is a bug. </p> <p><a href="http://blogs.msdn.com/b/oldnewthing/archive/2007/05/16/2659903.aspx" rel="nofollow noreferrer">Quoting</a> Raymond Chen:</p> <blockquote> <p>The console rendering model assumes each character fits neatly inside its fixed-sized cell. When a new character is written to a cell, the old cell is overprinted with the new character, but if the old character has overhang or underhang, those extra pixels are left behind since they "spilled over" the required cell and infected neighbor cells. Similarly, if a neighboring character "spilled over", those "spillover pixels" would get erased.</p> <p>The set of fonts that could be used in the console window was trimmed to the fonts that were tested and known to work acceptably in console windows. For English systems, this brought us down to Lucida Console and Terminal.</p> <p>...</p> <p>"Well, that's stupid. You should've stopped me from choosing a font that so clearly results in nonsense."</p> <p>And that's what we did.</p> </blockquote> <p>Not that I'm blaming Raymond on this one, but he authoritatively illustrates this as a "can't happen." </p> <p>The selection and testing of console fonts for Windows should have caught this. The fact that it's even an issue at all is an aberration. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload