Re: [ROOT] Different color palettes within one canvas

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu May 10 2001 - 11:12:17 MEST


Hi Christian,

I do not agree with your request of SetLineColor(r,g,b);
The TAttLine object must be as small as possible (currently 3 shorts).
Your request would imply to add 3 floats (or 3 doubles).
I do not see the interest to define the rgb on a per object basis.
You define the color once, then you reference the color.

Rene Brun

Christian Holm Christensen wrote:
> 
> Hi Valeri,
> 
> On Wed, 9 May 2001 20:31:52 -0400
> "Valeri Fine" <fine@bnl.gov> wrote
> concerning ": Re: [ROOT] Different color palettes within one canvas":
> > What about
> >
> > http://root.cern.ch/root/htmldoc/TColor.html
> >
> > It seems to me one can use it to define color either way you described.
> 
> Ok, I overlooked that one.  However, it would  nice if one could use
> RGB and/or CMYK directly in the various Set...Color
> 
>    TH1D*   myHist  = new TH1D("myHist", "myHist", 100, 0, 10);
>    myHist->SetLineColor(.123, .456, .789);
> 
> rather than having to do
> 
>    TColor* myColor = new TColor(10000, .123, .456, .789, "myColor");
>    TH1D*   myHist  = new TH1D("myHist", "myHist", 100, 0, 10);
>    myHist->SetLineColor(1000);
> 
> I guess it's a trick of looking up to see if there's a TColor already
> with that definition, and if not make one.
> 
> > Windows maps X11 fonts to Windows fonts as follows:
> > /______________________________________________________________________________
> > void  TGWin32::SetTextFont(Font_t fontnumber)
> > {
> > /*-*-*-*-*-*-*-*-*-*-*-*-*Set current text font number*-*-*-*-*-*-*-*-*-*-*-*
> > /*-*                      ===========================
> >
> >   fTextFont = fontnumber;
> >
> > /*-*  List of the currently supported fonts (screen and PostScript)
> > /*-*  =============================================================
> > /*-*   Font ID       X11                       Win32 TTF       lfItalic  lfWeight x 10
> > /*-*        1 : times-medium-i-normal      "Times New Roman"      1           4
> 
> Ok, so Windoze expects a string and two intergers.  The issue then, is
> to translate font specifications of the form
> 
>   -<foundry>-<family>-<weigth>-<slant>-<set width>-<add style>-<pixel size>-<point size>-<resolution x>-<resolution y>-<spacing>-<average width>-<character set>
> 
> into a string and two intergers, in some generic way perferably.
> Limiting ROOT to only use 5 fonts I believe is a shame.  Therefore, if
> one could specify a font as
> 
>    TTextAttr::SetFont(const char* foundry,
>                       const char* family,
>                       const char* weight,
>                       char        slant,
>                       const char* set_width,
>                       const char* add_style,
>                       int         pixel_size,
>                       int         point_size,
>                       int         resolution_x,
>                       int         resolution_y,
>                       char        spacing,
>                       int         average_width,
>                       const char* charactre_set);
> 
> and at least when using X, ask the font server to give back the right
> one.  For Windoze, I guess you can ask Windoze font server(?) for the
> font, based on the <family>, <slant> and <weight> only.
> 
> It should be noted, that
> 
>      times-medium-i-normal
> 
> is really an alias in the X font server for something like
> 
>      -*-times-medium-i-normal-*-*-*-*-*-*-*-*
> 
> If you were able to specify fonts like I suggest, then you could use
> what ever font you may have on the system (ofcourse they may not be
> avaliable on your collaborators machines, but that's really your
> problem, not ROOTs).  For example, I have some 200 fonts avaliable
> from my X font server, and while I will never use all of them, it
> would be nice to use more then 5 :-)
> 
> Uh, it still seems odd to me that the regular X fonts does not scale
> well in the Canvas.  I mean, looking at any other application, there
> seems to be no reason why you can't get them to scale better.  I
> haven't looked in the ROOT source code, so I'm just babling along
> uninformed, and ignorant of any problems there might be.
> 
> Yours,
> 
> Christian  -----------------------------------------------------------
> Holm Christensen                             Phone:  (+45) 35 35 96 91
>   Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305
>   DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm
>   Denmark                                    Email:       cholm@nbi.dk



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:44 MET