[MaxGUI] Canvas and fonts

BlitzMax Forums/BlitzMax Programming/[MaxGUI] Canvas and fonts

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In Bplus you can load a Reuqested font for a canvas with LoadFont and the data (FontName, FontSize) from the RequestedFont.
But in Bmax I can´t see a way to load an ImageFont by the Name (FontName, FontSize) of the requested Font.

Look at this

		Case EVENT_MOUSEDOWN
		
			Local TempFont:TGUiFont = RequestFont()
			
			If TempFont
				Local FontPath:String = "C:\WINDOWS\Fonts"+FontName(TempFont)+".ttf"
				Local ImageFont:TImageFont = LoadImageFont(FontPath, FontSize(TempFont))
				Print "Font Path: "+FontPath
				If ImageFont
					Print "ImageFont loaded"
					SetImageFont ImageFont
				EndIf
				
			EndIf


It´s a bad solution and he can find only the Arial font..

Mfg Suco