[MaxGUI] Canvas and fonts
BlitzMax Forums/BlitzMax Programming/[MaxGUI] Canvas and fonts
| ||
Hi I have a small problem. I would like to load a font with "RequestFont" and set it to my canvas (DrawText). My first idea: No effects with this code. If i use FontName and LoadImageFont, i canīt load every selected font from my "windows/fonts"+FontName()+".ttf" dir. Any idea? Thanks. Mfg Suco |
| ||
Is there a problem loading the image font? You cant set a gadget font to the canvas, because ist has no guitexts in it. I think this is pixel manipulation and will not be saved as objects, more as a PixMap. So you can' set Gadget fonts. There's just one way I think. Load the imagefont or use labels to represent texts. EDIT: As the result, you can only set Fonts per RequestFont, which returns a GUI font, to GUI Objects. Drawtext isnt a GUI object i think. Hope you understood by bad english, german friend ,D IMurDOOM |
| ||
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 |
| ||
Yes, i have the same problem, that should have other reasons why it doesn't work (I think). I hardcoded a few fonts and didn't got it to work. With your solution, some fonts are working, others not. As i said, guifonts for textareas and labels are nicely working. Hmmmmmmmm, IMurDOOM |
| ||
Is this a bug? That's a gread problem for me! And ImageFont isn't absolutely a solution... |