diff options
Diffstat (limited to 'src/macfont.m')
-rw-r--r-- | src/macfont.m | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/macfont.m b/src/macfont.m index 4d310e47aec..97879506ba4 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -14,7 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. +along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. Original author: YAMAMOTO Mitsuharu */ @@ -2869,17 +2869,31 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, and synthetic bold looks thinner on such environments. Apple says there are no plans to address this issue (rdar://11644870) currently. So we add a workaround. */ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - CGContextSetLineWidth (context, synthetic_bold_factor * font_size - * [[FRAME_NS_VIEW(f) window] backingScaleFactor]); -#else - CGContextSetLineWidth (context, synthetic_bold_factor * font_size); +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + if ([[FRAME_NS_VIEW(f) window] respondsToSelector: + @selector(backingScaleFactor)]) +#endif + CGContextSetLineWidth (context, synthetic_bold_factor * font_size + * [[FRAME_NS_VIEW(f) window] backingScaleFactor]); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + else +#endif +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + CGContextSetLineWidth (context, synthetic_bold_factor * font_size); #endif CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f); } 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); |