问题
extension Font {
public static let Heading1: Font = system(size: 34, weight: .black, design: .default)
.smallCaps()
.italic()
}
I can make the font all caps OR italic - but not both. Anybody know how to get around this? Without typing the String out in caps to begin with. I even tried importing BlackItalic as a custom font and still had the same issue.
回答1:
None of Apple platform built-in font support both italic-smallcap features combination. System San Francisco is the most font-feature capable font supports smallcap for regular and bold, but not for italic.
Small caps are rare feature, and rare fonts support it, but even more rare, unique, fonts support both.
Here is quotation from Wikipedia ref.. pay attention on last sentence.
Small capitals are not found in all fonts, as they were primarily used within body text and so are often not found in fonts that are not intended for this purpose, such as many sans-serif families.[6] Some font families, especially digitisations of older metal type designs, often lack small caps in bold or italics, only having them in the regular or roman style.[7] This is because they were normally only used in body text and cutting bold and italic small caps was thought unnecessary.[a]
See also: AHIG Typography
来源:https://stackoverflow.com/questions/61369580/swiftui-font-smallcaps-not-working-with-italic