substituteFont(for:)
Replaces the specified font with a suitable screen font if one is available.
Declaration
func substituteFont(for originalFont: NSFont) -> NSFontParameters
- originalFont:
The font to replace.
Return Value
A screen font suitable for use in place of originalFont, or simply originalFont if a screen font can’t be used or isn’t available.
Discussion
A screen font can be substituted if the receiver is set to use screen fonts and if no NSTextView associated with the receiver is scaled or rotated.
See Also
Methods
showCGGlyphs(_:positions:count:font:matrix:attributes:in:)invalidateGlyphs(onLayoutInvalidationForGlyphRange:)invalidateLayout(forCharacterRange:isSoft:actualCharacterRange:)textStorage(_:edited:range:changeInLength:invalidatedRange:)insertGlyph(_:atGlyphIndex:characterIndex:)insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)glyph(at:)glyph(at:isValidIndex:)replaceGlyph(at:withGlyph:)getGlyphs(_:range:)getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:)getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)deleteGlyphs(in:)setCharacterIndex(_:forGlyphAt:)intAttribute(_:forGlyphAt:)