Enable thin font smoothing in macOS (bug#28222)

* src/nsterm.m (syms_of_nsterm): Define var ns-use-thin-smoothing.
* src/macfont.m (macfont_draw): Use font smoothing.

Copyright-paperwork-exempt: yes
This commit is contained in:
Ben Bonfil 2017-08-26 09:41:41 +01:00 committed by Alan Third
parent 573ccb9803
commit 1b0d72244d
2 changed files with 10 additions and 0 deletions

View file

@ -2888,6 +2888,12 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
if (no_antialias_p)
CGContextSetShouldAntialias (context, false);
if (!NILP (ns_use_thin_smoothing))
{
CGContextSetShouldSmoothFonts(context, YES);
CGContextSetFontSmoothingStyle(context, 16);
}
CGContextSetTextMatrix (context, atfm);
CGContextSetTextPosition (context, text_position.x, text_position.y);

View file

@ -9133,6 +9133,10 @@ Convert an X font name (XLFD) to an NS font name.
"Non-nil (the default) means to render text antialiased.");
ns_antialias_text = Qt;
DEFVAR_LISP ("ns-use-thin-smoothing", ns_use_thin_smoothing,
"Non-nil turns on a font smoothing method that produces thinner strokes.");
ns_use_thin_smoothing = Qnil;
DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit,
"Whether to confirm application quit using dialog.");
ns_confirm_quit = Qnil;