Text area font problem
BlitzPlus Forums/BlitzPlus Programming/Text area font problem| 
 | ||
| SetTextAreaFont FileEdit, RequestFont() This doesn't work. Not matter which font I select, it always comes out as the standard Arial font or whatever it is. A bug in Blitz+? | 
| 
 | ||
| About fonts; you know why many fonts get their chars "cropped" esp. cursive ones, and what could be done about it? | 
| 
 | ||
| Seems ok here. Test program (using latest B+): win=CreateWindow("Text Area - Font",50,150,407,184,Desktop(),1)
textarea = CreateTextArea(18,20,361,96,win,1)
bt_changefont=CreateButton("Change Font",120,128,124,20,win)
AddTextAreaText textarea,"Font test ABC123 !£$%^&*()"
Repeat
 ev=WaitEvent()
 Select ev
  Case $401 ; gadget
  If EventSource()=bt_changefont
   SetTextAreaFont textarea,RequestFont()
  EndIf
  Case $803,$103 ; close window / keystoke
   Exit
 End Select
Forever
EndHow about: fnt=RequestFont() SetTextAreaFont textarea,fnt?? | 
| 
 | ||
| WillKoh, not a clue! Syntax Error, very interesting. That test program works. Now try adding these lines before setting the font: SetTextAreaColor textarea, 255, 255, 255 SetTextAreaColor textarea, 0, 0, 0, True Now it doesn't work any more! | 
| 
 | ||
| Aha, my problem was actually two seperate problems. 1) Changing the text area font resets the foreground colour but not the background 2) You can't do LoadFont("Data\Blitz.fon", 14), you have to install the font and do LoadFont("Blitz", 14), or it will appear as Arial. | 
| 
 | ||
| Regarding number 2. I believe Blitz looks at the fonts internal 'typeface' name rather than the filename. |