On Mac OS X 10.12, Xojo 2017r2.1, MBS 17,4

I am trying to add a font to a collection, but it never gets added. I have
tried two different ways to make the FontDescriptor, but the font never
gets added to the collection.

CollectionName is a variable that is retrieved
from NSFontManagerMBS.CollectionNames

Is there something I am doing wrong?


#if TargetMacOS then
  dim fm as new NSFontManagerMBS
  dim d as new Dictionary
  d.Value( "NSFontFaceAttribute" ) = lstTypeFace.Text
  d.Value( "NSFontFamilyAttribute" ) = lstFontName.Text
  'dim nsDic as NSDictionary = Cocoa.NSObjectFromVariant( d )
  dim fd as new NSFontDescriptorMBS( d )
  dim arrFD() as NSFontDescriptorMBS
  arrFD.Append( fd )
  fm.addFontDescriptorsToCollection( arrfd, CollectionName )
#endif


In this case the currFont (NSFontMBS) is a valid font.

#if TargetMacOS then
  Dim fm As New NSFontManagerMBS
  Dim currFont As NSFontMBS =
NSFontMBS.fontWithName(lstTypeFlstFontNameace.Text,13)

  Dim fd As NSFontDescriptorMBS = currFont.fontDescriptor
  dim arrFD() as NSFontDescriptorMBS
  arrFD.Append( fd )
  fm.addFontDescriptorsToCollection( arrfd, CollectionName )
#endif
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
mbsplugins@monkeybreadsoftware.info
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to