Changing style font in Scintilla gadget does not work

Linux specific forum
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Changing style font in Scintilla gadget does not work

Post 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
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: Changing style font in Scintilla gadget does not work

Post 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!
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Changing style font in Scintilla gadget does not work

Post 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).
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: Changing style font in Scintilla gadget does not work

Post by uwekel »

Thx! An example for the ScintillaGadget in the "Examples" folder would be great :-)
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Post Reply