Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
MD seems to antialias the heck out of text.
Even better, Xcode: http://nat.org/x/867d33d6.png
It's not a fair comparison, OS X renders text bolder when it's light-on-dark. If you try a light MD theme, I strongly doubt it looks any different to Xcode.
TextMate appears to have disabled antialiasing completely, or is using a bitmap font.
To clarify, MD isn't explicitly doing any antialiasing. MD is using Pango, Pango is using the MacOS ATSUI API, ATSUI is antialiasing text.
Oh wow. You're totally right. That's amazing.
Xcode dark: http://nat.org/x/90025a0a.png
It would still be nice if we could turn off antialiasing in MD, with an option.
Michael Hutchinson also provided this command to change the antialiasing settings:
defaults write com.ximian.monodevelop AppleAntiAliasingThreshold 24
That command basically lets you override system settings per app, in this case for apps matching the MD app bundle's ID. That setting is the same "don't smooth fonts smaller than point size X" setting you find in the system preferences UI.
Instead of altering the rendering for the whole MD UI, it would be best to have a setting to disable antialiasing in the MD source editor. There appears to be an API we can use to toggle smoothing on a rendering context: CGContextSetShouldSmoothFonts . However, I'm not sure how we'd access this given the gtk/pango/cairo abstractions. Maybe we could add an API to GTK to get the CGContext from a Cairo context or something.
It may be that we can get to it by P/Invoking our way to [[NSGraphicsContext currentContext]
graphicsPort] in the MD text editor's Expose function. I'll take a look next time I'm on MacOS.
> To clarify, MD isn't explicitly doing any antialiasing. MD is using Pango,
> Pango is using the MacOS ATSUI API, ATSUI is antialiasing text.
For the record, if you are compiling a recent Pango on 10.5 or higher, it should be compiling the CoreText backend instead of the ATSUI one. ATSUI is deprecated in 10.6 and higher and not fully supported in 64-bit.
I'll look where the AA option is being toggled in Pango or Cairo, since I am debugging the font rendering for the font fallbacks bugs anyway.
I already said that this is not only anti aliasing - it's a different font as well.
Anti aliasing doesn't add serifes when there are none - look at the 'i'.
It seems that the fonts have a different version for anti aliasing modes. I don't think that we can do much about that, when turning THAT off by a p/invoke the locations won't be correct anymore - pango needs to do it.
I've added an option for the anti aliasing font rendering to be turned off - but I don't think/know a way to use the other font. But at least it's not aliased anymore.
btw. apples solution is very good - it's not really possible to have a good font with and without anti aliasing looking very good both ways. Having another font version for either display option is a nice solution, but unfortunately it makes things difficult for us.
I set it to fixed - because we can now turn off the anti aliasing, which was the original problem.
@Kristian Rietveld: Turning off the AA option in cairo basically works - now pango just needs a way to get the non anti aliased font version and this is done.
Any help there would be appreciated. I think it needs to be added to the pango API (mac specific extension).
The reason I said ATSUI was that we're using Pango 1.28.4, which I don't believe has Core Text support by default. I briefly tried 1.29.x back in June but ran into some rendering glitches and didn't have time to follow it up.