Page 1 of 1

Changing style font in Scintilla gadget does not work

Posted: Sat May 05, 2012 5:36 pm
by uwekel
Hi,

i want to change the default style font in a Scintilla gadget, but it does not work on Fedora 16 64-bit. Instead the font style changed to italic.

Code: Select all

CompilerIf #PB_Compiler_OS = #PB_OS_Windows
  font.s = "Courier New"
  InitScintilla()  
CompilerElse
  font.s = "Monospace"
CompilerEndIf
OpenWindow(0, 0, 0, 400, 400, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScintillaGadget(0, 8, 8, 384, 384, #Null)
ScintillaSendMessage(0, #SCI_STYLESETFONT, #STYLE_DEFAULT, @font)
ScintillaSendMessage(0, #SCI_SETTEXT, 0, @"This is a simple ScintillaGadget with text.")
Repeat 
Until WaitWindowEvent() = #PB_Event_CloseWindow
On Windows XP 32-bit the code works as expected.

Thx for your help!

Uwe

Re: Changing style font in Scintilla gadget does not work

Posted: Sun May 06, 2012 7:18 pm
by uwekel
In the meantime i found out that the font name needs an exclamation mark in front of the name, e.g. "!Monospace" instead of "Monospace". I do not know the reason but it works!

Re: Changing style font in Scintilla gadget does not work

Posted: Wed May 09, 2012 1:11 pm
by Fred
That's not a bug. It's scintilla on linux with GTK2 which requiers this. Gtk2 'Pango' need an "!" before the font name (else it will use GDK font).

Re: Changing style font in Scintilla gadget does not work

Posted: Wed May 09, 2012 7:40 pm
by uwekel
Thx! An example for the ScintillaGadget in the "Examples" folder would be great :-)