typemytype / drawbot

http://www.drawbot.com
Other
393 stars 61 forks source link

Multiple fonts for `fallbackFont` #529

Open roberto-arista opened 1 year ago

roberto-arista commented 1 year ago

Hey all!

I've been working for a bit on a multi script specimens system, and I often have a situation where I need to set a fallback font on purpose. Sometimes a single font is fine, but defining a stack of fonts like browsers do would often be ideal.

The CoreText.NSFontCascadeListAttribute seem to accept a list of font attributes: https://github.com/typemytype/drawbot/blob/4313294e57bd02e7d384bfd313d49e55977edba9/drawBot/context/baseContext.py#LL1244C36-L1244C71 https://developer.apple.com/documentation/appkit/nsfontcascadelistattribute Would you consider to allow this for the API? In case let me know and I'll try to work on a PR.

typemytype commented 1 year ago

fallbackFont() could optionally accept a list of fonts