[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BUG disabling anti aliasing

From: Luis Garcia Alanis
Subject: BUG disabling anti aliasing
Date: Mon, 30 Mar 2015 03:59:12 -0700

Hello guys,

Couple of issues with AA in gui/back
1) I noticed that the GSFontAntiAlias option the system preferences has no effect on the font anti aliasing. This seems to be broken at least for the Cairo backend.

2) NSGraphicsContext setShouldAntialias: API is not implemented, it just sets a BOOL value but it seems not to be in use. Also its C wrapper is missing from the C API list (like DPSshow() has a stanalone C wrapper).

I suppose for 1) we need to set the font property if the flag is set.
As for 2) we need to make setShouldAntialias tell the backend to disable the anti alias for strokes and for fonts.

Here is some sample code to disable anti alias font drawing for the cairo backend:

      cairo_font_options_t *options = cairo_font_options_create();
      cairo_get_font_options(_ct, options);
      cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_NONE);
      cairo_set_font_options (_ct, options); 

I tested it on DPSshow in CairoGState.m + Terminal.app (since it uses the API to render the text of the terminal). However IDK where this code should live.

 I tried adding this code to the  DPScurrentlinewidth API and then calling as follows:

  [gs DPScurrentlinewidth:3.0];
  [gc DPSshow:"Is this antialiased? "];

Unfortunately the font options seem to reset and DPSshow is back to having AA enabled. I wanted to know if the Graphics Context would persist the state, and its not doing that. It seems costly to have to disable font AA for every call to draw text.

As for strokes, the API should be cairo_set_antialias.

Do you guys know who is the maintainer of gnustep back?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]