Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

Required plugins for this example: MBS MacCF Plugin, MBS MacCG Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CoreText/Glyphs
This example is the version from Wed, 15th Jul 2014.
Project "Glyphs.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() test "Comic Sans MS" test "Zapfino" test "Symbol" End EventHandler
Sub Test(name as string) dim font as CTFontMBS = CTFontMBS.CreateWithName(name) if font = nil then MsgBox "Failed to find font." else dim f as new FontWindow f.run font end if End Sub
End Class
Class FontWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) As Boolean if column = 2 then dim charCode as integer = me.RowTag(row) dim text as string = encodings.UTF8.Chr(charCode) g.ForeColor = &c000000 g.TextFont = fontFullName g.TextSize = fontSize g.DrawString text, x, y Return true end if End EventHandler
End Control
Sub run(f as CTFontMBS) Title = f.FullName fontFullName = f.FullName fontSize = f.size dim c as CFCharacterSetMBS = f.CharacterSet for i as integer = 0 to 65535 if c.IsMember(i) then List.AddRow str(i), encodings.UTF8.Chr(i), "?" List.Rowtag(List.LastIndex) = i end if next End Sub
Property fontFullName As string
Property fontSize As Integer
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

Feedback, Comments & Corrections

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

MBS Xojo tutorial videos