Using default font on gadgets?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

Hi, I'm using this code to change the font of a gadget:

Code: Select all

LoadFont(1,"Pooh",12) : SetGadgetFont(FontID())
fraOptions_hWnd=Frame3DGadget(#fraOptions,8,8,338,113,"Options",0)
It works perfectly, but how do I then reset the font back to the system default
so that none of the following gadgets, created afterwards, have the Pooh font?
All I want is for this FrameGadget to have the Pooh font, and all the gadgets
inside it should be the system default.


PB - Registered PureBasic Coder

Edited by - PB on 30 January 2002 23:26:12
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Try SetGadgetFont(GetStockObject_(#ANSI_VAR_FONT)). Anyway, I will change the command, so a SetGadgetFont(0) will reset the font to previous one.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
Try SetGadgetFont(GetStockObject_(#ANSI_VAR_FONT)). Anyway, I will change the command, so a SetGadgetFont(0) will reset the font to previous one.
The ANSI thing worked, so thanks Fred! Good idea about the (0) parameter for
the future, too. Side-note: Any way to set the style of the font (bold, italic,
and so on)? I'll have to play with the GetStockObject API and see...


PB - Registered PureBasic Coder
Post Reply