Re: How to get a condensed San Francisco UIFont?
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