SetTextAreaFont - Problem

BlitzPlus Forums/BlitzPlus Programming/SetTextAreaFont - Problem

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.

Here is an expanded exaple of your example:

;Textarea Font Size Bug test
;Run app. Select font (Change Font button), choose Arial 24 Normal. 
;Text will appear in textarea with proper size.
;Compare to size of font (also Arial 24 Normal) using loadfont in text area below. mmmmmm:)





AppTitle("Test")
win=CreateWindow("Test",100,100,300,300,Desktop())
Global are=CreateTextArea(10,20,250,50,win)
Global are1=CreateTextArea(10,90,250,50,win)

Global but=CreateButton("Exit",10,200,40,16,win)
Global but1=CreateButton("Change Font",10,2,80,16,win)
   
myfont$="Arial"
fonth=24
fnt=LoadFont(myfont$,fonth)
SetTextAreaFont are1,fnt
SetTextAreaText(are1,"Should be bigger.")


While WaitEvent()<>$803
	id=EventID()

	If id=$401
		manage_event()
	EndIf
	

Wend
End


Function manage_event()
	es=EventSource()
	
	If es=but Then End
	
	If es=but1
		font=RequestFont()
		If font>0 
			SetTextAreaFont are,font
		EndIf
		SetTextAreaText are,"This looks right",0,20,1
	EndIf
	

End Function


Click on the Change Font button and select Arial 24 Normal. It will insert and show text in the proper size (using font requestor). Compare this to the text in the text area below using LoadFont. Although it is the same size the font it is much smaller.

Maybe some others could test to verify this bug. :)

-edit- I'm adding 8pnts to font size as a work around. It makes it close, but still not right.

L8r,