bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#3174: "italic" is underlined now (NS?)


From: Adrian Robert
Subject: bug#3174: "italic" is underlined now (NS?)
Date: Sat, 13 Jun 2009 14:34:35 +0300


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







reply via email to

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