diff options
| author | Ben Bonfil | 2017-08-26 09:41:41 +0100 |
|---|---|---|
| committer | Alan Third | 2017-08-29 17:19:04 +0100 |
| commit | 1b0d72244d5df61d9fbe10808808b3c045a3382b (patch) | |
| tree | 0cdfaeaabda185b6a93e1424f1d429d3aac22f2e /src | |
| parent | 573ccb9803f326a1ba309b131c6db77fa98191d3 (diff) | |
| download | emacs-1b0d72244d5df61d9fbe10808808b3c045a3382b.tar.gz emacs-1b0d72244d5df61d9fbe10808808b3c045a3382b.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/macfont.m | 6 | ||||
| -rw-r--r-- | src/nsterm.m | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/macfont.m b/src/macfont.m index 19145f92c0a..59891353cd3 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -2888,6 +2888,12 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2888 | if (no_antialias_p) | 2888 | if (no_antialias_p) |
| 2889 | CGContextSetShouldAntialias (context, false); | 2889 | CGContextSetShouldAntialias (context, false); |
| 2890 | 2890 | ||
| 2891 | if (!NILP (ns_use_thin_smoothing)) | ||
| 2892 | { | ||
| 2893 | CGContextSetShouldSmoothFonts(context, YES); | ||
| 2894 | CGContextSetFontSmoothingStyle(context, 16); | ||
| 2895 | } | ||
| 2896 | |||
| 2891 | CGContextSetTextMatrix (context, atfm); | 2897 | CGContextSetTextMatrix (context, atfm); |
| 2892 | CGContextSetTextPosition (context, text_position.x, text_position.y); | 2898 | CGContextSetTextPosition (context, text_position.x, text_position.y); |
| 2893 | 2899 | ||
diff --git a/src/nsterm.m b/src/nsterm.m index 22f8efd6b96..ff3329d1cee 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -9133,6 +9133,10 @@ allowing it to be used at a lower level for accented character entry."); | |||
| 9133 | "Non-nil (the default) means to render text antialiased."); | 9133 | "Non-nil (the default) means to render text antialiased."); |
| 9134 | ns_antialias_text = Qt; | 9134 | ns_antialias_text = Qt; |
| 9135 | 9135 | ||
| 9136 | DEFVAR_LISP ("ns-use-thin-smoothing", ns_use_thin_smoothing, | ||
| 9137 | "Non-nil turns on a font smoothing method that produces thinner strokes."); | ||
| 9138 | ns_use_thin_smoothing = Qnil; | ||
| 9139 | |||
| 9136 | DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit, | 9140 | DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit, |
| 9137 | "Whether to confirm application quit using dialog."); | 9141 | "Whether to confirm application quit using dialog."); |
| 9138 | ns_confirm_quit = Qnil; | 9142 | ns_confirm_quit = Qnil; |