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
I have a small problem. I would like to load a font with "RequestFont" and set it to my canvas (DrawText).
My first idea:
SuperStrict Local Quit:Int Local Window:TGadget Local Canvas:TGadget Window = CreateWindow("Font Test", 100,100,400,400) Canvas = CreateCanvas(0,0,ClientWidth(Window), ClientHeight(Window), Window) SetGadgetLayout canvas, EDGE_ALIGNED,0, EDGE_ALIGNED,0 Quit = False Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE Quit = True Case EVENT_WINDOWSIZE SetGadgetShape canvas, 0,0,ClientWidth(Window), ClientHeight(Window) Case EVENT_MOUSEDOWN Local TempFont:TGUiFont = RequestFont() If TempFont Print "Font loaded" SetGadgetFont Canvas, TempFont EndIf Case EVENT_GADGETPAINT Select EventSource() Case Canvas SetGraphics CanvasGraphics(Canvas) SetViewport 0,0,GadgetWidth(Canvas), GadgetHeight(Canvas) Cls DrawText "Click to load a font",10,10 Flip End Select End Select Until Quit = True
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