• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Font alignment when using bold variant of system font
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font alignment when using bold variant of system font


  • Subject: Font alignment when using bold variant of system font
  • From: Samuel Williams <email@hidden>
  • Date: Thu, 13 Oct 2016 10:39:01 +1300

Hello, I've got an app "Truth Tables" which does parsing and highlighting
of an expression.

I use a custom subclass of NSTextField in a toolbar.. it's worked fine
until the system font changed I think, but I'm not 100% sure because I've
only noticed the problem recently.

Here is the font code which triggers the issue (the commented out line is
the one that causes odd alignment behaviour):

// For some reason, when using this font, the vertical alignment becomes
odd.

//NSFont * identifierFont = [[NSFontManager sharedFontManager]
convertFont:self.font toHaveTrait:NSBoldFontMask];

NSFont * identifierFont = self.font;

There is a full source code listing here:
https://gist.github.com/ioquatix/f8357f895fbefe4ad96a9e71e668dbf3

When using self.font, everything is fine. But when using the bold variant,
the alignment is a bit off.

I've made a video demonstrating the issue because it's hard to describe:
https://www.youtube.com/watch?v=CTxTYhfjz8Y

Wondering if anyone has any idea what's going on here? Or where to start
trying to figure out?

Kind regards,
Samuel
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Font alignment when using bold variant of system font
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Xcode 8 causes scroll issue when displaying keyboard
  • Next by Date: Re: Font alignment when using bold variant of system font
  • Previous by thread: Re: Xcode 8 causes scroll issue when displaying keyboard
  • Next by thread: Re: Font alignment when using bold variant of system font
  • Index(es):
    • Date
    • Thread