Closed Bug 1214490 Opened 6 years ago Closed 6 years ago

[10.11] fix system font warning under OSX


(Core :: Graphics: Text, defect)

Not set



Tracking Status
firefox44 --- affected
firefox45 --- fixed


(Reporter: jtd, Assigned: jtd)




(1 file)

The patch to fix system font usage under 10.11 on bug 1201318 asserts that all system font API methods map to the same font. However, under 10.11, some map to a meta font family and some to the actual font, even though the underlying font family is the same.

> > +    if ([sysFamily compare:[[NSFont boldSystemFontOfSize:0.0] familyName]] != NSOrderedSame ||
> > +        [sysFamily compare:[[NSFont controlContentFontOfSize:0.0] familyName]] != NSOrderedSame ||
> > +        [sysFamily compare:[[NSFont menuBarFontOfSize:0.0] familyName]] != NSOrderedSame ||
> > +        [sysFamily compare:[[NSFont toolTipsFontOfSize:0.0] familyName]] != NSOrderedSame) {
> > +        NS_WARNING("system font types map to different font families -- please log a bug!!");

Use GetRealFamilyName in the assertion.
Summary: [10.11] fix system font assertion under OSX → [10.11] fix system font warning under OSX
Wrap system font name checks with GetRealFamilyName.

Note: both the old code and the code on this patch do not result in a warning.

Markus, what's the OSX version under which you see the warning?
Attachment #8688822 - Flags: review?(mstange)
Comment on attachment 8688822 [details] [diff] [review]
patch, fix up system font check warning

Huh, weird. I'm on 10.11 Beta (15A279b), which for some reason doesn't want to update any further on its own.

Do you get different results on your system than I did in bug 1201318 comment 36?
Attachment #8688822 - Flags: review?(mstange) → review+
Yeah, I think I saw what you're seeing with one of the beta builds too. Some fonts had the "real" name, other ones had the meta name. On 10.11.1 all of the fonts return the meta name for [NSFont* familyName].
(In reply to John Daggett (:jtd) from comment #3)
> On 10.11.1 all of the fonts return the meta name for [NSFont* familyName].

I'm a little confused. Does that mean that GetRealFamilyName won't actually do anything useful in that case?
No, it will return the real name always :)

  [NSFont* familyName] ==> .AppleSystemUIFont
  GetRealFamilyName() ==> .SF NS Text
OK good.
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.