Page 1 of 1

Is there a way to disable font smoothing?

PostPosted: Sat Jan 02, 2016 11:48 am
by Mistangoman
I'm using off-screen rendering to render an interface for my game. I use a pixelart-esque font for all my text as it is more fitting stylistically. However cef decides to use anti-aliasing to draw the font. I can't seem to find a way to disable it. Using css, font-smooth and -webkit-font-smoothing don't seem to do anything. As the actual result of the rendering process is drawn at twice the scale in my application the effect this has on the integrity of the pixelfont is terrible.

Firefox does not draw the text this way. I'm not certain about Chrome. I don't use Chrome personally and font rendering seemed to differ on the two machines I've tested it on.

So far I'm using a workaround. Drawing every text on canvas using cufon. However cufon is neither a modern solution, nor actively developed.

Re: Is there a way to disable font smoothing?

PostPosted: Mon Jan 04, 2016 11:40 am
by magreenblatt
You can try passing the `--disable-direct-write` command-line flag.

Re: Is there a way to disable font smoothing?

PostPosted: Mon Jan 04, 2016 6:12 pm
by Mistangoman
That does indeed work, thanks. How much can I rely on this? I didn't even expect direct write to be used in off-screen rendering mode.

Re: Is there a way to disable font smoothing?

PostPosted: Mon Jan 04, 2016 6:17 pm
by magreenblatt
Mistangoman wrote:How much can I rely on this?

What do you mean?

Re: Is there a way to disable font smoothing?

PostPosted: Thu Jan 07, 2016 9:11 am
by Mistangoman
Well, couldn't DirectWrite become mandatory? And I don't know what happens on different operating systems as DirectWrite only exists on Windows anyway.

Re: Is there a way to disable font smoothing?

PostPosted: Thu Jan 07, 2016 11:42 am
by magreenblatt
Mistangoman wrote:Well, couldn't DirectWrite become mandatory?

Yes, it's likely after XP support is removed.

Mistangoman wrote:And I don't know what happens on different operating systems as DirectWrite only exists on Windows anyway.

Different OSes have different font implementations. You'll need to solve the problem on a per-platform basis or approach the Chromium devs about exposing an option for this.

Re: Is there a way to disable font smoothing?

PostPosted: Fri Jul 22, 2016 11:03 am
by palacs
The removal of GDI support has just reached the stable version of Google Chrome. This means, everyone who gets updated to the latest version of Chrome, will have blurry DirectWrite fonts as their only option (will be no option anymore to disable DirectWrite).

Here is the response from those who are not satisifed with blurry DirectWrite fonts that are only good for developers living their blind idealism and some graphics designers equipped with high-end displays.

https://www.change.org/p/google-inc-bring-sharp-fonts-back-in-google-chrome-disable-directwrite

Please sign this petition and show Google that we are opposing the withdrawal of our freedom of choice. Please share this petition to reach more people who would like to express their opinion.