none
Strange colors with letters on windows form

    Question

  • Dear everyone,

                 Please refer to the picture:   https://social.msdn.microsoft.com/Forums/getfile/1415227 

                 In visual studio, I  try to set the text font to Arial bold 10pt. Visual studio set the font size to 9.75pt, which I don't why. The problem is that some letters like "O" has red color it them. This degrade the visual quality. Does anyone know the reason and how to remove this defect?

                 Thank you very much and best regards,

                                 HUANG Huan




    • Edited by HUANG Huan Thursday, March 14, 2019 11:00 AM
    Thursday, March 14, 2019 10:57 AM

Answers

  • Do you see better results if you check the same text and font in Notepad, for example?

    You can fix the size programmatically, handling the Load event of the Form:

       Font = new Font( "Arial", 10.0f, FontStyle.Bold );

       menuStrip1.Font = Font;

    • Marked as answer by HUANG Huan Friday, March 15, 2019 9:20 AM
    Thursday, March 14, 2019 6:09 PM

All replies

  • Do you see better results if you check the same text and font in Notepad, for example?

    You can fix the size programmatically, handling the Load event of the Form:

       Font = new Font( "Arial", 10.0f, FontStyle.Bold );

       menuStrip1.Font = Font;

    • Marked as answer by HUANG Huan Friday, March 15, 2019 9:20 AM
    Thursday, March 14, 2019 6:09 PM
  • Hi HUANG Huan,

    (1) I suppose Fore-Color of font does not affect visual quality. How do you feel if you change red color to black?
    (2) Why 10 pt of font size is replaced with 9.75 (DPI scaling 100%) or 10.2 pt (DPI scaling 125%) automatically is , I guess, caused from automatic scaling of DPI by Visual Studio.
    (3) If you feel degrading visual quality (i.e. blurring font), please try the following.
       (3-1) AutoScaleMode (of Windows Form) : Dpi (instead of Font)
       (3-2) Add a new item (Application Manifest) and remove comment in it like this:
        
    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    P.S. Please refer to this article:  Automatic scaling in Windows Forms
    • Edited by Ashidacchi Friday, March 15, 2019 12:34 AM add more info
    Friday, March 15, 2019 12:31 AM
  • Hi HUANG Huan,

    I tried to reproduce the issue in my VS. But the font can be set and displayed normally in the vs. Maybe you can try the method Viorel_ said that set the font in "Load" event.

    As for the "red color", I think it may be caused by the way of "font rendering", which is related to the properties of the display.

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 15, 2019 5:49 AM
    Moderator
  • Hi Voirel, the same effects could be seen in Notepad. I tried your suggestion. It works. Thank you!


    HUANG Huan


    • Edited by HUANG Huan Friday, March 15, 2019 9:30 AM
    Friday, March 15, 2019 9:19 AM
  • Hi, Kyle. Thank you for your support. Yes, Voirel's method indeed can successfully change the font size from 9.75pt to 10pt.

    As for the red color, I tried to input the same text with the same font in notepad, and find that the same phenomenon could be seen. What I don't understand is why there some red and other color pixels exist with the black font. I agree this might be related to the LCD display or operating system.

    Regards,


    HUANG Huan

    Friday, March 15, 2019 9:29 AM
  • Thank you Ashidacchi for your kind support. I tried your suggestion, i.e. change the AutoScaleMode to DPI, and modify the Application Manifest. But these don't improve the visual quality of the menu items. I also tried to input the same text with the same font in notepad, and the same phenomenon could also be seen. So as Kyle have said, this might be caused by the way of font rendering, which is related to the LCD display.

    Thank you anyway and best regards,


    HUANG Huan

    Friday, March 15, 2019 9:36 AM