all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
To: Adrian Robert <adrian.b.robert@gmail.com>
Cc: 3174@emacsbugs.donarmstrong.com
Subject: bug#3174: "italic" is underlined now (NS?)
Date: Sun, 14 Jun 2009 10:37:16 -0400	[thread overview]
Message-ID: <9B0EAB9B-4FD7-4B20-8F20-34F74BF1135B@gmail.com> (raw)
In-Reply-To: <78DA06D4-062E-40AC-B8D8-44B0ED0B66B0@gmail.com>

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

On Jun 13, 2009, at 7:34 AM, Adrian Robert wrote:

>
> 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.


This seems to be the case though.  NSFontSlantTrait is 0.0.  It's  
still in line with the documentation, even though nil would make more  
sense...
I suggest the patch below - this makes it work for me.

- D




diff --git a/src/nsfont.m b/src/nsfont.m
index 990d58e..06beb99 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -504,6 +504,8 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
      family = [fdesc objectForKey: NSFontFamilyAttribute];
      if (family != nil && !foundItal && XINT (Flength (list)) > 0
  	&& (ns_attribute_value (fdesc, NSFontSlantTrait) == nil
+	    /* from OSX 10.5 on, 0.0 is returned if no italic trait is  
available */
+	    || ([ns_attribute_value (fdesc, NSFontSlantTrait) floatValue] ==  
0.0)
  	    || ns_has_attribute (fdesc, NSFontSlantTrait)))
        {
  	NSFontDescriptor *sDesc = [[[NSFontDescriptor new]


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

  reply	other threads:[~2009-06-14 14:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-11  3:51 "italic" is underlined now (NS?) David Reitter
     [not found] ` <87ws7i3kgr.fsf@cyd.mit.edu>
2009-06-12 12:15   ` bug#3174: " Adrian Robert
2009-06-12 12:49     ` David Reitter
2009-06-12 13:14       ` Adrian Robert
2009-06-12 15:20         ` David Reitter
2009-06-13 11:34           ` Adrian Robert
2009-06-14 14:37             ` David Reitter [this message]
2009-06-14 15:53               ` Adrian Robert
2009-06-14 17:37                 ` David Reitter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9B0EAB9B-4FD7-4B20-8F20-34F74BF1135B@gmail.com \
    --to=david.reitter@gmail.com \
    --cc=3174@emacsbugs.donarmstrong.com \
    --cc=adrian.b.robert@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.