Questions about fonts

Linux specific forum
Armoured
Enthusiast
Enthusiast
Posts: 365
Joined: Mon Jan 26, 2004 11:39 am
Location: ITALY
Contact:

Questions about fonts

Post by Armoured »

Hi
I need to have the same GUI look with different fonts.

GTK can automaticaly adapt all the gadget to a different font?
if answer is no what font I must use to have the same look on differents Linux?
Is possible to include a font in a program?

Thanks
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

you can ship a font with your exe (see IncludeBinary) and use this font with

Code: Select all

SetGadgetFont(#PB_Default,FontID(myfnt))
to have the same font on each Gadget
(after extracting the font to disk and loaded with LoadFont() first)

with GTK+ you can use rc-files to achieve a change of the look of your program
Armoured
Enthusiast
Enthusiast
Posts: 365
Joined: Mon Jan 26, 2004 11:39 am
Location: ITALY
Contact:

Post by Armoured »

walker wrote:you can ship a font with your exe (see IncludeBinary) and use this font with

Code: Select all

SetGadgetFont(#PB_Default,FontID(myfnt))
to have the same font on each Gadget
(after extracting the font to disk and loaded with LoadFont() first)

with GTK+ you can use rc-files to achieve a change of the look of your program
Hi walker
the LoadFont() command works if the font is located in the program directory?
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

yes, but you'll have to specify the path to the font... i.e.

Code: Select all

LoadFont(#Pb_Any,"/home/xyz/mypgm/myfont.ttf",10)
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re:

Post by Keya »

walker wrote:yes, but you'll have to specify the path to the font... i.e.

Code: Select all

LoadFont(#Pb_Any,"/home/xyz/mypgm/myfont.ttf",10)
Is that actually valid - using a filename with LoadFont() ? it's not mentioned in the helpfile, and both my tests of it failed on Win + Linux. I too am looking for a way to dynamically load font from ttf file on OSX + Linux
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Do: Re: Me:

Post by heartbone »

Keya wrote:
walker wrote:yes, but you'll have to specify the path to the font... i.e.

Code: Select all

LoadFont(#Pb_Any,"/home/xyz/mypgm/myfont.ttf",10)
Is that actually valid - using a filename with LoadFont() ? it's not mentioned in the helpfile, and both my tests of it failed on Win + Linux. I too am looking for a way to dynamically load font from ttf file on OSX + Linux
http://www.purebasic.fr/english/viewtop ... 37#p471937
Keep it BASIC.
Post Reply