Platforms to show: All Mac Windows Linux Cross-Platform

Back to FolderItem class.

FolderItem.FontActivateMBS(OnlyLocal as boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Fonts MBS Util Plugin 4.3 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Activates one font.
Example
dim f as folderitem
dim e as Integer

f=SpecialFolder.Desktop.child("MyWonderfulFont.dfont")
e=f.FontActivateMBS(true)

select case e
case 0
msgbox "No error"
case -1
MsgBox "Parameter error. (Plugin)"
case 1 // Windows error
MsgBox "Parameter error. (System)"
case -43 // Mac error
MsgBox "File not found."
case -50 // Mac error
MsgBox "Parameter error. (System)"
case -108 // Mac error
MsgBox "File is not a font file."
else
MsgBox "Error: "+str(e)
end Select

The folderitem used here points to a font file.
If you want the Font Manager to make fonts not visible to all applications installed on the system, use the OnlyLocal property.

Requires Mac OS 9.0 or newer.
Returns -1 if this FontManager function was not found. 0 on success.

Some error codes for Mac:
0No error.
-43File not found.
-45File locked.
-108Out of memory.
-105Already registered.

Fails in Xojo 2017 on Windows due to changes in Xojo's way to handle fonts. The plugin still activates them, but Xojo doesn't allow you to use fonts which haven't been there earlier. See feedback case 46596.

Blog Entries

Xojo Developer Magazine

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


The biggest plugin in space...