a TGLabel has the following ctor:
TGLabel(const TGWindow *p, TGString *text,
GContext_t norm = fgDefaultGC,
FontStruct_t font = fgDefaultFontStruct,
UInt_t options = kChildFrame,
ULong_t back = fgDefaultFrameBackground);
to create the label with a loarge font do something like:
FontStruct_t font =
gClient->GetFontByName("-adobe-times-medium-r-*-*-24-*-*-*-*-*-iso8859-1");
new TGlabel(win, "aap", fgDefaultGC, font);
ROOT fonts are scaled to any size, so they sometimes don't look very nice
on the screen, but at least they show how the hardcopy will look like.
GUI fonts are not scaled. They are the size you give them in the GetFontByName()
call. That's why they always look nice.
Cheers, Fons.
Rutger van der Eijk wrote:
>
> Hi,
>
> I don't seem to be able to find out the appropriate way to use fonts.
>
> For example for a TGLabel i want to set the font to TimesNewRoman of size
> 24. How should I do that?
>
> probably related questions:
> - What is the difference beteen FontH_t, FontStruct_t and Font_t?
> - Is there a difference between 'normal root fonts' and 'GUI root fonts'?
> - As GUI resources several fonts are settable (NormalFints etc...) with
> strings like '-adobe-helvetica-medium-r-*- ... (etc)' Can/Should I also
> use this?
> - I see that all above typedefs are (long/short) integers, how do i know
> which font correspond to which number?
> - So in general: how to use fonts in root?
>
> Rutger van der Eijk
-- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248 E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910