From: Jan Djärv Date: Sun, 21 Oct 2012 18:48:11 +0000 (+0200) Subject: * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement X-Git-Tag: emacs-24.2.90~211^2~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef44695952ad2baac8a111fb3012ec16c74fdd62;p=emacs.git * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement for screen font. (nsfont_draw): Turn off LCD-smoothing. Fixes: debbugs:11484 --- diff --git a/src/ChangeLog b/src/ChangeLog index 412e67828a7..6fe7de51293 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-10-21 Jan Djärv + * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement + for screen font. + (nsfont_draw): Turn off LCD-smoothing (Bug#11484). + * xterm.c (x_focus_changed): Check if daemonp when sending focus in event (Bug#12681). diff --git a/src/nsfont.m b/src/nsfont.m index 7c9f05aa0bb..4f29d1d54a9 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -797,7 +797,13 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) block_input (); /* for metrics */ +#ifdef NS_IMPL_COCOA + sfont = [nsfont screenFontWithRenderingMode: + NSFontAntialiasedIntegerAdvancementsRenderingMode]; +#else sfont = [nsfont screenFont]; +#endif + if (sfont == nil) sfont = nsfont; @@ -1229,6 +1235,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, else CGContextSetShouldAntialias (gcontext, 1); + CGContextSetShouldSmoothFonts (gcontext, NO); CGContextSetTextMatrix (gcontext, fliptf); if (bgCol != nil) @@ -1372,7 +1379,12 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block) #endif block_input (); - sfont = [font_info->nsfont screenFont]; +#ifdef NS_IMPL_COCOA + sfont = [font_info->nsfont screenFontWithRenderingMode: + NSFontAntialiasedIntegerAdvancementsRenderingMode]; +#else + sfont = [font_info->nsfont screenFont]; +#endif font_info->metrics[block] = xzalloc (0x100 * sizeof (struct font_metrics)); if (!(font_info->metrics[block]))