unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4736: 23.1; ns-antialias-text set to nil has no effect
@ 2009-10-16  3:59 John Whitley
  0 siblings, 0 replies; 11+ messages in thread
From: John Whitley @ 2009-10-16  3:59 UTC (permalink / raw)
  To: bug-gnu-emacs

Repro steps:
1) set ns-antialias-text to nil (via the usual means: setq, set- 
variable, customize, etc.)

Expected results:
Text is no longer antialiased.

Actual results:
Text remains antialiased no matter the setting of ns-antialias-text.


In GNU Emacs 23.1.1 (i386-apple-darwin10.0.0, NS apple-appkit-1038.11)
of 2009-10-11 on kuroneko.local
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--prefix=/opt/local' '--with-ns' '-- 
without-x' 'CC=/usr/bin/gcc-4.2' 'CFLAGS=-O2 -arch x86_64' 'LDFLAGS=-L/ 
opt/local/lib' 'CPPFLAGS=-I/opt/local/include''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: nil
   value of $XMODIFIERS: nil
   locale-coding-system: nil
   default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
   delete-selection-mode: t
   tooltip-mode: t
   tool-bar-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
<wheel-down> <double-wheel-down> <triple-wheel-down>
<triple-wheel-down> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-down> <triple-wheel-down>
<wheel-down> <double-wheel-down> <triple-wheel-down>
<triple-wheel-up> <triple-wheel-down> <triple-wheel-down>
<triple-wheel-down> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-down> <triple-wheel-down> <triple-wheel-down>
<triple-wheel-down> <down-mouse-1> <mouse-movement>
<mouse-movement> <drag-mouse-1> <down-mouse-1> <mouse-1>
<menu-bar> <help-menu> <send-emacs-bug-report>

Recent messages:
Ido mode enabled
Loading grep...done
For information about GNU Emacs and the GNU system, type C-h C-a.
byte-code: End of buffer [4 times]
byte-code: Beginning of buffer [3 times]
byte-code: End of buffer [5 times]
byte-code: Beginning of buffer
byte-code: End of buffer [3 times]
byte-code: Beginning of buffer [5 times]
byte-code: End of buffer [3 times]
byte-code: End of buffer






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
@ 2009-10-17 12:16 Adrian Robert
  2010-02-14 13:31 ` Francis Devereux
       [not found] ` <B92EACBD-D004-40A8-8FAB-C5CB4EBBA76A@devrx.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Adrian Robert @ 2009-10-17 12:16 UTC (permalink / raw)
  To: 4736; +Cc: John Whitley

http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4736

I cannot reproduce this.  You must make a new frame or otherwise  
trigger full redrawing, but it works here.  Please experiment a  
little, and if you can narrow down the conditions that cause failure,  
please report back.






^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found] <mailman.9008.1255782444.2239.bug-gnu-emacs@gnu.org>
@ 2009-11-12  6:34 ` Chaoyi
  0 siblings, 0 replies; 11+ messages in thread
From: Chaoyi @ 2009-11-12  6:34 UTC (permalink / raw)
  To: bug-gnu-emacs

On Oct 17, 7:16 am, Adrian Robert <adrian.b.rob...@gmail.com> wrote:
> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4736
>
> I cannot reproduce this.  You must make a new frame or otherwise  
> trigger full redrawing, but it works here.  Please experiment a  
> little, and if you can narrow down the conditions that cause failure,  
> please report back.

I confirm this bug with latest CVS version.  Attached patch seems
fixed this problem.

--
diff --git a/src/nsfont.m b/src/nsfont.m
index dded6a3..ec52cc8 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -50,7 +50,7 @@ extern Lisp_Object Qnormal, Qbold, Qitalic,
Qcondensed, Qexpanded;
 static Lisp_Object Vns_reg_to_script;
 static Lisp_Object Qapple, Qroman, Qmedium;
 extern Lisp_Object Qappend;
-extern int ns_antialias_text;
+extern Lisp_Object ns_antialias_text;
 extern float ns_antialias_threshold;
 extern int ns_tmp_flags;
 extern struct nsfont_info *ns_tmp_font;
@@ -1229,7 +1229,7 @@ nsfont_draw (struct glyph_string *s, int from,
int to, int x, int y,

     CGContextSetFont (gcontext, font->cgfont);
     CGContextSetFontSize (gcontext, font->size);
-    if (ns_antialias_text == Qnil || font->size <=
ns_antialias_threshold)
+    if (NILP (ns_antialias_text) || font->size <=
ns_antialias_threshold)
       CGContextSetShouldAntialias (gcontext, 0);
     else
       CGContextSetShouldAntialias (gcontext, 1);


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
@ 2010-01-08 15:18 John Whitley
  0 siblings, 0 replies; 11+ messages in thread
From: John Whitley @ 2010-01-08 15:18 UTC (permalink / raw)
  To: 4736

Apologies for the immensely delayed response.  I still and have always had this problem since the initial report.

Repro steps:
1) Build Emacs bzr trunk (I used revno 99272), configured with: ./configure --with-ns --enable-ns-self-contained
2) Ensure that no emacs init files are in the current working environment.
3) 'open nextstep/Emacs.app'
4) M-X set-variable ns-antialias-text nil <RET>
5) Open a new frame

Expected results:
New frame opens with non-antialiased text.

Actual results:
Text is always antialiased regardless of the value of ns-antialias-text.

General notes:
My ultimate goal is to set ns-antialias-text in .emacs and have it take effect on the initial frame.

System notes:
MacOS X: 10.6.2 (Snow Leopard)
GCC: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)
XCode version: 3.2.1







^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
  2009-10-17 12:16 Adrian Robert
@ 2010-02-14 13:31 ` Francis Devereux
       [not found] ` <B92EACBD-D004-40A8-8FAB-C5CB4EBBA76A@devrx.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Francis Devereux @ 2010-02-14 13:31 UTC (permalink / raw)
  To: Adrian Robert; +Cc: 4736, John Whitley, emacs-devel

On 17 Oct 2009, at 13:16, Adrian Robert wrote:

> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4736
> 
> I cannot reproduce this.  You must make a new frame or otherwise trigger full redrawing, but it works here.  Please experiment a little, and if you can narrow down the conditions that cause failure, please report back.


I can reproduce this.  If I build Emacs on Mac OS X 10.6 then ns-antialias-text has no effect - text is always anti-aliased (as John reports).  However, if I build Emacs on OS X 10.5 and then copy Emacs.app to my 10.6 machine, then setting ns-antialias-text to nil works as expected (i.e. it disables anti aliasing).

John, are you using 10.5 or 10.6?

I've also discovered that if I build Emacs as a 32 bit binary on 10.6 (the default is 64 bit on 10.6) with the following command then ns-antialias-text works.  The commands I used to build are:
LDFLAGS="-arch i386" CFLAGS="-g -O2 -arch i386 -march=core2" ../trunk/configure --build=i386-apple-darwin10.2.0 --with-ns && make -j2 && make install

I added some logging and built in 64 bit mode.  The output is interesting, it looks like the test ns_antialias_text == Qnil is returning false because ns_antialias_text is corrupt.  I'm not really sure what is happening though - I have next to no knowledge of Emacs internals.

Changes:
--- src/nsfont.m	2010-02-08 23:39:01 +0000
+++ src/nsfont.m	2010-02-14 09:07:25 +0000
@@ -1232,9 +1232,17 @@
     CGContextSetFont (gcontext, font->cgfont);
     CGContextSetFontSize (gcontext, font->size);
     if (ns_antialias_text == Qnil || font->size <= ns_antialias_threshold)
+    {
       CGContextSetShouldAntialias (gcontext, 0);
+      fprintf (stderr, "*** Disabled anti aliasing\n");
+      safe_debug_print (ns_antialias_text);
+    }
     else
+    {
       CGContextSetShouldAntialias (gcontext, 1);
+      fprintf (stderr, "*** Enabled anti aliasing, BITS_PER_EMACS_INT=%d\n", BITS_PER_EMACS_INT);
+      safe_debug_print (ns_antialias_text);
+    }
 
     CGContextSetTextMatrix (gcontext, fliptf);

Output from 64-bit Emacs (the following is repeated many times):
*** Enabled anti aliasing, BITS_PER_EMACS_INT=64
#<INVALID_LISP_OBJECT 0x0180006a>

Francis







^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found] ` <B92EACBD-D004-40A8-8FAB-C5CB4EBBA76A@devrx.org>
@ 2010-02-14 15:38   ` David Reitter
       [not found]   ` <2A6D0821-4E99-48D0-A710-2D01006A09E4@gmail.com>
  1 sibling, 0 replies; 11+ messages in thread
From: David Reitter @ 2010-02-14 15:38 UTC (permalink / raw)
  To: Francis Devereux; +Cc: Adrian Robert, John Whitley, 4736, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]

On Feb 14, 2010, at 8:31 AM, Francis Devereux wrote:

> On 17 Oct 2009, at 13:16, Adrian Robert wrote:
> 
>> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4736
> 
> I've also discovered that if I build Emacs as a 32 bit binary on 10.6 (the default is 64 bit on 10.6) with the following command then ns-antialias-text works.  The commands I used to build are:
> LDFLAGS="-arch i386" CFLAGS="-g -O2 -arch i386 -march=core2" ../trunk/configure --build=i386-apple-darwin10.2.0 --with-ns && make -j2 && make install


ns_antialias_text is wrongly declared as an int instead of Lisp_Object, and the nonstandard pointer comparison to Qnil helped cover it up, I suppose.  That also explains why it happened to work on 32bit.   Try the patch below.



diff --git a/src/nsfont.m b/src/nsfont.m
index 934fefa..1b157ce 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -50,7 +50,7 @@ extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
 static Lisp_Object Vns_reg_to_script;
 static Lisp_Object Qapple, Qroman, Qmedium;
 extern Lisp_Object Qappend;
-extern int ns_antialias_text;
+extern Lisp_Object ns_antialias_text;
 extern float ns_antialias_threshold;
 extern int ns_tmp_flags;
 extern struct nsfont_info *ns_tmp_font;
@@ -1243,7 +1245,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
 
     CGContextSetFont (gcontext, font->cgfont);
     CGContextSetFontSize (gcontext, font->size);
-    if (ns_antialias_text == Qnil || font->size <= ns_antialias_threshold)
+    if (NILP (ns_antialias_text) || font->size <= ns_antialias_threshold)
       CGContextSetShouldAntialias (gcontext, 0);
     else
       CGContextSetShouldAntialias (gcontext, 1);


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found]   ` <2A6D0821-4E99-48D0-A710-2D01006A09E4@gmail.com>
@ 2010-02-14 16:01     ` Francis Devereux
       [not found]     ` <F6AE2CDD-9119-4CBA-8B87-6CEA3E65BED8@devrx.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Francis Devereux @ 2010-02-14 16:01 UTC (permalink / raw)
  To: David Reitter; +Cc: Adrian Robert, John Whitley, 4736, emacs-devel

On 14 Feb 2010, at 15:38, David Reitter wrote:

> On Feb 14, 2010, at 8:31 AM, Francis Devereux wrote:
> 
>> On 17 Oct 2009, at 13:16, Adrian Robert wrote:
>> 
>>> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4736
>> 
>> I've also discovered that if I build Emacs as a 32 bit binary on 10.6 (the default is 64 bit on 10.6) with the following command then ns-antialias-text works.  The commands I used to build are:
>> LDFLAGS="-arch i386" CFLAGS="-g -O2 -arch i386 -march=core2" ../trunk/configure --build=i386-apple-darwin10.2.0 --with-ns && make -j2 && make install
> 
> 
> ns_antialias_text is wrongly declared as an int instead of Lisp_Object, and the nonstandard pointer comparison to Qnil helped cover it up, I suppose.  That also explains why it happened to work on 32bit.   Try the patch below.

Thanks David, works when compiled as 64 bit on OS X 10.6.2.

Francis







^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found]     ` <F6AE2CDD-9119-4CBA-8B87-6CEA3E65BED8@devrx.org>
@ 2010-02-15 23:36       ` John Whitley
       [not found]       ` <B2199544-E21D-47C7-BBA0-A80DCC7F19B1@acm.org>
  1 sibling, 0 replies; 11+ messages in thread
From: John Whitley @ 2010-02-15 23:36 UTC (permalink / raw)
  To: Francis Devereux; +Cc: David Reitter, Adrian Robert, 4736, emacs-devel


On Feb 14, 2010, at 8:01 AM, Francis Devereux wrote:
> On 14 Feb 2010, at 15:38, David Reitter wrote:
>> ns_antialias_text is wrongly declared as an int instead of Lisp_Object, and the nonstandard pointer comparison to Qnil helped cover it up, I suppose.  That also explains why it happened to work on 32bit.   Try the patch below.
> 
> Thanks David, works when compiled as 64 bit on OS X 10.6.2.

Second confirmation.  I built Emacs.app as 64 bit with David's patch against bzr revno 99498; the setting ns-antialias-text is now correctly observed.

Thanks Francis and David!

-- John








^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found]       ` <B2199544-E21D-47C7-BBA0-A80DCC7F19B1@acm.org>
@ 2010-02-25 20:40         ` Francis Devereux
       [not found]         ` <290BF290-C00C-4E8D-9462-9FE941ECFCE4@devrx.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Francis Devereux @ 2010-02-25 20:40 UTC (permalink / raw)
  To: emacs-devel; +Cc: David Reitter, Adrian Robert, John Whitley, 4736

On 15 Feb 2010, at 23:36, John Whitley wrote:

> 
> On Feb 14, 2010, at 8:01 AM, Francis Devereux wrote:
>> On 14 Feb 2010, at 15:38, David Reitter wrote:
>>> ns_antialias_text is wrongly declared as an int instead of Lisp_Object, and the nonstandard pointer comparison to Qnil helped cover it up, I suppose.  That also explains why it happened to work on 32bit.   Try the patch below.
>> 
>> Thanks David, works when compiled as 64 bit on OS X 10.6.2.
> 
> Second confirmation.  I built Emacs.app as 64 bit with David's patch against bzr revno 99498; the setting ns-antialias-text is now correctly observed.

David's patch fixes the problem for both John and I, would it be possible for someone to commit it?

Francis







^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found]         ` <290BF290-C00C-4E8D-9462-9FE941ECFCE4@devrx.org>
@ 2010-02-26  0:49           ` Chong Yidong
       [not found]           ` <87wry0ddnv.fsf@stupidchicken.com>
  1 sibling, 0 replies; 11+ messages in thread
From: Chong Yidong @ 2010-02-26  0:49 UTC (permalink / raw)
  To: Francis Devereux
  Cc: David Reitter, Adrian Robert, 4736, John Whitley, emacs-devel

Francis Devereux <francis@devrx.org> writes:

> David's patch fixes the problem for both John and I, would it be
> possible for someone to commit it?

Done.






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4736: 23.1; ns-antialias-text set to nil has no effect
       [not found]           ` <87wry0ddnv.fsf@stupidchicken.com>
@ 2010-02-27 20:42             ` Francis Devereux
  0 siblings, 0 replies; 11+ messages in thread
From: Francis Devereux @ 2010-02-27 20:42 UTC (permalink / raw)
  To: Chong Yidong
  Cc: David Reitter, Adrian Robert, John Whitley, 4736, emacs-devel

On 26 Feb 2010, at 00:49, Chong Yidong wrote:

> Francis Devereux <francis@devrx.org> writes:
> 
>> David's patch fixes the problem for both John and I, would it be
>> possible for someone to commit it?
> 
> Done.

Thanks, the bug is fixed in bzr r99572 (I've tested a 64 bit build of it on OS X 10.6.2).

Francis







^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-02-27 20:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-16  3:59 bug#4736: 23.1; ns-antialias-text set to nil has no effect John Whitley
  -- strict thread matches above, loose matches on Subject: below --
2009-10-17 12:16 Adrian Robert
2010-02-14 13:31 ` Francis Devereux
     [not found] ` <B92EACBD-D004-40A8-8FAB-C5CB4EBBA76A@devrx.org>
2010-02-14 15:38   ` David Reitter
     [not found]   ` <2A6D0821-4E99-48D0-A710-2D01006A09E4@gmail.com>
2010-02-14 16:01     ` Francis Devereux
     [not found]     ` <F6AE2CDD-9119-4CBA-8B87-6CEA3E65BED8@devrx.org>
2010-02-15 23:36       ` John Whitley
     [not found]       ` <B2199544-E21D-47C7-BBA0-A80DCC7F19B1@acm.org>
2010-02-25 20:40         ` Francis Devereux
     [not found]         ` <290BF290-C00C-4E8D-9462-9FE941ECFCE4@devrx.org>
2010-02-26  0:49           ` Chong Yidong
     [not found]           ` <87wry0ddnv.fsf@stupidchicken.com>
2010-02-27 20:42             ` Francis Devereux
     [not found] <mailman.9008.1255782444.2239.bug-gnu-emacs@gnu.org>
2009-11-12  6:34 ` Chaoyi
2010-01-08 15:18 John Whitley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).