Commit b826986f authored by Jan Djärv's avatar Jan Djärv
Browse files

* 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.
parent a89c8ef0
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.
......
......@@ -44,6 +44,7 @@
#endif
#define NSFONT_TRACE 0
#define LCD_SMOOTHING_MARGIN 2
extern Lisp_Object Qns;
extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
......@@ -1235,7 +1236,6 @@ is false when (FROM > 0 || TO < S->nchars). */
else
CGContextSetShouldAntialias (gcontext, 1);
CGContextSetShouldSmoothFonts (gcontext, NO);
CGContextSetTextMatrix (gcontext, fliptf);
if (bgCol != nil)
......@@ -1401,11 +1401,12 @@ is false when (FROM > 0 || TO < S->nchars). */
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); */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment