Turning off the debugger, it works however.
LoadFont inside StartDrawing-block
LoadFont inside StartDrawing-block
The debugger still complains about usings of LoadFont inside a StartDrawing/StopDrawing block.
Turning off the debugger, it works however.
Turning off the debugger, it works however.
Re: LoadFont inside StartDrawing-block
Any code?
I haven't tested it, and maybe it's a bug, but I wonder: What is the absolute necessity of including LoadFont inside a StartDrawing()/StopDrawing() block?
I've never had a problem loading a font before using such a block...
I haven't tested it, and maybe it's a bug, but I wonder: What is the absolute necessity of including LoadFont inside a StartDrawing()/StopDrawing() block?
I've never had a problem loading a font before using such a block...
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Except on this sentence...
Re: LoadFont inside StartDrawing-block
Think Fred should make a decision on this.
Don't forget to erase the file.
Code: Select all
;{
define *img
define *fnt
;}
*img = createImage ( #pb_any,
256,
256 )
if ( startDrawing ( imageOutput ( *img ) ) )
;{
; this line works when the debugger is disabled:
*fnt = loadFont ( #pb_any,
"Lucida Console",
12 )
if ( ( *fnt ) and ( isFont ( *fnt ) ) )
;{
if ( fontId ( *fnt ) )
;{
drawingFont ( fontId ( *fnt ) )
drawText ( 0,
0,
"Testtext",
#white )
;}
endIf
;}
endIf
stopDrawing ( )
saveImage ( *img,
getTemporaryDirectory ( ) +
"256.bmp" )
runProgram ( getTemporaryDirectory ( ) +
"256.bmp" )
;}
endIf
Re: LoadFont inside StartDrawing-block
Yes, LoadFont() doesn't always work in startdrawing block, that's why the debugger complains. I don't see a problem here.

