diff options
| author | Jan Djärv | 2014-10-31 19:41:07 +0100 |
|---|---|---|
| committer | Jan Djärv | 2014-10-31 19:41:07 +0100 |
| commit | 4e0cc3517be50ff1d1b99209018f3a8dc388d289 (patch) | |
| tree | 532843fce421f03c1661fe69118575fb10b67536 | |
| parent | 95af181d665ffe7f0361c3f468445ac8e4a7858e (diff) | |
| download | emacs-4e0cc3517be50ff1d1b99209018f3a8dc388d289.tar.gz emacs-4e0cc3517be50ff1d1b99209018f3a8dc388d289.zip | |
* 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
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/macfont.m | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c516d348d84..91bd0e1137c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2014-10-31 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2014-10-31 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * macfont.m (macfont_glyph_extents): Turn off syntetic bold | ||
| 4 | if force_integral_p (i.e. no antialias). | ||
| 5 | (macfont_draw): Check ns_antialias_text, also turn off syntetic | ||
| 6 | bold if no antialias (Bug#18876). | ||
| 7 | |||
| 3 | * emacs.c (main): Don't chdir to $HOME on Cocoa if --chdir | 8 | * emacs.c (main): Don't chdir to $HOME on Cocoa if --chdir |
| 4 | was given (Bug#18846). | 9 | was given (Bug#18846). |
| 5 | 10 | ||
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, | |||
| 1101 | bounds.size = | 1101 | bounds.size = |
| 1102 | CGSizeApplyAffineTransform (bounds.size, synthetic_italic_atfm); | 1102 | CGSizeApplyAffineTransform (bounds.size, synthetic_italic_atfm); |
| 1103 | } | 1103 | } |
| 1104 | if (macfont_info->synthetic_bold_p) | 1104 | if (macfont_info->synthetic_bold_p && ! force_integral_p) |
| 1105 | { | 1105 | { |
| 1106 | CGFloat d = | 1106 | CGFloat d = |
| 1107 | - synthetic_bold_factor * mac_font_get_size (macfont) / 2; | 1107 | - 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, | |||
| 2768 | CGFloat advance_delta = 0; | 2768 | CGFloat advance_delta = 0; |
| 2769 | int y_draw = -s->ybase; | 2769 | int y_draw = -s->ybase; |
| 2770 | int no_antialias_p = | 2770 | int no_antialias_p = |
| 2771 | (macfont_info->antialias == MACFONT_ANTIALIAS_OFF | 2771 | (NILP (ns_antialias_text) |
| 2772 | || macfont_info->antialias == MACFONT_ANTIALIAS_OFF | ||
| 2772 | || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT | 2773 | || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT |
| 2773 | && font_size <= macfont_antialias_threshold)); | 2774 | && font_size <= macfont_antialias_threshold)); |
| 2774 | 2775 | ||
| @@ -2792,7 +2793,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2792 | atfm = synthetic_italic_atfm; | 2793 | atfm = synthetic_italic_atfm; |
| 2793 | else | 2794 | else |
| 2794 | atfm = CGAffineTransformIdentity; | 2795 | atfm = CGAffineTransformIdentity; |
| 2795 | if (macfont_info->synthetic_bold_p) | 2796 | if (macfont_info->synthetic_bold_p && ! no_antialias_p) |
| 2796 | { | 2797 | { |
| 2797 | CGContextSetTextDrawingMode (context, kCGTextFillStroke); | 2798 | CGContextSetTextDrawingMode (context, kCGTextFillStroke); |
| 2798 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size); | 2799 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size); |