Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/Font Family Members
Required plugins for this example: MBS MacBase Plugin, MBS MacCocoa Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/Font Family Members
This example is the version from Wed, 23th Jul 2013.
Project "Font Family Members.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
End Control
EventHandler Sub Open() list "Courier New" list "Times" list "Times New Roman" End EventHandler
Sub list(name as string) dim f as NSFontMBS = NSFontMBS.fontWithName(name, 12) dim fontFamily as string = f.familyName dim FontManager as new NSFontManagerMBS dim fonts() as Variant = FontManager.availableMembersOfFontFamily(fontFamily) for each item as Variant in fonts dim a() as Variant = item dim PostScriptFontName as string = a(0) dim NameExtension as string = a(1) dim weight as Double = a(2) dim traits as Double = a(3) dim font as NSFontMBS = NSFontMBS.fontWithName(PostScriptFontName, 12) dim file as FolderItem = font.file listbox1.AddRow PostScriptFontName, NameExtension, str(weight), str(traits), file.name next End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCocoa Plugin.

MBS Xojo Chart Plugins