I have an application where I need a lot of TGTextButton, layed out vertically. This application has to work with a poor screen in number of pixels. In order to make the vertical dimension of the buttons as small as possible, I wanted to decrease the size of the font used for TGTextButton. I was unable to find a description of the type FontStruct_t.
Can somebody show me a small piece of code doing that? Thanks a lot!
Hi F-X,
FontStruct_t is an opaque pointer on underlying font structure (and platform dependant). So I suggest you to do it this way:
Or to change globally in system.rootrc (or in your own .rootrc) the following entry:
Gui.DefaultFont: --helvetica-medium-r---12------iso8859-1
But be careful, this will change all the gui font sizeā¦
Cheers,
Bertrand.
Hi F-X,
the same
TGFontPool *pool = gClient->GetFontPool();
// family , size (minus value - in pixels, positive value - in points), weight, slant
// kFontWeightNormal, kFontSlantRoman are defined in TGFont.h
TGFont *font = pool->GetFont("helvetica", -9, kFontWeightNormal, kFontSlantRoman);
font->Print();
FontStruct_t ft = font->GetFontStruct();
button->SeFont(ft);
We can add such helper method to TGTextButton class.
Regards. Valeriy
Thanks a lot, it works