+2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * 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.
+
2013-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
* gtkutil.c (xg_initialize): Backport from trunk.
#endif
#define NSFONT_TRACE 0
+#define LCD_SMOOTHING_MARGIN 2
extern Lisp_Object Qns;
extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
else
CGContextSetShouldAntialias (gcontext, 1);
- CGContextSetShouldSmoothFonts (gcontext, NO);
CGContextSetTextMatrix (gcontext, fliptf);
if (bgCol != nil)
lb = r.origin.x;
rb = r.size.width - w;
+ // Add to bearing for LCD smoothing. We don't know if it is there.
if (lb < 0)
- metrics->lbearing = round (lb);
+ metrics->lbearing = round (lb - LCD_SMOOTHING_MARGIN);
if (font_info->ital)
rb += 0.22 * font_info->height;
- metrics->rbearing = lrint (w + rb);
+ metrics->rbearing = lrint (w + rb + LCD_SMOOTHING_MARGIN);
metrics->descent = r.origin.y < 0 ? -r.origin.y : 0;
/*lrint (hshrink * [sfont ascender] + expand * hd/2); */