Font Sans, size, Hyperlink gadget

Linux specific forum
rotacak
User
User
Posts: 77
Joined: Tue Feb 14, 2006 2:00 pm

Font Sans, size, Hyperlink gadget

Post by rotacak »

How load "Sans" font with specified size? All text in my app is too big. Also some special characters is broken, because is not used Sans font.
I use Ubuntu and font requester display only some fonts without "Sans". But in system setup "Sans" exist and is used.

Hyperlink gadget - when I click on adress, nothing happens. It's normal?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

You need to manually handle the click event on the hyperlink gadget.
rotacak
User
User
Posts: 77
Joined: Tue Feb 14, 2006 2:00 pm

Post by rotacak »

OK, but RunProgram("http://site.com") nothing do. In windows it's ok.
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

rotacak wrote:OK, but RunProgram("http://site.com") nothing do. In windows it's ok.
On Linux, you are going to need to call a browser first. for example:

Gnome:

Code: Select all

RunProgram("nautilus","http://www.purebasic.com")
KDE:

Code: Select all

RunProgram("konqueror","http://www.purebasic.com")
You could do this with Firefox but not everyone one has it installed.
-Beach
rotacak
User
User
Posts: 77
Joined: Tue Feb 14, 2006 2:00 pm

Post by rotacak »

Thanx, this work OK.

And what font size? How change font size in gadgets?
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

rotacak wrote:Thanx, this work OK.

And what font size? How change font size in gadgets?
Here is an example of how I set them. I could not figure out how to make a font underlined for your hyperlink gadget though. Still looks link-like to me...

Code: Select all

#PB_Font_Bold = 1
#PB_Font_Italic = 2
#PB_Font_Bold_Italic = 3

SansFont = LoadFont(#PB_Any,"sans",13,#PB_Font_Bold)
ArialFont = LoadFont(#PB_Any,"arial",8,#PB_Font_Italic)
HyperFont = LoadFont(#PB_Any,"sans",8,#PB_Font_Bold_Italic)

If SansFont = #FALSE Or ArialFont = #FALSE Or HyperFont = #FALSE
   MessageRequester("Error","Could not load system font")
   End
EndIff

If OpenWindow(0,174,8,170,110,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Font Test")
  If CreateGadgetList(WindowID(0))
    TextGadget(1,10,10,150,25,"This text should be in Arial...") 
    UseFont(ArialFont)
    SetGadgetFont(1,FontID())
    ButtonGadget(2,10,40,150,30,"Button")
    UseFont(SansFont)
    SetGadgetFont(2,FontID())
    HyperLinkGadget(3,10,75,150,28,"www.PureBasic.com",RGB(0,0,255))
    UseFont(HyperFont)
    SetGadgetFont(3,FontID())
  EndIf
EndIf

Repeat : Until WaitWindowEvent() = #PB_EventCloseWindow
Image
-Beach
rotacak
User
User
Posts: 77
Joined: Tue Feb 14, 2006 2:00 pm

Post by rotacak »

This not work. Can't load font. Your sample picture looks like from Ubuntu, but I don't know how this can be done.

I try other way, described somewhere here in forum. Load font like horrible name name-font-size-bla-bla.....
This on linux work ok, but no in GTK2 :(
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

rotacak wrote:This not work. Can't load font. Your sample picture looks like from Ubuntu, but I don't know how this can be done.

I try other way, described somewhere here in forum. Load font like horrible name name-font-size-bla-bla.....
This on linux work ok, but no in GTK2 :(
The sample above was compiled using Ubuntu 5.10 and with the GTK2 sub system. What distro are you using?
-Beach
Post Reply