[SOLVED] ScintillaGadget - Changing font
Posted: Mon Nov 04, 2013 10:18 pm
SOLVED
Has the ScintillaGadget changed the way the font should be changed?
Edit: PB5.20LTS
This no longer works - even crossplatform ( WinXP, Linux Mint 15, Mac OS X 10.9 )
The size is changed, but the fontface isn't
Cany anyone tell me why and how to fix it?
save as ScintillaFontTest.pb
Has the ScintillaGadget changed the way the font should be changed?
Edit: PB5.20LTS
This no longer works - even crossplatform ( WinXP, Linux Mint 15, Mac OS X 10.9 )
The size is changed, but the fontface isn't
Cany anyone tell me why and how to fix it?
save as ScintillaFontTest.pb
Code: Select all
Procedure SCINT_LoadFile(ID, FileName.s)
Protected FF, length, *mem
FF = ReadFile(#PB_Any, FileName)
If FF
length = Lof(FF)
If length
*mem = AllocateMemory(length+4)
If *mem
ReadStringFormat(FF)
ReadData(FF, *mem, length);-Loc(FF))
ScintillaSendMessage(ID, #SCI_SETTEXT, length, *mem)
FreeMemory(*mem)
CloseFile(FF)
ProcedureReturn #True
EndIf
EndIf
CloseFile(FF)
EndIf
EndProcedure
flgs=#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget
OpenWindow(0,0,0,620,820,"ScintillaFontTest",flgs)
ScintillaGadget(0,0,0,600,800,0)
ScintillaSendMessage(0, #SCI_SETCODEPAGE, #SC_CP_UTF8)
ScintillaSendMessage(0,#SCI_STYLESETFONT,#STYLE_DEFAULT,@"Monospace")
ScintillaSendMessage(0,#SCI_STYLESETSIZE,#STYLE_DEFAULT,16)
textile_file.s="ScintillaFontTest.pb"
SCINT_LoadFile(0,textile_file)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow