aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2013-01-13 15:29:22 +0100
committerJan Djärv2013-01-13 15:29:22 +0100
commitb826986f36c63534c0705b99e3604193518c080b (patch)
treed05f42e04b5b4a16b5f1183fe2de1dbcba8ad6d9 /src
parenta89c8ef024113dbf993db0d379fabbfb06c86520 (diff)
downloademacs-b826986f36c63534c0705b99e3604193518c080b.tar.gz
emacs-b826986f36c63534c0705b99e3604193518c080b.zip
* nsfont.m (LCD_SMOOTHING_MARGIN): New define.
(nsfont_draw): Remove disabling of LCD smoothing. (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix Bug#11484 with LCD smooting on.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/nsfont.m7
2 files changed, 11 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dbba6322423..18eb69c9f69 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
4 (nsfont_draw): Remove disabling of LCD smoothing.
5 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
6 Bug#11484 with LCD smooting on.
7
12013-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change) 82013-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2 9
3 * gtkutil.c (xg_initialize): Backport from trunk. 10 * gtkutil.c (xg_initialize): Backport from trunk.
diff --git a/src/nsfont.m b/src/nsfont.m
index 9dd80b28b9f..207b6a40483 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -44,6 +44,7 @@ Author: Adrian Robert (arobert@cogsci.ucsd.edu)
44#endif 44#endif
45 45
46#define NSFONT_TRACE 0 46#define NSFONT_TRACE 0
47#define LCD_SMOOTHING_MARGIN 2
47 48
48extern Lisp_Object Qns; 49extern Lisp_Object Qns;
49extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded; 50extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
@@ -1235,7 +1236,6 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1235 else 1236 else
1236 CGContextSetShouldAntialias (gcontext, 1); 1237 CGContextSetShouldAntialias (gcontext, 1);
1237 1238
1238 CGContextSetShouldSmoothFonts (gcontext, NO);
1239 CGContextSetTextMatrix (gcontext, fliptf); 1239 CGContextSetTextMatrix (gcontext, fliptf);
1240 1240
1241 if (bgCol != nil) 1241 if (bgCol != nil)
@@ -1401,11 +1401,12 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
1401 1401
1402 lb = r.origin.x; 1402 lb = r.origin.x;
1403 rb = r.size.width - w; 1403 rb = r.size.width - w;
1404 // Add to bearing for LCD smoothing. We don't know if it is there.
1404 if (lb < 0) 1405 if (lb < 0)
1405 metrics->lbearing = round (lb); 1406 metrics->lbearing = round (lb - LCD_SMOOTHING_MARGIN);
1406 if (font_info->ital) 1407 if (font_info->ital)
1407 rb += 0.22 * font_info->height; 1408 rb += 0.22 * font_info->height;
1408 metrics->rbearing = lrint (w + rb); 1409 metrics->rbearing = lrint (w + rb + LCD_SMOOTHING_MARGIN);
1409 1410
1410 metrics->descent = r.origin.y < 0 ? -r.origin.y : 0; 1411 metrics->descent = r.origin.y < 0 ? -r.origin.y : 0;
1411 /*lrint (hshrink * [sfont ascender] + expand * hd/2); */ 1412 /*lrint (hshrink * [sfont ascender] + expand * hd/2); */