mactype icon indicating copy to clipboard operation
mactype copied to clipboard

Text in Visual Studio was partially rendered

Open wmjordan opened this issue 2 years ago • 12 comments

The following screenshot was taken from the code window of VS 2022.

image

Some italic characters (marked yellow) were not anti-aliased, but some were properly rendered (marked green). I closed that code window and opened the code file again, it became normal.

image

I had not encountered such kind of issue before the recent pre-released RC2. The RC1 was working well.

wmjordan avatar Aug 16 '22 06:08 wmjordan

Would you mind uploading your profile?

snowie2000 avatar Aug 16 '22 07:08 snowie2000

Thank you for looking into this issue.

Here's my MacType profile. SoftGrayNoHinting.zip

I am using my VS extension to enable italic style in VS, which provides the effect for the sample code file in the above post.

This issue appeared to be quite random. I could not reproduce it with absolute certainty. Hope the above file helps.

wmjordan avatar Aug 16 '22 08:08 wmjordan

Okay... so how can I make my code editor italic with your extension?

snowie2000 avatar Aug 16 '22 08:08 snowie2000

  1. Open a code file (any type of code file, C++, C, HTML, etc.)
  2. Place the caret onto the code element that you want to change its style (in the following screenshot, the comment in the code)
  3. Execute the Customize Codist Syntax Highlight command in the Tools menu.
  4. A dialog will appear, on the right part of the list, classified syntax styles corresponding to the code where the caret is located are listed (comment and formal language in the screenshot).
  5. Click the one that you want to change.
  6. Check the Italic check box and you can see the corresponding changes in the code file window.
  7. Click the Save button to keep the changes.

Here's the example: image

wmjordan avatar Aug 16 '22 09:08 wmjordan

Your extension worked like magic. It's so easy to use and super handy.

I didn't encounter any problem with italic fonts. I suspect that it has something to do with you disabling ClearType.

snowie2000 avatar Aug 16 '22 09:08 snowie2000

BTW,

The "Not-working" screenshot in the first post of this issue, I not only assigned the italic style but also decreased the font size of the C# attribute annotation. This issue occurred several times and each time it took place at the shrunken C# attribute.

image

I suspect that it has something to do with you disabling ClearType.

Hmm, I had recently disabled the ClearType by hacking the registry. I might be the reason why I did not encounter it previously.

As you can see on the above screenshot in this post, the display was beautifully rendered by MacType again while I was taking the screenshot--this issue does not occur every time.

wmjordan avatar Aug 16 '22 09:08 wmjordan

I've restarted my vs2022 several times with font size shrunk down. It worked beautifully every single time.

snowie2000 avatar Aug 16 '22 09:08 snowie2000

Please don't deliberately reproduce this issue that occurs occasionally.

Perhaps it is OK to change the code comment styles to font size = -1 and italic, then keep working with VS as usual. If someday it occurs on your VS, then look into it. If it doesn't, let it be, since it is not so severe.

wmjordan avatar Aug 16 '22 10:08 wmjordan

Hi, you can try "Text Sharp" vs extension.

微信截图_20220817085749 微信截图_20220817085601 微信截图_20220817085640

digiant avatar Aug 17 '22 01:08 digiant

As @digiant mentioned, there are extensions that can change the text rendering effects in VS. My extension also has such kind of settings, that can be changed from Tools/Options in VS. However, I don't think it can cause this issue. With MacType, those settings are actually neither necessary nor in effect any more. I had TextSharp uninstalled for years after MacType was taking effect on VS.

image

I agree with snowie that this issue might be caused for ClearType had been turned off on my computer.

wmjordan avatar Aug 17 '22 01:08 wmjordan

One more screenshot, taken from the Add New Project dialog: image

Recently there is a commit that may force gray-scale rendering in DirectWrite, which may fix #873. Hereby I can turn on ClearType afterwards and see whether this issue reoccurs and make the assumption that "this issue might be caused for ClearType had been turned off on my computer".

Possible to build a new test version for the recent commit?

wmjordan avatar Aug 19 '22 03:08 wmjordan

Unfortunately that patch doesn't work in edge and chrome. That's why I did not rush to release a new version.

snowie2000 avatar Aug 19 '22 10:08 snowie2000