drawbot icon indicating copy to clipboard operation
drawbot copied to clipboard

Add argument for listFontGlyphNames() ?

Open HugoJourdan opened this issue 1 year ago • 4 comments

Could it be possible to pass a font as argument in listFontGlyphNames(), in addition to the current method ? Like with listNamedInstances()

font("Times")
glyphs = listFontGlyphNames()

#Additonnal method could be
glyphs = listFontGlyphNames("Times")

HugoJourdan avatar Mar 20 '23 16:03 HugoJourdan

Getting font attributes/info and optionally provide a fontName or path:

  • listOpenTypeFeatures(fontNameOrPath=None)
  • listFontVariations(fontNameOrPath=None)

Getting font attributes/info without a option to provide a fontName or path (you need to set a font(..) first):

  • fontContainsCharacters()
  • fontContainsGlyph(..)
  • fontFilePath()
  • fontFileFontNumber()
  • listFontGlyphNames()
  • fontAscender()
  • fontDescender()
  • fontXHeight()
  • fontCapHeight()
  • fontLeading()
  • fontLineHeight()

Im actually in favour of deprecating the fontNameOrPath argument...

any other ideas @justvanrossum ?

typemytype avatar Apr 03 '23 12:04 typemytype

No strong opnion here. I'm fine with deprecating, although I bet it will make some people unhappy.

justvanrossum avatar Apr 03 '23 17:04 justvanrossum

the other option is to support fontNameOrPath in the other callbacks... or how to decide which one get the optional argument and which one not

typemytype avatar Apr 03 '23 17:04 typemytype

I believe that adding support for fontNameOrPath in other callbacks could be very beneficial.

HugoJourdan avatar Apr 04 '23 10:04 HugoJourdan