typemytype / drawbot

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

Serving `NSFont` to `font` #515

Open roberto-arista opened 1 year ago

roberto-arista commented 1 year ago

It might be a good addition to be able to serve a NSFont to all the font methods. Especially since system fonts are not usable anymore through their name.

Started as conversation in the RoboFont discord server: https://discord.com/channels/1052516637489766411/1055056206735101993/1079691208550527007

cc @typemytype

justvanrossum commented 1 year ago

I can't read the discord thread. What is the use case for using system fonts?

roberto-arista commented 1 year ago

For this particular case, I was trying to annotate the glyph cell background in the font overview with a system font.

justvanrossum commented 1 year ago

When you say "the font overview", do you mean "RoboFont's font overview"? If so, how does that use DrawBot?

roberto-arista commented 1 year ago
  1. yes
  2. it uses a subset of drawBot functionalities: https://www.robofont.com/documentation/reference/api/mojo/mojo-drawingtools/
justvanrossum commented 1 year ago

But isn't that implementation separate from DrawBot? I see how it's useful there, but not immediately in DrawBot-proper.

typemytype commented 1 year ago

CoreText does not allow font names starting with a . (those are system fonts) but there are available and accessible with NSFont. systemFontOfSize_(size) .

DrawBot already supports NSImage object in image(..)

An other option would be to have a small wrapper for system fonts.

justvanrossum commented 1 year ago

CoreText does not allow font names starting with a . (those are system fonts) but there are available and accessible with NSFont. systemFontOfSize_(size) .

I understand that. Why do we need to be able to use them in DrawBot?

typemytype commented 1 year ago

Why do we need to be able to use them in DrawBot?

Because its strange Apple does not allow systemFonts .<fontName> anymore, even they are installed and accessible with NSFont.systemFontOfSize_ and similar. The other option is to download all these fonts and install them if you would like to use them.

justvanrossum commented 1 year ago

Because its strange Apple does not allow systemFonts

That is not an answer to my question, though...

I'm not necessarily opposed to accepting NSFont (and or CGFont then?) in all font-releated drawbot calls, but so far the only answer I got for "why do we need this in DrawBot" is a use case for a drawbot-like API which isn't DrawBot.