emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: State of NS port


From: Jan Djärv
Subject: Re: State of NS port
Date: Sun, 13 Jan 2013 13:23:20 +0100

Hej.

13 jan 2013 kl. 09:14 skrev YAMAMOTO Mitsuharu <address@hidden>:

>>>>>> On Sat, 12 Jan 2013 11:49:09 +0800, Chris Zheng <address@hidden> said:
> 
>> I suffered this problem too, and it's because of two bug fixes after I dig 
>> it awhile. 
>> bug#11484: 23.4; Scrolling leaves traces of old text behind
> 
>> http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-05/msg00383.html
> 
> I could reproduce it with the *Mac port*, so the problem would be that
> the reported metrics don't exactly reflect the actual display when LCD
> font smoothing is turned on.  I think I will apply the following
> workaround in the next release of the Mac port.

It seems that you need to use a NSLayoutManager to handle this correctly.
I'll try your workoround in nsfont.m.

Thanks,

        Jan D.

> 
>                                    YAMAMOTO Mitsuharu
>                               address@hidden
> 
> === modified file 'src/macfont.c'
> *** src/macfont.c     2013-01-11 07:33:09 +0000
> --- src/macfont.c     2013-01-13 07:24:32 +0000
> ***************
> *** 483,488 ****
> --- 483,489 ----
>        METRICS_SET_VALUE (metrics, descent, status);} while (0)
> 
>  #define METRICS_NCOLS_PER_ROW        (128)
> + #define LCD_FONT_SMOOTHING_RIGHT_MARGIN     (0.396)
> 
>  static int
>  macfont_glyph_extents (struct font *font, CGGlyph glyph,
> ***************
> *** 579,584 ****
> --- 580,587 ----
>                                    / (CGFloat) WIDTH_FRAC_SCALE));
>             break;
>           }
> +       if (bounds.size.width > 0)
> +         bounds.size.width += LCD_FONT_SMOOTHING_RIGHT_MARGIN;
>         bounds = CGRectIntegral (bounds);
>         METRICS_SET_VALUE (cache, lbearing, CGRectGetMinX (bounds));
>         METRICS_SET_VALUE (cache, rbearing, CGRectGetMaxX (bounds));
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]