Is there a way to disable font smoothing?

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Is there a way to disable font smoothing?

Postby Mistangoman » Sat Jan 02, 2016 11:48 am

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.
Mistangoman
Newbie
 
Posts: 4
Joined: Sat Jan 02, 2016 11:29 am

Re: Is there a way to disable font smoothing?

Postby magreenblatt » Mon Jan 04, 2016 11:40 am

You can try passing the `--disable-direct-write` command-line flag.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Is there a way to disable font smoothing?

Postby Mistangoman » Mon Jan 04, 2016 6:12 pm

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.
Mistangoman
Newbie
 
Posts: 4
Joined: Sat Jan 02, 2016 11:29 am

Re: Is there a way to disable font smoothing?

Postby magreenblatt » Mon Jan 04, 2016 6:17 pm

Mistangoman wrote:How much can I rely on this?

What do you mean?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Is there a way to disable font smoothing?

Postby Mistangoman » Thu Jan 07, 2016 9:11 am

Well, couldn't DirectWrite become mandatory? And I don't know what happens on different operating systems as DirectWrite only exists on Windows anyway.
Mistangoman
Newbie
 
Posts: 4
Joined: Sat Jan 02, 2016 11:29 am

Re: Is there a way to disable font smoothing?

Postby magreenblatt » Thu Jan 07, 2016 11:42 am

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.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Is there a way to disable font smoothing?

Postby palacs » Fri Jul 22, 2016 11:03 am

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.
palacs
Newbie
 
Posts: 1
Joined: Fri Jul 22, 2016 11:02 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 20 guests