From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.bugs Subject: bug#3174: "italic" is underlined now (NS?) Date: Sat, 13 Jun 2009 14:34:35 +0300 Message-ID: <78DA06D4-062E-40AC-B8D8-44B0ED0B66B0@gmail.com> References: <572FEF4D-AE1C-4805-AF88-AD9B048111C4@gmail.com> <87ws7i3kgr.fsf@cyd.mit.edu> <1AAB5F70-1F6C-4ED8-8B73-F75834BCBFFE@gmail.com> <46210028-DD72-4C1D-B95C-A23A8592A87E@gmail.com> <2779F4B4-BEF7-4AF5-B22B-7D0568649EC6@gmail.com> Reply-To: Adrian Robert , 3174@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1244894260 12603 80.91.229.12 (13 Jun 2009 11:57:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Jun 2009 11:57:40 +0000 (UTC) Cc: 3174@emacsbugs.donarmstrong.com To: David Reitter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 13 13:57:36 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MFRrW-0000Am-SZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jun 2009 13:57:31 +0200 Original-Received: from localhost ([127.0.0.1]:58755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFRrW-0006Rj-Dr for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jun 2009 07:57:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MFRrS-0006QC-LI for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2009 07:57:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MFRrO-0006L1-Q5 for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2009 07:57:26 -0400 Original-Received: from [199.232.76.173] (port=43809 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFRrO-0006Ko-Mv for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2009 07:57:22 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41271) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MFRrO-00040e-5b for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2009 07:57:22 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5DBvK0D027163; Sat, 13 Jun 2009 04:57:20 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5DBe4Kn024293; Sat, 13 Jun 2009 04:40:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Adrian Robert Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Sat, 13 Jun 2009 11:40:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3174 X-Emacs-PR-Package: emacs,ns X-Emacs-PR-Keywords: Original-Received: via spool by 3174-submit@emacsbugs.donarmstrong.com id=B3174.124489288923503 (code B ref 3174); Sat, 13 Jun 2009 11:40:04 +0000 Original-Received: (at 3174) by emacsbugs.donarmstrong.com; 13 Jun 2009 11:34:49 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-bw0-f205.google.com (mail-bw0-f205.google.com [209.85.218.205]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5DBYiBR023498 for <3174@emacsbugs.donarmstrong.com>; Sat, 13 Jun 2009 04:34:46 -0700 Original-Received: by bwz1 with SMTP id 1so2988592bwz.1 for <3174@emacsbugs.donarmstrong.com>; Sat, 13 Jun 2009 04:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:in-reply-to:references :mime-version:content-type:message-id:cc:content-transfer-encoding :from:subject:date:to:x-mailer; bh=R8RmVMUu5j0NOezuYprpcf0flBTvpxN1Jigzv6CgFDs=; b=eq72BwhLP+VANFGcFANgEHtB5nZPAL5DyR6le9ztTMYiTnv+PnGNeSHTpNnOME9q3t sCpN2eqmM71x8soXcFUvveIbeJv7faHFYLb3mla6hdziab3uPBijINyBPrZlvoYv95ct mVPeN2rN6YiC0U5iMPTv/Uj0f3Q7wLrUQvRkM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:content-type:message-id:cc :content-transfer-encoding:from:subject:date:to:x-mailer; b=iXX2zUg0ds/BZuRNWlAL6gx0RzHTrEp62oWSoY5tj7U6V+PEA3TU9xdZTefu5CtfXi eQsjmA+Z442HVMxvQFU86Mg90PXzWskhpRwt2gyBzLg3W+Vo6soNJ4NhM0N4iQEZk+Xc VzJl+5CMbL9rb75HPaS1nFW1YRsNzTvBOFQv0= Original-Received: by 10.204.112.205 with SMTP id x13mr4644707bkp.213.1244892878309; Sat, 13 Jun 2009 04:34:38 -0700 (PDT) Original-Received: from ?192.168.0.11? (e82-103-232-232.elisa-laajakaista.fi [82.103.232.232]) by mx.google.com with ESMTPS id h2sm2885140fkh.16.2009.06.13.04.34.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Jun 2009 04:34:36 -0700 (PDT) In-Reply-To: <2779F4B4-BEF7-4AF5-B22B-7D0568649EC6@gmail.com> X-Mailer: Apple Mail (2.753.1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 13 Jun 2009 07:57:26 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28684 Archived-At: On Jun 12, 2009, at 6:20 PM, David Reitter wrote: > On Jun 12, 2009, at 9:14 AM, Adrian Robert wrote: >> >> Can you try changing the line just above where family is set to >> >> family = ns_get_family (font_spec); >> >> If that does NOT fix it (see below for what you should see in the >> console output) then could you experiment to find out what other >> condition is causing the if () not to fire? > > Doesn't fix it. If I shortcut the "if" condition, it works, as you > say. > > The reason is that the last part of the "and" fails: > > (gdb) print family > $12 = (NSString *) 0xa07d0590 > (gdb) print ns_has_attribute (fdesc, NSFontSlantTrait) > $13 = 0 '\000' > (gdb) print ns_attribute_value (fdesc, NSFontSlantTrait) > $14 = (NSNumber *) 0x1644f70 Don't understand this. The lines above in the log say that a font is requested with only the family specified, nothing about slant. Then fdesc, the result of ns_spec_to_descriptor, is printed out, also showing no slant trait. So why/how does ns_attribute_value() return something? Could you add: NSLog(@"slant: %@", ns_attribute_value (fdesc, NSFontSlantTrait)); And see what that prints? If it prints 0, it makes some kind of sense, but on Tiger at least nsfont.m:114 gets nil, indicating no possession either way of the attribute. Returning an explicit NSNumber of 0 is such a semantically different behavior I can't believe that changed from Tiger to Leopard. > Doesn't that mean that the font has a Slanted trait and shouldn't > that be used rather than making a synthetic one? 'fdesc' is the template descriptor that is being matched against, created by converting from the font_spec passed in by emacs. So we only want to create and add a synthetic italic member if either (a) an italic font was requested (fdesc has font slant trait) or (b) nothing was specified about italic, in which case we should return both italic and nonitalic fonts (and bold / nonbold).