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

Font rendering looks ugly on Linux #35675

Closed
sivakov512 opened this issue Oct 6, 2017 · 103 comments
Closed

Font rendering looks ugly on Linux #35675

sivakov512 opened this issue Oct 6, 2017 · 103 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron font-rendering Font rendering issues linux Issues with VS Code on Linux upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Milestone

Comments

@sivakov512
Copy link

sivakov512 commented Oct 6, 2017

  • VSCode Version: Code 1.17.0 (be377c0, 2017-10-04T23:33:45.303Z)
  • OS Version: Linux x64 4.12.13_1
  • Extensions: Extensions are disabled

All fonts look ugly, you can see it on screenshot:
image

Console output (when runs with verbose option):

node[23225]: pthread_create: Invalid argument
[23231:1006/140049.274771:ERROR:platform_thread_posix.cc(119)] pthread_create: Invalid argument
[23231:1006/140049.275482:ERROR:atom_browser_main_parts_posix.cc(199)] Failed to create shutdown detector task.
[main 2:00:49 PM] Starting VS Code in verbose mode
[main 2:00:49 PM] from: /home/cryptomaniac/Downloads/VSCode-linux-x64/resources/app
[main 2:00:49 PM] args: { _: [],
  help: false,
  h: false,
  version: false,
  v: false,
  wait: false,
  w: false,
  diff: false,
  d: false,
  add: false,
  a: false,
  goto: false,
  g: false,
  'new-window': false,
  n: false,
  'unity-launch': false,
  'reuse-window': false,
  r: false,
  performance: false,
  p: false,
  'prof-startup': false,
  verbose: true,
  logExtensionHostCommunication: false,
  'disable-extensions': true,
  disableExtensions: true,
  'list-extensions': false,
  'show-versions': false,
  nolazy: false,
  'skip-getting-started': false,
  'sticky-quickopen': false }
[main 2:00:49 PM] Unable to read folders in /home/cryptomaniac/.config/Code/Workspaces (Error: ENOENT: no such file or directory, scandir '/home/cryptomaniac/.config/Code/Workspaces').
[main 2:00:50 PM] IPC#vscode-machineId
node[23309]: pthread_create: Invalid argument
[23231:1006/140050.847055:INFO:CONSOLE(28)] "%c[Extension Host] %cdebugger inspector at %cnode[23308]: pthread_create: Invalid argument
", source: file:///home/cryptomaniac/Downloads/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.main.js (28)
[main 2:00:51 PM] IPC#vscode-workbenchLoaded

Also, vscode font size outside editor (tabs, menus, etc) too small, - this is not from my gtk settings.
For example, this is a screenshot of working emacs - all fonts are looks well.
image

I'm working on Void Linux, VSCode ran from downloaded archive.
Also, I use Chromium and have no any troubles.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added the new release label Oct 6, 2017
@chrmarti chrmarti added the linux Issues with VS Code on Linux label Oct 6, 2017
@chrmarti
Copy link
Collaborator

chrmarti commented Oct 6, 2017

@Tyriar There might be a font that is missing? (This is Linux.)

@sivakov512
Copy link
Author

@chrmarti as for editor, I set exists fonts for editor (Droid Sans Mono Slashed, DejaVu Sans Mono and Droid Sans)

@Tyriar
Copy link
Member

Tyriar commented Oct 6, 2017

@cryptomaniac512 does it look right when you remove your custom font setting?

@sivakov512
Copy link
Author

@Tyriar, no.

@bpasero
Copy link
Member

bpasero commented Oct 6, 2017

@cryptomaniac512 is this a recent regression or are you using VS Code for the first time?

@bpasero bpasero added the info-needed Issue requires more information from poster label Oct 6, 2017
@bpasero bpasero added this to the Backlog milestone Oct 6, 2017
@sivakov512
Copy link
Author

@bpasero, I used the editor about 2 months ago and everything was fine.

@sivakov512
Copy link
Author

sivakov512 commented Oct 6, 2017

But font has always been small in spite of GTK settings :(

@bpasero
Copy link
Member

bpasero commented Oct 6, 2017

@cryptomaniac512 any difference with our previous release (1.16) to see if this is a regression in 1.17 alone?

@sivakov512
Copy link
Author

Same problem
image

@bpasero
Copy link
Member

bpasero commented Oct 6, 2017

@cryptomaniac512 I should have posted the link for 1.15 because in 1.16 we updated our UI framework (Electron) and that might have an impact too. How does it look in VSCode 1.15?

@sivakov512
Copy link
Author

:(
image

@sivakov512
Copy link
Author

Maybe try with 1.15.0 and 1.14?

@bpasero bpasero added the font-rendering Font rendering issues label Oct 6, 2017
@sivakov512
Copy link
Author

sivakov512 commented Oct 6, 2017

This problem reproduced with 1.14.2.
It looks like a problem with another software, but I have no problem anywhere instead of vscode.

And I'm sure that everything was fine a couple of months ago

@sivakov512
Copy link
Author

sivakov512 commented Oct 6, 2017

Fonts look good when I set sub-pixel geometry to none instead of RGB
image
This screenshot is for the 1.14.2

@sivakov512
Copy link
Author

sivakov512 commented Oct 6, 2017

But fonts in latest release and 1.16 are too small (I'm working with 112 dpi)
image
Look at window bar (File, Edit, Selection, etc)

@mgoku
Copy link

mgoku commented Oct 6, 2017

Probably problem with Freetype.

I got the same problem when I upgrade to Freetype 2.8.1. Everything work fine with an older version of Freetype.

Someone on Phoronix forum said something about bugs with older version of Google Skia.

https://www.phoronix.com/forums/forum/software/desktop-linux/979076-freetype-improvements-for-the-adobe-engine?p=979131#post979131

@alexdima alexdima removed their assignment Oct 6, 2017
@christianburger
Copy link

christianburger commented Oct 15, 2017

I have the same problem here, please advise if you find a solution / workaround.
This font rendering issue occurs similarly with Atom in my case, no other applications are affected.
Tested with Chromium Version 62.0.3202.18 (Developer Build) (64-bit) but also other versions, same result.
I've tried also tweaking the antialias settings for my NVidia card and plasma5 environment, no success.
It's really unuseable at the moment.

@theychx
Copy link

theychx commented Oct 17, 2017

I can confirm that this is a FreeType related problem. Downgrading the libfreetype6 package on my Debian Sid box from 2.8.1-0.1 to 2.8-0.2 resolved this issue for me (I have also not had any problems with other applications).

@christianburger
Copy link

Yes, I`m amazed, I've also downgraded to 2.8.0 on my gentoo desktop and the issue is gone.
Thanks a lot for your reply.

@julian-klode
Copy link
Contributor

This seems to be Skia bug 6663:

https://bugs.chromium.org/p/skia/issues/detail?id=6663

@Obbi89
Copy link

Obbi89 commented Mar 26, 2018

@paladdins maybe change it to:

sudo dpkg -i libfreetype6_2.8-0.2_amd64.deb
sudo apt-mark hold libfreetype6 

otherwise apt upgrade would reinstall the latest one. And the latest updates did not fix the issue.
People just need to remember to track that issue. Apt will show that a package is being held and not updated.

@fsevenm
Copy link

fsevenm commented Mar 27, 2018

Thanks a lot. The solution fixed my problem also. But I wonder how to release the hold after executing it.
sudo apt-mark hold libfreetype6

@sarbash
Copy link

sarbash commented Mar 27, 2018

But I wonder how to release the hold after executing it.

$ sudo apt-mark unhold libfreetype6
$ man apt-mark

@peterducai
Copy link

on Ubuntu I think I fixed with

sudo apt install ubuntu-restricted-extras

please confirm someone.. (without downgrading libfreetype)

@Obbi89
Copy link

Obbi89 commented Mar 27, 2018

Could be. It contains M$ proprietary ttf fonts. Might be that those are chosen then and cause less issues?

@simlevesque
Copy link

@peterducai I tried your package on a new install and it did not fix the issue. Downgrading freetype worked instantly.

@akurtovic
Copy link

I can confirm the issue on a fresh install of Ubuntu 18.04 beta with latest vscode. And downgrading libfreetype6 to 2.8-0.2 did fix it for me as well.

@dmitryvk
Copy link

Latest "insiders" build works fine with fresh version of freetype.

@Obbi89
Copy link

Obbi89 commented Mar 29, 2018

@dmitryvk yeah It has been known that newer electron versions did not have this issue.
So I guess they updated it finally. So we might expect this to be fixed by the next release.
Maybe this can be closed with the next monthly then :)


Again tl;dr
fix:

  1. Download http://snapshot.debian.org/package/freetype/2.8-0.2/#libfreetype6_2.8-0.2
  2. Install using sudo dpkg -i libfreetype6_2.8-0.2_amd64.deb
  3. Hold it (protect against upgrade/uninstall) with sudo apt-mark hold libfreetype6
  4. ????
  5. Profit!

Thanks to @paladdins et al.

@ramya-rao-a
Copy link
Contributor

Marking as verified as per updates above

@ramya-rao-a ramya-rao-a added the verified Verification succeeded label Mar 30, 2018
@ziyan-junaideen
Copy link

I am on an Ubuntu 18.04 pre release and had artifacts in rendered fonts as described. Following the last few comments I installed code-insiders. The artifacts are no longer there. My libfreetype6 version is 2.8.1-2ubuntu1. Thank you.

@sta-c0000
Copy link

I’m on Debian Stretch (stable), just tried code-insider-1.22.0-1522420669, still looks bad, but have not changed libfreetype6… but I also do not have other apps with bad font rendering.

I will simply continue using vscode stable with a simple patch: -webkit-text-stroke:0.25px; …If interested, you might want anywhere from 0.1px to 0.5px, perhaps 0.33px or 0.4px. This renders fonts with smoothing, potentially fat if you want them. Here is where to apply the patch:

What Top level affects most VSCode content
Where resources/app/out/vs/workbench/electron-browser/bootstrap/preload.js
From s.innerHTML=".monaco-shell { background-color:"+o+"; color:"+r+"; }"
To s.innerHTML=".monaco-shell { background-color:"+o+"; color:"+r+"; -webkit-text-stroke:0.25px; }"
What Markdown preview and webview (e.g. Help → Welcome)
Where resources/app/out/vs/workbench/parts/html/browser/webview-pre.js
From tmargin: 0;\n\t\t\t\tpadding: 0 20px;\n\t\t\t}
To tmargin: 0;\n\t\t\t\tpadding: 0 20px; -webkit-text-stroke:0.25px;}

@ffk27
Copy link

ffk27 commented Apr 1, 2018

@ulrich
Copy link

ulrich commented Apr 5, 2018

I had the same problem on Ubuntu Bionic and it's works fine when I downgrade FreeType to 2.8.0.

@thinw002
Copy link

thinw002 commented Apr 6, 2018

I had a similar issue on Windows after upgrading to the latest VS Code. I fixed it considerably by changing the fontFamily setting:

{
    "editor.fontFamily": "Inconsolata, Monaco, Consolas, 'Courier New', monospace"
}

@AydinChavez
Copy link

When will vs code support the libfreetyp6 version 2.8.1 - does anybody know?
downgrading / apt-mark hold for a package is just a workaround for the time being but not a final solution

@gombosg
Copy link

gombosg commented Apr 6, 2018

Oh, I just installed v1.22.1, font rendering is so beautiful now! The code editor fonts were OK before using custom fonts like Anonymous Pro, but the UI & integrated terminal fonts look way better now. Kudos!

(Info: I'm on Fedora 27, using the RPM vscode package, freetype 2.8.8, using "Better font rendering" plugin from Fedy)

@ashrafuzzaman
Copy link

ashrafuzzaman commented Apr 6, 2018

I did not have this issue until I upgraded Ubuntu 17.10 to Ubuntu 18.04 Bionic Beaver (development branch)

@AydinChavez
Copy link

Ok, just received visual code 1.22.1 on my ubuntu via apt which finally solved the issue with libfreetype 2.8.1
Thanks to the contributors.

Details:
https://code.visualstudio.com/updates/v1_22

@jacmoe
Copy link

jacmoe commented Apr 7, 2018

The March update (1.22) brought back VSCode for me - thanks a lot 😄
I almost forgotten how it looked like.
My system is Void Linux (rolling release), so if it works here, it would work anywhere :)

@sandangel
Copy link

sandangel commented Apr 26, 2018

Why I still having this issue:

image

here is my settings:

{
  "workbench.iconTheme": "material-icon-theme",
  "workbench.colorTheme": "An Old Hope",
  "files.useExperimentalFileWatcher": true,
  "editor.wordWrap": "on",
  "editor.fontFamily": "'Operator Mono', 'Ubuntu Mono', 'Fira Mono for Powerline'",
  "editor.fontSize": 14,
  "editor.fontLigatures": true,
  "editor.fontWeight": "100",
  "editor.dragAndDrop": false,
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
  "terminal.integrated.fontSize": 14,
  "terminal.integrated.confirmOnExit": true,
  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
  "terminal.integrated.fontFamily": "'Ubuntu Mono derivative Powerline', 'Fira Mono for Powerline'",
  "emmet.triggerExpansionOnTab": true,
  "sync.lastUpload": "",
  "sync.autoDownload": false,
  "sync.autoUpload": false,
  "sync.lastDownload": "2018-03-31T03:42:49.973Z",
  "sync.forceDownload": false,
  "sync.host": "",
  "sync.pathPrefix": "",
  "sync.quietSync": false,
  "sync.askGistName": false,
  "html.format.wrapAttributes": "force-aligned",
  "debug.inlineValues": true,
  "gitlens.codeLens.recentChange.enabled": false,
  "gitlens.codeLens.authors.enabled": false,
  "prettier.singleQuote": true,
  "prettier.printWidth": 100,
  "ng-c-ext.shutupMode": true,
  "ng42.barrels.useTemplates": {
    "header": false,
    "footer": false
  },
  "html-css-class-completion.includeGlobPattern": "**/*.{scss,css,html}",
  "rust-client.channel": "stable",
  "guides.enabled": false,
  "gitlens.keymap": "alternate",
  "sync.removeExtensions": true,
  "sync.syncExtensions": true,
  "gitlens.advanced.messages": {
    "suppressCommitHasNoPreviousCommitWarning": false,
    "suppressCommitNotFoundWarning": false,
    "suppressFileNotUnderSourceControlWarning": false,
    "suppressGitVersionWarning": false,
    "suppressLineUncommittedWarning": false,
    "suppressNoRepositoryWarning": false,
    "suppressResultsExplorerNotice": false,
    "suppressShowKeyBindingsNotice": true
  }
}

@Obbi89
Copy link

Obbi89 commented Apr 26, 2018

@sandangel
Sorry can't see any issue in your image. Especially not the rendering issues this issue is related to

@sandangel
Copy link

sandangel commented Apr 26, 2018

hi, my image is showing how the font look like in linux and windows at the same time and on the same machine using vmware for virtual linux machine. they are very different although I’m using the same font and setup on both. the font look very urgly on linux but very beautiful in windows

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron font-rendering Font rendering issues linux Issues with VS Code on Linux upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests