Note that there are some explanatory texts on larger screens.

plurals
  1. USipaterson
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COThe "Using Fonts With Text Kit" WWDC session sheds a bit of light on what might be happening here. Around 18:00 in the video, slide 18 in the PDF a note is made that `fontDescriptorWithSymbolicTraits:` performs a font matching procedure internally. It is only supposed to give you back a descriptor that will actually match a font. That explains why `italicDescriptor` above doesn't work; there is no variant of the headline font that is italic but not bold. Ultimately Dynamic Type controls the weight of the headline font based on the content size, so you apparently cannot change that.
      singulars
    2. COUgh, going one step farther I see what you meant... Creating a font from the `nonBoldDescriptor` above still results in a bold font regardless of removing the trait. Do you know whether this problem is unique to the headline font? When italicized it is `.AppleSystemUIItalicHeadline` and otherwise `AppleSystemUIHeadline`, I wonder if there is no regular weight option for that font… Maybe Apple's intention is for you to strip the attributes off of that descriptor and use a named font if you want to customize, I'll have to read up.
      singulars
    3. COInteresting, that differs from what I'm seeing (removing bold as shown above works for me) but you're on to something with that `1<<14`. It seems like traits are not applied against a font descriptor created with `preferredFontDescriptorWithTextStyle:` unless that bit is set. The `italicDescriptor` above does not work; seems you have to combine it with `descriptor.symbolicTraits` to have any effect. Updating the response...
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload