summaryrefslogtreecommitdiff
path: root/src/macfont.m
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2014-10-31 19:41:07 +0100
committerJan Djärv <jan.h.d@swipnet.se>2014-10-31 19:41:07 +0100
commit4e0cc3517be50ff1d1b99209018f3a8dc388d289 (patch)
tree532843fce421f03c1661fe69118575fb10b67536 /src/macfont.m
parent95af181d665ffe7f0361c3f468445ac8e4a7858e (diff)
downloademacs-4e0cc3517be50ff1d1b99209018f3a8dc388d289.tar.gz
* macfont.m (macfont_glyph_extents): Turn off syntetic bold
if force_integral_p (i.e. no antialias). (macfont_draw): Check ns_antialias_text, also turn off syntetic bold if no antialias. Fixes: debbugs:18876
Diffstat (limited to 'src/macfont.m')
-rw-r--r--src/macfont.m7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/macfont.m b/src/macfont.m
index 69bde9f66a7..9e3c7e05f3f 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1101,7 +1101,7 @@ macfont_glyph_extents (struct font *font, CGGlyph glyph,
bounds.size =
CGSizeApplyAffineTransform (bounds.size, synthetic_italic_atfm);
}
- if (macfont_info->synthetic_bold_p)
+ if (macfont_info->synthetic_bold_p && ! force_integral_p)
{
CGFloat d =
- synthetic_bold_factor * mac_font_get_size (macfont) / 2;
@@ -2768,7 +2768,8 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
CGFloat advance_delta = 0;
int y_draw = -s->ybase;
int no_antialias_p =
- (macfont_info->antialias == MACFONT_ANTIALIAS_OFF
+ (NILP (ns_antialias_text)
+ || macfont_info->antialias == MACFONT_ANTIALIAS_OFF
|| (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT
&& font_size <= macfont_antialias_threshold));
@@ -2792,7 +2793,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
atfm = synthetic_italic_atfm;
else
atfm = CGAffineTransformIdentity;
- if (macfont_info->synthetic_bold_p)
+ if (macfont_info->synthetic_bold_p && ! no_antialias_p)
{
CGContextSetTextDrawingMode (context, kCGTextFillStroke);
CGContextSetLineWidth (context, synthetic_bold_factor * font_size);