Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:32:10+00:00 2026-05-31T16:32:10+00:00

As you can see the upper dark X’s are cut even though there is

  • 0

enter image description here

As you can see the upper dark X’s are cut even though there is space for them.

This happens because they have changed color and are printed backwards (from right to left).

Is this a bug, faulty code, a bad setup on my system or (I doubt it) like it is supposed to be?

Here is the code that generates this output:

#include <Windows.h>
#include <iostream>
void moveTo(int x,int y){
    COORD kord={x,y};
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),kord);
}
void setColor(WORD attributes){
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), attributes);
}

void main(){
    for(int i=9;i+1;i--)
    {
        moveTo(i,0);
        std::cout.put('X');
    }
    for(int i=-10;i;i++)
    {
        moveTo(i+10,1);
        std::cout.put('X');
    }
    setColor(8);
    for(int i=9;i+1;i--)
    {
        moveTo(i,2);
        std::cout.put('X');
    }
    for(int i=-10;i;i++)
    {
        moveTo(i+10,3);
        std::cout.put('X');
    }
    setColor(7);
    for(int i=9;i+1;i--)
    {
        moveTo(i,4);
        std::cout.put('X');
    }
    for(int i=-10;i;i++)
    {
        moveTo(i+10,5);
        std::cout.put('X');
    }
    std::cin.get();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:32:12+00:00Added an answer on May 31, 2026 at 4:32 pm

    This is a bug in Windows.

    As mentioned in the errata by Hans Passant:

    I repro too, VS2008 on Win7. Cool bug. Changing the console font fixes it.

    Let’s use this bug isolation. I recognize this font as Petite Terminal, 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.

    The question becomes why it’s writing exactly one additional column of pixels in the context of the default terminal font, color 8, and backwards writing into a console screen buffer.

    Specifically, let’s break this problem up into its component pieces:

    1. When a write is issued, a character is written to a location in the terminal array
    2. When the default color (7) is selected, pixels do not overflow into other buffers within the array
    3. 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

    Because of the presence of overspill in (3), this is a bug.

    Quoting Raymond Chen:

    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.

    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.

    …

    “Well, that’s stupid. You should’ve stopped me from choosing a font
    that so clearly results in nonsense.”

    And that’s what we did.

    Not that I’m blaming Raymond on this one, but he authoritatively illustrates this as a “can’t happen.”

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can see some potential difficulties with this concept but the idea is: I
I can see there are a lot of questions for getting the number of
This is my page: http://www.clouderize.it/michele/ As you can see the menu voice Storia del
I can see the Graphical Layout of the XML file within the /res/layout folder,
I can see it looks like an alias for an unsigned int pointer, right?
I can see where svn:keywords like Id, LastChangedDate and Author are used and replaced
I can see how to change the fonts and colors in the IDE. Is
I can see that GD library is for images. But I can't see differences
I can see that Collections.unmodifiableSet returns an unmodifiable view of the given set but
I can see how you can use the Acl Extension to control the push/pull

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.