For some languages (such as CJK), there is no "italic" version of the font. For these fonts, if the traits contains .italic, NSFont.init(descriptor:size:) will fail to create the font and return nil.
I understand that it can be an "author error" to use a font without italic version, but use *some word* to make text italic. But I guess a hard crash for this error is too strict. Unless modifying every italic case in the original text, I won't be able to use a new font, which is not ideal and painful.
For some languages (such as CJK), there is no "italic" version of the font. For these fonts, if the
traits
contains.italic
,NSFont.init(descriptor:size:)
will fail to create the font and returnnil
.I understand that it can be an "author error" to use a font without italic version, but use
*some word*
to make text italic. But I guess a hard crash for this error is too strict. Unless modifying every italic case in the original text, I won't be able to use a new font, which is not ideal and painful.