diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/macfont.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/macfont.m b/src/macfont.m index c799100c855..d9bad034fe9 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -2878,7 +2878,19 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2878 | if (macfont_info->synthetic_bold_p && ! no_antialias_p) | 2878 | if (macfont_info->synthetic_bold_p && ! no_antialias_p) |
| 2879 | { | 2879 | { |
| 2880 | CGContextSetTextDrawingMode (context, kCGTextFillStroke); | 2880 | CGContextSetTextDrawingMode (context, kCGTextFillStroke); |
| 2881 | |||
| 2882 | /* Stroke line width for text drawing is not correctly | ||
| 2883 | scaled on Retina display/HiDPI mode when drawn to screen | ||
| 2884 | (whereas it is correctly scaled when drawn to bitmaps), | ||
| 2885 | and synthetic bold looks thinner on such environments. | ||
| 2886 | Apple says there are no plans to address this issue | ||
| 2887 | (rdar://11644870) currently. So we add a workaround. */ | ||
| 2888 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 | ||
| 2889 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size | ||
| 2890 | * [[FRAME_NS_VIEW(f) window] backingScaleFactor]); | ||
| 2891 | #else | ||
| 2881 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size); | 2892 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size); |
| 2893 | #endif | ||
| 2882 | CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f); | 2894 | CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f); |
| 2883 | } | 2895 | } |
| 2884 | if (no_antialias_p) | 2896 | if (no_antialias_p) |