• 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
Re: How to get a condensed San Francisco UIFont?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a condensed San Francisco UIFont?


  • Subject: Re: How to get a condensed San Francisco UIFont?
  • From: Kevin Meaney <email@hidden>
  • Date: Thu, 08 Oct 2015 00:33:45 +0100

I believe the CoreText attributes should work.

The attribute key of kCTFontTraitsAttribute with a value of TraitCondensed might do the trick.

Kevin

> On 8 Oct 2015, at 00:01, David Hoerl <email@hidden> wrote:
>
> I'd like to do is get a condensed - or better yet - a bold (semi-bold) condensed version of the "San Francisco" system font.
>
> What I propose to do is get a "starter" font:
>
>  let font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline)
>
> then get the font descriptor:
>
>  let fd1 = font.fontDescriptor()
>
> then add a "condensed" attribute:
>
>  let fd2 = fd1.fontDescriptorByAddingAttributes[ the magic sauce ]
>
>  let finalFont = UIFont(descriptor: fd2, size: 0)
>
> My only problem is I don't know the "magic sauce", and there is a darth of information on fontDescriptorByAddingAttributes (google it yourself).
>
> I sure would appreciate anyone who can tell me, or point me in the right direction, so I can find the "magic sauce" formula.
>
> - David
> _______________________________________________
>
> 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


_______________________________________________

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


References: 
 >How to get a condensed San Francisco UIFont? (From: David Hoerl <email@hidden>)

  • Prev by Date: Re: How to get a condensed San Francisco UIFont?
  • Next by Date: Re: CFBundleSupportedPlatforms issue
  • Previous by thread: Re: [SOLVED] How to get a condensed San Francisco UIFont?
  • Next by thread: NSTextField subclass needs cell subclass as well - how?
  • Index(es):
    • Date
    • Thread