From: Adrian Robert <adrian.b.robert@gmail.com>
To: David Reitter <david.reitter@gmail.com>
Cc: 3174@emacsbugs.donarmstrong.com
Subject: bug#3174: "italic" is underlined now (NS?)
Date: Sat, 13 Jun 2009 14:34:35 +0300 [thread overview]
Message-ID: <78DA06D4-062E-40AC-B8D8-44B0ED0B66B0@gmail.com> (raw)
In-Reply-To: <2779F4B4-BEF7-4AF5-B22B-7D0568649EC6@gmail.com>
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).
next prev parent reply other threads:[~2009-06-13 11:34 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 [this message]
2009-06-14 14:37 ` David Reitter
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=78DA06D4-062E-40AC-B8D8-44B0ED0B66B0@gmail.com \
--to=adrian.b.robert@gmail.com \
--cc=3174@emacsbugs.donarmstrong.com \
--cc=david.reitter@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.