Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings for ClearType level on Windows #4084

Closed
1 task done
vaisest opened this issue Dec 4, 2023 · 3 comments
Closed
1 task done

Add settings for ClearType level on Windows #4084

vaisest opened this issue Dec 4, 2023 · 3 comments

Comments

@vaisest
Copy link

vaisest commented Dec 4, 2023

Pre-checks*

  • The feature request has not been suggested in this repository.

The Missed*

Text displayed by the internal PDF viewer is ugly on an OLED screen which does not have a standard RGB subpixel layout.
Here is a screenshot comparing the internal PDF viewer (left) with Firefox with gfx.font_rendering.cleartype_params.cleartype_level = 0 (right).
image
SKY20231204_152213256

The picture is clearly not the best example ever, but the left picture shows colour fringing due to the ClearType subpixel rendering. The resulting text is much more thick, but I believe this may be controllable with the other cleartype_params settings in Firefox. Chrome also has a relevant setting called --disable-lcd-text and so does VSCode as it uses Electron. The setting in VSCode however does not fix the internal PDF viewer.

The Solution*

Firefox has a setting called gfx.font_rendering.cleartype_params.cleartype_level which desaturates the rendered text. This doesn't disable anti-aliasing, but allows for the browser to display PDFs with grayscale rendering. This looks much better on an LG OLED panel.

Anything Else?

Relevant issue highlighting why ClearType performs badly on OLED screens: microsoft/PowerToys#25595

@mdrejhon
Copy link

mdrejhon commented Dec 5, 2023

There is an FreeType third party pull request modification that can add subpixel layout support for OLEDs too.

rennr/freetype#1

I'd like to see it upstream into the main FreeType repo, so it can go to all distributions. So the word "cleartype" should be changed to something else generic (subpixel rendering) long term, especially as more open source projects gain support.

Custom subpixel geometry support is already in https://github.com/snowie2000/mactype and now that someone made a modification for FreeType.

I'd like to see custom subpixel geometry support become more widespread in open-source font rendering libraries.

Open source text renderers now have two options;

  • FreeType (pull request)
  • MacType (main)

EDIT: @vaiset, please forward this message to any issue submissions at any other repos (e.g. Electron).

@James-Yu
Copy link
Owner

James-Yu commented Dec 5, 2023

The extension cannot change electron settings. You may consider submitting an issue to vscode’s repo.

@James-Yu James-Yu closed this as completed Dec 5, 2023
@vaisest
Copy link
Author

vaisest commented Dec 7, 2023

The extension cannot change electron settings. You may consider submitting an issue to vscode’s repo.

I might have explained it badly. I don't mean changing VSCode's settings, I only mean the PDF viewer. If I launch VSCode with --disable-lcd-text all text is already grayscale, except for the PDF viewer.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants