Logo ROOT   6.08/02
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TPostScript.cxx
Go to the documentation of this file.
1 // @(#)root/postscript:$Id$
2 // Author: Rene Brun, Olivier Couet, Pierre Juillot, Oleksandr Grebenyuk, Yue Shi Lai
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TPostScript
13 \ingroup PS
14 
15 Interface to PostScript.
16 
17 To generate a Postscript (or encapsulated ps) file corresponding to
18 a single image in a canvas, you can:
19 
20  - Select the <B>Print PostScript</B> item in the canvas <B>File</B> menu.
21  By default, a Postscript file with the name of the canvas.ps is generated.
22  - Click in the canvas area, near the edges, with the right mouse button
23  and select the <B>Print</B> item. You can select the name of the Postscript
24  file. If the file name is xxx.ps, you will generate a Postscript file named
25  xxx.ps. If the file name is xxx.eps, you generate an encapsulated Postscript
26  file instead.
27  - In your program (or macro), you can type:
28 ~~~ {.cpp}
29  c1->Print("xxx.ps")</B> or <B>c1->Print("xxx.eps").
30 ~~~
31  This will generate a file corresponding to the picture in the canvas
32  pointed by `c1`.
33 ~~~ {.cpp}
34  pad1->Print("xxx.ps");
35 ~~~
36  prints only the picture in the pad pointed by `pad1`.
37 
38 The size of the Postscript picture, by default, is computed to keep the aspect
39 ratio of the picture on the screen, where the size along x is always 20cm. You
40 can set the size of the PostScript picture before generating the picture
41 with a command such as:
42 
43 ~~~ {.cpp}
44  TPostScript myps("myfile.ps",111)
45  myps.Range(xsize,ysize);
46  object->Draw();
47  myps.Close();
48 ~~~
49 You can set the default paper size with:
50 ~~~ {.cpp}
51  gStyle->SetPaperSize(xsize,ysize);
52 ~~~
53 You can resume writing again in this file with `myps.Open();`.
54 Note that you may have several Postscript files opened simultaneously.
55 
56  ## Output type
57 
58 The output type allows to define how the PostScript output will looks like.
59 It allows to define the page format (A4, Legal etc..), the orientation
60 (Portrait, Landscape) and the number of images (zones) per page.
61 The output type has the following form:
62 
63 ~~~ {.cpp}
64  [Format][Nx][Ny][Type]
65 ~~~
66 
67 Where:
68 
69  - Format : Is an integer between 0 and 99 defining the page format:
70 ~~~ {.cpp}
71  Format = 3 the paper is in the standard A3 format.
72  Format = n (1<n<98) is an An format.
73  Format = 4 and Format=0 are the same and define an A4 page.
74  The A0 format is selected by Format=99.
75  The US format Letter is selected by Format = 100.
76  The US format Legal is selected by Format = 200.
77  The US format Ledger is selected by Format = 300.
78 ~~~
79  - Nx, Ny : Specify respectively the number of zones on the x and y axis.
80  Nx and Ny are integers between 1 and 9.
81  - Type : Can be equal to:
82  - 1 : Portrait mode with a small margin at the bottom of the page.
83  - 2 : Landscape mode with a small margin at the bottom of the page.
84  - 4 : Portrait mode with a large margin at the bottom of the page.
85  - 5 : Landscape mode with a large margin at the bottom of the page.
86  The large margin is useful for some PostScript printers (very often
87  for the colour printers) as they need more space to grip the paper
88  for mechanical reasons. Note that some PostScript colour printers
89  can also use the so called special A4 format permitting the full
90  usage of the A4 area; in this case larger margins are not necessary
91  and Type=1 or 2 can be used.
92  - 3 : Encapsulated PostScript. This Type permits the generation of files
93  which can be included in other documents, for example in LaTeX files.
94 
95 ## Making several pictures in the same Postscript file: case 1
96 
97 The following macro is an example illustrating how to open a Postscript
98 file and draw several pictures. The generation of a new Postscript page
99 is automatic when `TCanvas::Clear` is called by `object->Draw()`.
100 
101 ~~~ {.cpp}
102  {
103  TFile f("hsimple.root");
104  TCanvas c1("c1","canvas",800,600);
105 
106  // select postscript output type
107  // type = 111 portrait ps
108  // type = 112 landscape ps
109  // type = 113 eps
110  Int_t type = 111;
111 
112  // create a postscript file and set the paper size
113  TPostScript ps("test.ps",type);
114  ps.Range(16,24); //set x,y of printed page
115 
116  // draw 3 histograms from file hsimple.root on separate pages
117  hpx->Draw();
118  c1.Update(); //force drawing in a macro
119  hprof->Draw();
120  c1.Update();
121  hpx->Draw("lego1");
122  c1.Update();
123  ps.Close();
124  }
125 ~~~
126 
127 ## Making several pictures in the same Postscript file: case 2
128 
129 This example shows 2 pages. The canvas is divided.
130 `TPostScript::NewPage` must be called before starting a new
131 picture.`object->Draw` does not clear the canvas in this case
132 because we clear only the pads and not the main canvas.
133 Note that `c1->Update` must be called at the end of the first picture.
134 
135 ~~~ {.cpp}
136  {
137  TFile *f1 = new TFile("hsimple.root");
138  TCanvas *c1 = new TCanvas("c1");
139  TPostScript *ps = new TPostScript("file.ps",112);
140  c1->Divide(2,1);
141  // picture 1
142  ps->NewPage();
143  c1->cd(1);
144  hpx->Draw();
145  c1->cd(2);
146  hprof->Draw();
147  c1->Update();
148 
149  // picture 2
150  ps->NewPage();
151  c1->cd(1);
152  hpxpy->Draw();
153  c1->cd(2);
154  ntuple->Draw("px");
155  c1->Update();
156  ps->Close();
157 
158  // invoke Postscript viewer
159  gSystem->Exec("gs file.ps");
160  }
161 ~~~
162 
163 ## Making several pictures in the same Postscript file: case 3
164 This is the recommended way. If the Postscript file name finishes with
165 "(", the file remains opened (it is not closed). If the Postscript file name
166 finishes with ")" and the file has been opened with "(", the file is closed.
167 
168 Example:
169 ~~~ {.cpp}
170  {
171  TCanvas c1("c1");
172  h1.Draw();
173  c1.Print("c1.ps("); // write canvas and keep the ps file open
174  h2.Draw();
175  c1.Print("c1.ps"); // canvas is added to "c1.ps"
176  h3.Draw();
177  c1.Print("c1.ps)"); // canvas is added to "c1.ps" and ps file is closed
178  }
179 ~~~
180 The `TCanvas::Print("file.ps(")` mechanism is very useful, but it can
181 be a little inconvenient to have the action of opening/closing a file being
182 atomic with printing a page. Particularly if pages are being generated in some
183 loop one needs to detect the special cases of first and last page and then
184 munge the argument to Print() accordingly.
185 The "[" and "]" can be used instead of "(" and ")" as shown below.
186 
187 Example:
188 ~~~ {.cpp}
189  c1.Print("file.ps["); // No actual print, just open file.ps
190 
191  for (int i=0; i<10; ++i) {
192  // fill canvas for context i
193  // ...
194 
195  c1.Print("file.ps"); // Actually print canvas to the file
196  }
197 
198  c1.Print("file.ps]"); // No actual print, just close the file
199 ~~~
200 
201  ## Color Model
202 
203 TPostScript support two color model RGB and CMYK. CMY and CMYK models are
204 subtractive color models unlike RGB which is an additive. They are mainly
205 used for printing purposes. CMY means Cyan Magenta Yellow to convert RGB
206 to CMY it is enough to do: C=1-R, M=1-G and Y=1-B. CMYK has one more
207 component K (black). The conversion from RGB to CMYK is:
208 
209 ~~~ {.cpp}
210  Double_t Black = TMath::Min(TMath::Min(1-Red,1-Green),1-Blue);
211  Double_t Cyan = (1-Red-Black)/(1-Black);
212  Double_t Magenta = (1-Green-Black)/(1-Black);
213  Double_t Yellow = (1-Blue-Black)/(1-Black);
214 ~~~
215 CMYK add the black component which allows to have a better quality for black
216 printing. PostScript support the CMYK model.
217 
218 To change the color model use gStyle->SetColorModelPS(c).
219 
220  - c = 0 means TPostScript will use RGB color model (default)
221  - c = 1 means TPostScript will use CMYK color model
222 */
223 
224 #ifdef WIN32
225 #pragma optimize("",off)
226 #endif
227 
228 #include <stdlib.h>
229 #include <string.h>
230 #include <ctype.h>
231 #include <wchar.h>
232 #include <fontconfig/fontconfig.h>
233 
234 #include "Riostream.h"
235 #include "Byteswap.h"
236 #include "TROOT.h"
237 #include "TColor.h"
238 #include "TVirtualPad.h"
239 #include "TPoints.h"
240 #include "TPostScript.h"
241 #include "TStyle.h"
242 #include "TMath.h"
243 #include "TText.h"
244 #include "TSystem.h"
245 #include "TEnv.h"
246 
247 #include "../../../graf2d/mathtext/inc/fontembed.h"
248 
249 // to scale fonts to the same size as the old TT version
250 const Float_t kScale = 0.93376068;
251 
252 // Array defining if a font must be embedded or not.
253 static Bool_t MustEmbed[32];
254 
256 
258 
259 ////////////////////////////////////////////////////////////////////////////////
260 /// Default PostScript constructor
261 
263 {
264  fStream = 0;
265  fType = 0;
266  gVirtualPS = this;
267  fBlue = 0.;
268  fBoundingBox = kFALSE;
269  fClear = kFALSE;
270  fClip = 0;
271  fClipStatus = kFALSE;
272  fCurrentColor = 0;
273  fDXC = 0.;
274  fDYC = 0.;
275  fFX = 0.;
276  fFY = 0.;
277  fGreen = 0.;
278  fIXzone = 0;
279  fIYzone = 0;
280  fLastCellBlue = 0;
281  fLastCellGreen = 0;
282  fLastCellRed = 0;
283  fLineJoin = 0;
284  fLineScale = 0.;
285  fMarkerSizeCur = 0.;
286  fMaxLines = 0;
287  fMaxsize = 0;
288  fMode = 0;
289  fNBSameColorCell = 0;
290  fNXzone = 0;
291  fNYzone = 0;
292  fNbCellLine = 0;
293  fNbCellW = 0;
294  fNbinCT = 0;
295  fNpages = 0;
296  fRange = kFALSE;
297  fRed = 0.;
298  fSave = 0;
299  fX1v = 0.;
300  fX1w = 0.;
301  fX2v = 0.;
302  fX2w = 0.;
303  fXC = 0.;
304  fXVP1 = 0.;
305  fXVP2 = 0.;
306  fXVS1 = 0.;
307  fXVS2 = 0.;
308  fXsize = 0.;
309  fY1v = 0.;
310  fY1w = 0.;
311  fY2v = 0.;
312  fY2w = 0.;
313  fYC = 0.;
314  fYVP1 = 0.;
315  fYVP2 = 0.;
316  fYVS1 = 0.;
317  fYVS2 = 0.;
318  fYsize = 0.;
319  fZone = kFALSE;
320  fFileName = "";
321  fFontEmbed = kFALSE;
322  Int_t i;
323  for (i=0; i<32; i++) fPatterns[i] = 0;
324  for (i=0; i<32; i++) MustEmbed[i] = kFALSE;
325  SetTitle("PS");
326 }
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// Initialize the PostScript interface
330 ///
331 /// - fname : PostScript file name
332 /// - wtype : PostScript workstation type
333 ///
334 ///
335 /// The possible workstation types are:
336 /// - 111 ps Portrait
337 /// - 112 ps Landscape
338 /// - 113 eps
339 
340 TPostScript::TPostScript(const char *fname, Int_t wtype)
341 :TVirtualPS(fname, wtype)
342 {
343  fStream = 0;
344  SetTitle("PS");
345  Open(fname, wtype);
346 }
347 
348 ////////////////////////////////////////////////////////////////////////////////
349 /// Open a PostScript file
350 
351 void TPostScript::Open(const char *fname, Int_t wtype)
352 {
353  if (fStream) {
354  Warning("Open", "postscript file already open");
355  return;
356  }
357 
358  fMarkerSizeCur = 0;
359  fCurrentColor = 0;
360  fRed = -1;
361  fGreen = -1;
362  fBlue = -1;
363  fLenBuffer = 0;
364  fClip = 0;
365  fType = abs(wtype);
366  fClear = kTRUE;
367  fZone = kFALSE;
368  fSave = 0;
369  fFontEmbed = kFALSE;
373  fMode = fType%10;
374  Float_t xrange, yrange;
375  if (gPad) {
376  Double_t ww = gPad->GetWw();
377  Double_t wh = gPad->GetWh();
378  if (fType == 113) {
379  ww *= gPad->GetWNDC();
380  wh *= gPad->GetHNDC();
381  }
382  Double_t ratio = wh/ww;
383  if (fType == 112) {
384  xrange = fYsize;
385  yrange = xrange*ratio;
386  if (yrange > fXsize) { yrange = fXsize; xrange = yrange/ratio;}
387  } else {
388  xrange = fXsize;
389  yrange = fXsize*ratio;
390  if (yrange > fYsize) { yrange = fYsize; xrange = yrange/ratio;}
391  }
392  fXsize = xrange; fYsize = yrange;
393  }
394 
395  // Open OS file
396  fFileName = fname;
397  fStream = new std::ofstream(fFileName.Data(),std::ios::out);
399  printf("ERROR in TPostScript::Open: Cannot open file:%s\n",fFileName.Data());
400  return;
401  }
402  gVirtualPS = this;
403 
404  for (Int_t i=0;i<fSizBuffer;i++) fBuffer[i] = ' ';
405  if( fType == 113) {
407  PrintStr("%!PS-Adobe-2.0 EPSF-2.0@");
408  } else {
410  PrintStr("%!PS-Adobe-2.0@");
411  Initialize();
412  }
413 
415  fRange = kFALSE;
416 
417  // Set a default range
418  Range(fXsize, fYsize);
419 
420  fPrinted = kFALSE;
421  if (fType == 113) NewPage();
422 }
423 
424 ////////////////////////////////////////////////////////////////////////////////
425 /// Default PostScript destructor
426 
428 {
429  Close();
430 }
431 
432 ////////////////////////////////////////////////////////////////////////////////
433 /// Close a PostScript file
434 
436 {
437  if (!gVirtualPS) return;
438  if (!fStream) return;
439  if (gPad) gPad->Update();
440  if( fMode != 3) {
441  SaveRestore(-1);
442  if( fPrinted ) { PrintStr("showpage@"); SaveRestore(-1);}
443  PrintStr("@");
444  PrintStr("%%Trailer@");
445  PrintStr("%%Pages: ");
447  PrintStr("@");
448  while (fSave > 0) { SaveRestore(-1); }
449  } else {
450  PrintStr("@");
451  while (fSave > 0) { SaveRestore(-1); }
452  PrintStr("showpage@");
453  PrintStr("end@");
454  }
455  PrintStr("@");
456  PrintStr("%%EOF@");
457 
458  // Embed the fonts previously used by TMathText
459  if (!fFontEmbed) {
460  // Close the file fFileName
461  if (fStream) {
462  PrintStr("@");
463  fStream->close(); delete fStream; fStream = 0;
464  }
465 
466  // Rename the file fFileName
467  TString tmpname = Form("%s_tmp_%d",fFileName.Data(),gSystem->GetPid());
468  if (gSystem->Rename( fFileName.Data() , tmpname.Data())) {
469  Error("Text", "Cannot open temporary file: %s\n", tmpname.Data());
470  return;
471  }
472 
473  // Reopen the file fFileName
474  fStream = new std::ofstream(fFileName.Data(),std::ios::out);
476  Error("Text", "Cannot open file: %s\n", fFileName.Data());
477  return;
478  }
479 
480  // Embed the fonts at the right place
481  FILE *sg = fopen(tmpname.Data(),"r");
482  if (sg == 0) {
483  Error("Text", "Cannot open file: %s\n", tmpname.Data());
484  return;
485  }
486  char line[255];
487  while (fgets(line,255,sg)) {
488  if (strstr(line,"EndComments")) PrintStr("%%DocumentNeededResources: ProcSet (FontSetInit)@");
489  fStream->write(line,strlen(line));
490  if (!fFontEmbed && strstr(line,"m5")) {
491  FontEmbed();
492  PrintStr("@");
493  }
494  }
495  fclose(sg);
496  if (gSystem->Unlink(tmpname.Data())) return;
497  }
498 
499  fFontEmbed = kFALSE;
500 
501  // Close file stream
502 
503  if (fStream) { fStream->close(); delete fStream; fStream = 0;}
504 
505  gVirtualPS = 0;
506 }
507 
508 ////////////////////////////////////////////////////////////////////////////////
509 /// Activate an already open PostScript file
510 
512 {
513  if (!fType) {
514  Error("On", "no postscript file open");
515  Off();
516  return;
517  }
518  gVirtualPS = this;
519 }
520 
521 ////////////////////////////////////////////////////////////////////////////////
522 /// Deactivate an already open PostScript file
523 
525 {
526  gVirtualPS = 0;
527 }
528 
529 ////////////////////////////////////////////////////////////////////////////////
530 /// Draw a Cell Array
531 ///
532 /// Drawing a PostScript Cell Array is in fact done thanks to three
533 /// procedures: CellArrayBegin, CellArrayFill, and CellArrayEnd.
534 ///
535 /// - CellArrayBegin: Initiate the Cell Array by writing the necessary
536 /// PostScript procedures and the initial values of the
537 /// required parameters. The input parameters are:
538 /// - W: number of boxes along the width.
539 /// - H: number of boxes along the height
540 /// - x1,x2,y1,y2: First box coordinates.
541 /// - CellArrayFill: Is called for each box of the Cell Array. The first
542 /// box is the top left one and the last box is the
543 /// bottom right one. The input parameters are the Red,
544 /// Green, and Blue components of the box colour. These
545 /// Levels are between 0 and 255.
546 /// - CellArrayEnd: Finishes the Cell Array.
547 ///
548 /// PostScript cannot handle arrays larger than 65535. So the Cell Array
549 /// is drawn in several pieces.
550 
552  Double_t y1, Double_t y2)
553 {
554  Int_t ix1 = XtoPS(x1);
555  Int_t iy1 = YtoPS(y1);
556 
557  Float_t wt = (288/2.54)*gPad->GetAbsWNDC()*
558  fXsize*((x2 - x1)/(gPad->GetX2()-gPad->GetX1()));
559  Float_t ht = (288/2.54)*gPad->GetAbsHNDC()*
560  fYsize*((y2 - y1)/(gPad->GetY2()-gPad->GetY1()));
561 
562  fLastCellRed = 300;
563  fLastCellGreen = 300;
564  fLastCellBlue = 300;
565  fNBSameColorCell = 0;
566 
567  fNbinCT = 0;
568  fNbCellW = W;
569  fNbCellLine = 0;
570  fMaxLines = 40000/(3*fNbCellW);
571 
572  // Define some parameters
573  PrintStr("@/WT"); WriteReal(wt) ; PrintStr(" def"); // Cells width
574  PrintStr(" /HT"); WriteReal(ht) ; PrintStr(" def"); // Cells height
575  PrintStr(" /XS"); WriteInteger(ix1) ; PrintStr(" def"); // X start
576  PrintStr(" /YY"); WriteInteger(iy1) ; PrintStr(" def"); // Y start
577  PrintStr(" /NX"); WriteInteger(W) ; PrintStr(" def"); // Number of columns
578  PrintStr(" /NY"); WriteInteger(fMaxLines); PrintStr(" def"); // Number of lines
579 
580  // This PS procedure draws one cell.
581  PrintStr(" /DrawCell ");
582  PrintStr( "{WT HT XX YY bf");
583  PrintStr( " /NBBD NBBD 1 add def");
584  PrintStr( " NBBD NBB eq {exit} if");
585  PrintStr( " /XX WT XX add def");
586  PrintStr( " IX NX eq ");
587  PrintStr( "{/YY YY HT sub def");
588  PrintStr( " /XX XS def");
589  PrintStr( " /IX 0 def} if");
590  PrintStr( " /IX IX 1 add def} def");
591 
592  // This PS procedure draws fMaxLines line. It takes care of duplicated
593  // colors. Values "n" greater than 300 mean than the previous color
594  // should be duplicated n-300 times.
595  PrintStr(" /DrawCT ");
596  PrintStr( "{/NBB NX NY mul def");
597  PrintStr( " /XX XS def");
598  PrintStr( " /IX 1 def");
599  PrintStr( " /NBBD 0 def");
600  PrintStr( " /RC 0 def /GC 1 def /BC 2 def");
601  PrintStr( " 1 1 NBB ");
602  PrintStr( "{/NB CT RC get def");
603  PrintStr( " NB 301 ge ");
604  PrintStr( "{/NBL NB 300 sub def");
605  PrintStr( " 1 1 NBL ");
606  PrintStr( "{DrawCell}");
607  PrintStr( " for");
608  PrintStr( " /RC RC 1 add def");
609  PrintStr( " /GC RC 1 add def");
610  PrintStr( " /BC RC 2 add def}");
611  PrintStr( "{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
612  PrintStr( " DrawCell");
613  PrintStr( " /RC RC 3 add def");
614  PrintStr( " /GC GC 3 add def");
615  PrintStr( " /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
616  PrintStr( " /YY YY HT sub def clear} def");
617 
618  PrintStr(" /CT [");
619 }
620 
621 ////////////////////////////////////////////////////////////////////////////////
622 /// Paint the Cell Array
623 
625 {
626  if (fLastCellRed == r && fLastCellGreen == g && fLastCellBlue == b) {
628  } else {
629  if (fNBSameColorCell != 0 ) {
631  fNBSameColorCell = 0;
632  }
633  WriteInteger(r);
634  WriteInteger(g);
635  WriteInteger(b);
636  fLastCellRed = r;
637  fLastCellGreen = g;
638  fLastCellBlue = b;
639  }
640 
641  fNbinCT++;
642  if (fNbinCT == fNbCellW) {
643  fNbCellLine++;
644  fNbinCT = 0;
645  }
646 
647  if (fNbCellLine == fMaxLines) {
649  PrintStr("] def DrawCT /CT [");
650  fNbCellLine = 0;
651  fLastCellRed = 300;
652  fLastCellGreen = 300;
653  fLastCellBlue = 300;
654  fNBSameColorCell = 0;
655  fNbinCT = 0;
656  }
657 }
658 
659 ////////////////////////////////////////////////////////////////////////////////
660 /// End the Cell Array painting
661 
663 {
665  PrintStr("] def /NY");
667  PrintStr(" def DrawCT ");
668 }
669 
670 ////////////////////////////////////////////////////////////////////////////////
671 /// Define the markers
672 
674 {
675  PrintStr("/mp {newpath /y exch def /x exch def} def@");
676  PrintStr("/side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def@");
677  PrintStr("/mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def@");
678  PrintStr("/mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def@");
679  PrintStr("/mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def@");
680  PrintStr("/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
681  PrintStr("/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
682  PrintStr("/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
683  PrintStr("/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
684  PrintStr(" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
685  PrintStr(" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
686  PrintStr(" 0 w3 neg d w3 neg 0 d cl s } def@");
687  PrintStr("/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
688  PrintStr(" 4 {side} repeat cl fill gr} def@");
689  PrintStr("/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
690  PrintStr(" 4 {side} repeat cl s gr} def@");
691  PrintStr("/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
692  PrintStr(" x w2 sub y w2 add m w w neg d x w2 sub y w2");
693  PrintStr(" sub m w w d s} def@");
694  PrintStr("/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
695  PrintStr("/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
696  PrintStr("/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
697  PrintStr(" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
698  PrintStr(" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
699  PrintStr(" 0 w3 neg d w3 neg 0 d cl f } def@");
700  PrintStr("/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
701  PrintStr("/m5 {mp x w2 sub y w2 sub m w w d x w2 sub y w2 add m w w neg d s} def@");
702 }
703 
704 ////////////////////////////////////////////////////////////////////////////////
705 /// Draw a Box
706 
708 {
709  static Double_t x[4], y[4];
710  Int_t ix1 = XtoPS(x1);
711  Int_t ix2 = XtoPS(x2);
712  Int_t iy1 = YtoPS(y1);
713  Int_t iy2 = YtoPS(y2);
714  Int_t fillis = fFillStyle/1000;
715  Int_t fillsi = fFillStyle%1000;
716 
717  if (fillis == 3 || fillis == 2) {
718  if (fillsi > 99) {
719  x[0] = x1; y[0] = y1;
720  x[1] = x2; y[1] = y1;
721  x[2] = x2; y[2] = y2;
722  x[3] = x1; y[3] = y2;
723  return;
724  }
725  if (fillsi > 0 && fillsi < 26) {
726  x[0] = x1; y[0] = y1;
727  x[1] = x2; y[1] = y1;
728  x[2] = x2; y[2] = y2;
729  x[3] = x1; y[3] = y2;
730  DrawPS(-4, &x[0], &y[0]);
731  }
732  if (fillsi == -3) {
733  SetColor(5);
734  WriteInteger(ix2 - ix1);
735  WriteInteger(iy2 - iy1);
736  WriteInteger(ix1);
737  WriteInteger(iy1);
738  PrintFast(3," bf");
739  }
740  }
741  if (fillis == 1) {
743  WriteInteger(ix2 - ix1);
744  WriteInteger(iy2 - iy1);
745  WriteInteger(ix1);
746  WriteInteger(iy1);
747  PrintFast(3," bf");
748  }
749  if (fillis == 0) {
750  if (fLineWidth<=0) return;
752  WriteInteger(ix2 - ix1);
753  WriteInteger(iy2 - iy1);
754  WriteInteger(ix1);
755  WriteInteger(iy1);
756  PrintFast(3," bl");
757  }
758 }
759 
760 ////////////////////////////////////////////////////////////////////////////////
761 /// Draw a Frame around a box
762 ///
763 /// - mode = -1 box looks as it is behind the screen
764 /// - mode = 1 box looks as it is in front of the screen
765 /// - border is the border size in already precomputed PostScript units
766 /// - dark is the color for the dark part of the frame
767 /// - light is the color for the light part of the frame
768 
770  Int_t mode, Int_t border, Int_t dark, Int_t light)
771 {
772  static Int_t xps[7], yps[7];
773  Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
774 
775  // Draw top&left part of the box
776  if (mode == -1) SetColor(dark);
777  else SetColor(light);
778  Int_t bordPS = 4*border;
779  xps[0] = XtoPS(xl); yps[0] = YtoPS(yl);
780  xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
781  xps[2] = xps[1]; yps[2] = YtoPS(yt) - bordPS;
782  xps[3] = XtoPS(xt) - bordPS; yps[3] = yps[2];
783  xps[4] = XtoPS(xt); yps[4] = YtoPS(yt);
784  xps[5] = xps[0]; yps[5] = yps[4];
785  xps[6] = xps[0]; yps[6] = yps[0];
786 
787  ixd0 = xps[0];
788  iyd0 = yps[0];
789  WriteInteger(ixd0);
790  WriteInteger(iyd0);
791 
792  PrintFast(2," m");
793  idx = 0;
794  idy = 0;
795  for (i=1;i<7;i++) {
796  ixdi = xps[i];
797  iydi = yps[i];
798  ix = ixdi - ixd0;
799  iy = iydi - iyd0;
800  ixd0 = ixdi;
801  iyd0 = iydi;
802  if( ix && iy) {
803  if( idx ) { MovePS(idx,0); idx = 0; }
804  if( idy ) { MovePS(0,idy); idy = 0; }
805  MovePS(ix,iy);
806  continue;
807  }
808  if ( ix ) {
809  if( idy ) { MovePS(0,idy); idy = 0; }
810  if( !idx ) { idx = ix; continue;}
811  if( ix*idx > 0 ) idx += ix;
812  else { MovePS(idx,0); idx = ix; }
813  continue;
814  }
815  if( iy ) {
816  if( idx ) { MovePS(idx,0); idx = 0; }
817  if( !idy) { idy = iy; continue;}
818  if( iy*idy > 0 ) idy += iy;
819  else { MovePS(0,idy); idy = iy; }
820  }
821  }
822  if( idx ) MovePS(idx,0);
823  if( idy ) MovePS(0,idy);
824  PrintFast(2," f");
825 
826  // Draw bottom&right part of the box
827  if (mode == -1) SetColor(light);
828  else SetColor(dark);
829  xps[0] = XtoPS(xl); yps[0] = YtoPS(yl);
830  xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
831  xps[2] = XtoPS(xt) - bordPS; yps[2] = yps[1];
832  xps[3] = xps[2]; yps[3] = YtoPS(yt) - bordPS;
833  xps[4] = XtoPS(xt); yps[4] = YtoPS(yt);
834  xps[5] = xps[4]; yps[5] = yps[0];
835  xps[6] = xps[0]; yps[6] = yps[0];
836 
837  ixd0 = xps[0];
838  iyd0 = yps[0];
839  WriteInteger(ixd0);
840  WriteInteger(iyd0);
841 
842  PrintFast(2," m");
843  idx = 0;
844  idy = 0;
845  for (i=1;i<7;i++) {
846  ixdi = xps[i];
847  iydi = yps[i];
848  ix = ixdi - ixd0;
849  iy = iydi - iyd0;
850  ixd0 = ixdi;
851  iyd0 = iydi;
852  if( ix && iy) {
853  if( idx ) { MovePS(idx,0); idx = 0; }
854  if( idy ) { MovePS(0,idy); idy = 0; }
855  MovePS(ix,iy);
856  continue;
857  }
858  if ( ix ) {
859  if( idy ) { MovePS(0,idy); idy = 0; }
860  if( !idx ) { idx = ix; continue;}
861  if( ix*idx > 0 ) idx += ix;
862  else { MovePS(idx,0); idx = ix; }
863  continue;
864  }
865  if( iy ) {
866  if( idx ) { MovePS(idx,0); idx = 0; }
867  if( !idy) { idy = iy; continue;}
868  if( iy*idy > 0 ) idy += iy;
869  else { MovePS(0,idy); idy = iy; }
870  }
871  }
872  if( idx ) MovePS(idx,0);
873  if( idy ) MovePS(0,idy);
874  PrintFast(2," f");
875 }
876 
877 ////////////////////////////////////////////////////////////////////////////////
878 /// Draw a PolyLine
879 ///
880 /// Draw a polyline through the points xy.
881 /// - If nn=1 moves only to point x,y.
882 /// - If nn=0 the x,y are written in the PostScript file
883 /// according to the current transformation.
884 /// - If nn>0 the line is clipped as a line.
885 /// - If nn<0 the line is clipped as a fill area.
886 
888 {
889  Int_t i, n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
890  Style_t linestylesav = fLineStyle;
891  Width_t linewidthsav = fLineWidth;
892  if (nn > 0) {
893  if (fLineWidth<=0) return;
894  n = nn;
898  } else {
899  n = -nn;
900  SetLineStyle(1);
901  SetLineWidth(1);
903  }
904 
905  ixd0 = XtoPS(xy[0].GetX());
906  iyd0 = YtoPS(xy[0].GetY());
907  WriteInteger(ixd0);
908  WriteInteger(iyd0);
909  if( n <= 1) {
910  if( n == 0) goto END;
911  PrintFast(2," m");
912  goto END;
913  }
914 
915  PrintFast(2," m");
916  idx = 0;
917  idy = 0;
918  for (i=1;i<n;i++) {
919  ixdi = XtoPS(xy[i].GetX());
920  iydi = YtoPS(xy[i].GetY());
921  ix = ixdi - ixd0;
922  iy = iydi - iyd0;
923  ixd0 = ixdi;
924  iyd0 = iydi;
925  if( ix && iy) {
926  if( idx ) { MovePS(idx,0); idx = 0; }
927  if( idy ) { MovePS(0,idy); idy = 0; }
928  MovePS(ix,iy);
929  continue;
930  }
931  if ( ix ) {
932  if( idy ) { MovePS(0,idy); idy = 0; }
933  if( !idx ) { idx = ix; continue;}
934  if( ix*idx > 0 ) idx += ix;
935  else { MovePS(idx,0); idx = ix; }
936  continue;
937  }
938  if( iy ) {
939  if( idx ) { MovePS(idx,0); idx = 0; }
940  if( !idy) { idy = iy; continue;}
941  if( iy*idy > 0 ) idy += iy;
942  else { MovePS(0,idy); idy = iy; }
943  }
944  }
945  if( idx ) MovePS(idx,0);
946  if( idy ) MovePS(0,idy);
947 
948  if (nn > 0 ) {
949  if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY()) PrintFast(3," cl");
950  PrintFast(2," s");
951  } else {
952  PrintFast(2," f");
953  }
954 END:
955  if (nn < 0) {
956  SetLineStyle(linestylesav);
957  SetLineWidth(linewidthsav);
958  }
959 }
960 
961 ////////////////////////////////////////////////////////////////////////////////
962 /// Draw a PolyLine in NDC space
963 ///
964 /// Draw a polyline through the points xy.
965 /// - If nn=1 moves only to point x,y.
966 /// - If nn=0 the x,y are written in the PostScript file
967 /// according to the current transformation.
968 /// - If nn>0 the line is clipped as a line.
969 /// - If nn<0 the line is clipped as a fill area.
970 
972 {
973  Int_t i, n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
974  Style_t linestylesav = fLineStyle;
975  Width_t linewidthsav = fLineWidth;
976  if (nn > 0) {
977  if (fLineWidth<=0) return;
978  n = nn;
982  } else {
983  n = -nn;
984  SetLineStyle(1);
985  SetLineWidth(1);
987  }
988 
989  ixd0 = UtoPS(xy[0].GetX());
990  iyd0 = VtoPS(xy[0].GetY());
991  WriteInteger(ixd0);
992  WriteInteger(iyd0);
993  if( n <= 1) {
994  if( n == 0) goto END;
995  PrintFast(2," m");
996  goto END;
997  }
998 
999  PrintFast(2," m");
1000  idx = 0;
1001  idy = 0;
1002  for (i=1;i<n;i++) {
1003  ixdi = UtoPS(xy[i].GetX());
1004  iydi = VtoPS(xy[i].GetY());
1005  ix = ixdi - ixd0;
1006  iy = iydi - iyd0;
1007  ixd0 = ixdi;
1008  iyd0 = iydi;
1009  if( ix && iy) {
1010  if( idx ) { MovePS(idx,0); idx = 0; }
1011  if( idy ) { MovePS(0,idy); idy = 0; }
1012  MovePS(ix,iy);
1013  continue;
1014  }
1015  if ( ix ) {
1016  if( idy ) { MovePS(0,idy); idy = 0; }
1017  if( !idx ) { idx = ix; continue;}
1018  if( ix*idx > 0 ) idx += ix;
1019  else { MovePS(idx,0); idx = ix; }
1020  continue;
1021  }
1022  if( iy ) {
1023  if( idx ) { MovePS(idx,0); idx = 0; }
1024  if( !idy) { idy = iy; continue;}
1025  if( iy*idy > 0 ) idy += iy;
1026  else { MovePS(0,idy); idy = iy; }
1027  }
1028  }
1029  if( idx ) MovePS(idx,0);
1030  if( idy ) MovePS(0,idy);
1031 
1032  if (nn > 0 ) {
1033  if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY()) PrintFast(3," cl");
1034  PrintFast(2," s");
1035  } else {
1036  PrintFast(2," f");
1037  }
1038 END:
1039  if (nn < 0) {
1040  SetLineStyle(linestylesav);
1041  SetLineWidth(linewidthsav);
1042  }
1043 }
1044 
1045 ////////////////////////////////////////////////////////////////////////////////
1046 /// Draw markers at the n WC points x, y
1047 
1049 {
1050  Int_t i, np, markerstyle;
1051  Float_t markersize;
1052  static char chtemp[10];
1053 
1054  if (!fMarkerSize) return;
1055  Style_t linestylesav = fLineStyle;
1056  Width_t linewidthsav = fLineWidth;
1057  SetLineStyle(1);
1058  SetLineWidth(1);
1060  markerstyle = abs(fMarkerStyle);
1061  if (markerstyle <= 0) strlcpy(chtemp, " m20",10);
1062  if (markerstyle == 1) strlcpy(chtemp, " m20",10);
1063  if (markerstyle == 2) strlcpy(chtemp, " m2",10);
1064  if (markerstyle == 3) strlcpy(chtemp, " m31",10);
1065  if (markerstyle == 4) strlcpy(chtemp, " m24",10);
1066  if (markerstyle == 5) strlcpy(chtemp, " m5",10);
1067  if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp, " m20",10);
1068  if (markerstyle >= 20 && markerstyle <= 34 ) snprintf(chtemp,10," m%d", markerstyle);
1069  if (markerstyle >= 35) strlcpy(chtemp, " m20",10);
1070 
1071  // Set the PostScript marker size
1072  if (markerstyle == 1) {
1073  markersize = 2.;
1074  } else if (markerstyle == 6) {
1075  markersize = 4.;
1076  } else if (markerstyle == 7) {
1077  markersize = 8.;
1078  } else {
1079  Float_t symbolsize = fMarkerSize;
1080  const Int_t kBASEMARKER = 8;
1081  Float_t sbase = symbolsize*kBASEMARKER;
1082  Float_t s2x = sbase / Float_t(gPad->GetWw() * gPad->GetAbsWNDC());
1083  markersize = this->UtoPS(s2x) - this->UtoPS(0);
1084  }
1085 
1086  if (fMarkerSizeCur != markersize) {
1087  fMarkerSizeCur = markersize;
1088  PrintFast(3," /w");
1089  WriteInteger(Int_t(markersize+0.5));
1090  PrintFast(40," def /w2 {w 2 div} def /w3 {w 3 div} def");
1091  }
1092 
1093  WriteInteger(XtoPS(x[0]));
1094  WriteInteger(YtoPS(y[0]));
1095  if (n == 1) {
1096  PrintStr(chtemp);
1097  SetLineStyle(linestylesav);
1098  SetLineWidth(linewidthsav);
1099  return;
1100  }
1101  np = 1;
1102  for (i=1;i<n;i++) {
1103  WriteInteger(XtoPS(x[i]));
1104  WriteInteger(YtoPS(y[i]));
1105  np++;
1106  if (np == 100 || i == n-1) {
1107  WriteInteger(np);
1108  PrintFast(2," {");
1109  PrintStr(chtemp);
1110  PrintFast(3,"} R");
1111  np = 0;
1112  }
1113  }
1114  SetLineStyle(linestylesav);
1115  SetLineWidth(linewidthsav);
1116 }
1117 
1118 ////////////////////////////////////////////////////////////////////////////////
1119 /// Draw markers at the n WC points x, y
1120 
1122 {
1123  Int_t i, np, markerstyle;
1124  Float_t markersize;
1125  static char chtemp[10];
1126 
1127  if (!fMarkerSize) return;
1128  Style_t linestylesav = fLineStyle;
1129  Width_t linewidthsav = fLineWidth;
1130  SetLineStyle(1);
1131  SetLineWidth(1);
1133  markerstyle = abs(fMarkerStyle);
1134  if (markerstyle <= 0) strlcpy(chtemp, " m20",10);
1135  if (markerstyle == 1) strlcpy(chtemp, " m20",10);
1136  if (markerstyle == 2) strlcpy(chtemp, " m2",10);
1137  if (markerstyle == 3) strlcpy(chtemp, " m31",10);
1138  if (markerstyle == 4) strlcpy(chtemp, " m24",10);
1139  if (markerstyle == 5) strlcpy(chtemp, " m5",10);
1140  if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp, " m20",10);
1141  if (markerstyle >= 20 && markerstyle <= 34 ) snprintf(chtemp,10," m%d", markerstyle);
1142  if (markerstyle >= 35) strlcpy(chtemp, " m20",10);
1143 
1144  // Set the PostScript marker size
1145  if (markerstyle == 1) {
1146  markersize = 2.;
1147  } else if (markerstyle == 6) {
1148  markersize = 4.;
1149  } else if (markerstyle == 7) {
1150  markersize = 8.;
1151  } else {
1152  Float_t symbolsize = fMarkerSize;
1153  const Int_t kBASEMARKER = 8;
1154  Float_t sbase = symbolsize*kBASEMARKER;
1155  Float_t s2x = sbase / Float_t(gPad->GetWw() * gPad->GetAbsWNDC());
1156  markersize = this->UtoPS(s2x) - this->UtoPS(0);
1157  }
1158 
1159  if (fMarkerSizeCur != markersize) {
1160  fMarkerSizeCur = markersize;
1161  PrintFast(3," /w");
1162  WriteInteger(Int_t(markersize+0.5));
1163  PrintFast(40," def /w2 {w 2 div} def /w3 {w 3 div} def");
1164  }
1165 
1166  WriteInteger(XtoPS(x[0]));
1167  WriteInteger(YtoPS(y[0]));
1168  if (n == 1) {
1169  PrintStr(chtemp);
1170  SetLineStyle(linestylesav);
1171  SetLineWidth(linewidthsav);
1172  return;
1173  }
1174  np = 1;
1175  for (i=1;i<n;i++) {
1176  WriteInteger(XtoPS(x[i]));
1177  WriteInteger(YtoPS(y[i]));
1178  np++;
1179  if (np == 100 || i == n-1) {
1180  WriteInteger(np);
1181  PrintFast(2," {");
1182  PrintStr(chtemp);
1183  PrintFast(3,"} R");
1184  np = 0;
1185  }
1186  }
1187  SetLineStyle(linestylesav);
1188  SetLineWidth(linewidthsav);
1189 }
1190 
1191 ////////////////////////////////////////////////////////////////////////////////
1192 /// Draw a PolyLine
1193 ///
1194 /// Draw a polyline through the points xw,yw.
1195 /// - If nn=1 moves only to point xw,yw.
1196 /// - If nn=0 the XW(1) and YW(1) are written in the PostScript file
1197 /// according to the current NT.
1198 /// - If nn>0 the line is clipped as a line.
1199 /// - If nn<0 the line is clipped as a fill area.
1200 
1202 {
1203  static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1204  .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1205  .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1206  static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1207  180, 90,135, 45,150, 30,120, 60,
1208  180, 90,135, 45,150, 30,120, 60};
1209  Int_t i, n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1210  fais = fasi = n = 0;
1211  Int_t jxd0 = XtoPS(xw[0]);
1212  Int_t jyd0 = YtoPS(yw[0]);
1213  Style_t linestylesav = fLineStyle;
1214  Width_t linewidthsav = fLineWidth;
1215 
1216  if (nn > 0) {
1217  if (fLineWidth<=0) return;
1218  n = nn;
1222  }
1223  if (nn < 0) {
1224  n = -nn;
1225  SetLineStyle(1);
1226  SetLineWidth(1);
1228  fais = fFillStyle/1000;
1229  fasi = fFillStyle%1000;
1230  if (fais == 3 || fais == 2) {
1231  if (fasi > 100 && fasi <125) {
1232  DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1233  goto END;
1234  }
1235  if (fasi > 0 && fasi < 26) {
1237  }
1238  }
1239  }
1240 
1241  ixd0 = jxd0;
1242  iyd0 = jyd0;
1243  WriteInteger(ixd0);
1244  WriteInteger(iyd0);
1245  if( n <= 1) {
1246  if( n == 0) goto END;
1247  PrintFast(2," m");
1248  goto END;
1249  }
1250 
1251  PrintFast(2," m");
1252  idx = idy = 0;
1253  for (i=1;i<n;i++) {
1254  ixdi = XtoPS(xw[i]);
1255  iydi = YtoPS(yw[i]);
1256  ix = ixdi - ixd0;
1257  iy = iydi - iyd0;
1258  ixd0 = ixdi;
1259  iyd0 = iydi;
1260  if( ix && iy) {
1261  if( idx ) { MovePS(idx,0); idx = 0; }
1262  if( idy ) { MovePS(0,idy); idy = 0; }
1263  MovePS(ix,iy);
1264  } else if ( ix ) {
1265  if( idy ) { MovePS(0,idy); idy = 0;}
1266  if( !idx ) { idx = ix;}
1267  else if( TMath::Sign(ix,idx) == ix ) idx += ix;
1268  else { MovePS(idx,0); idx = ix;}
1269  } else if( iy ) {
1270  if( idx ) { MovePS(idx,0); idx = 0;}
1271  if( !idy) { idy = iy;}
1272  else if( TMath::Sign(iy,idy) == iy) idy += iy;
1273  else { MovePS(0,idy); idy = iy;}
1274  }
1275  }
1276  if (idx) MovePS(idx,0);
1277  if (idy) MovePS(0,idy);
1278 
1279  if (nn > 0 ) {
1280  if (xw[0] == xw[n-1] && yw[0] == yw[n-1]) PrintFast(3," cl");
1281  PrintFast(2," s");
1282  } else {
1283  if (fais == 0) {PrintFast(5," cl s"); goto END;}
1284  if (fais == 3 || fais == 2) {
1285  if (fasi > 0 && fasi < 26) {
1286  PrintFast(3," FA");
1287  fRed = -1;
1288  fGreen = -1;
1289  fBlue = -1;
1290  }
1291  goto END;
1292  }
1293  PrintFast(2," f");
1294  }
1295 END:
1296  if (nn < 0) {
1297  SetLineStyle(linestylesav);
1298  SetLineWidth(linewidthsav);
1299  }
1300 }
1301 
1302 ////////////////////////////////////////////////////////////////////////////////
1303 /// Draw a PolyLine
1304 ///
1305 /// Draw a polyline through the points xw,yw.
1306 /// - If nn=1 moves only to point xw,yw.
1307 /// - If nn=0 the xw(1) and YW(1) are written in the PostScript file
1308 /// --- according to the current NT.
1309 /// - If nn>0 the line is clipped as a line.
1310 /// - If nn<0 the line is clipped as a fill area.
1311 
1313 {
1314  static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1315  .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1316  .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1317  static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1318  180, 90,135, 45,150, 30,120, 60,
1319  180, 90,135, 45,150, 30,120, 60};
1320  Int_t i, n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1321  fais = fasi = n = 0;
1322  Int_t jxd0 = XtoPS(xw[0]);
1323  Int_t jyd0 = YtoPS(yw[0]);
1324  Style_t linestylesav = fLineStyle;
1325  Width_t linewidthsav = fLineWidth;
1326 
1327  if (nn > 0) {
1328  if (fLineWidth<=0) return;
1329  n = nn;
1333  }
1334  if (nn < 0) {
1335  n = -nn;
1336  SetLineStyle(1);
1337  SetLineWidth(1);
1339  fais = fFillStyle/1000;
1340  fasi = fFillStyle%1000;
1341  if (fais == 3 || fais == 2) {
1342  if (fasi > 100 && fasi <125) {
1343  DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1344  goto END;
1345  }
1346  if (fasi > 0 && fasi < 26) {
1348  }
1349  }
1350  }
1351 
1352  ixd0 = jxd0;
1353  iyd0 = jyd0;
1354  WriteInteger(ixd0);
1355  WriteInteger(iyd0);
1356  if( n <= 1) {
1357  if( n == 0) goto END;
1358  PrintFast(2," m");
1359  goto END;
1360  }
1361 
1362  PrintFast(2," m");
1363  idx = idy = 0;
1364  for (i=1;i<n;i++) {
1365  ixdi = XtoPS(xw[i]);
1366  iydi = YtoPS(yw[i]);
1367  ix = ixdi - ixd0;
1368  iy = iydi - iyd0;
1369  ixd0 = ixdi;
1370  iyd0 = iydi;
1371  if( ix && iy) {
1372  if( idx ) { MovePS(idx,0); idx = 0; }
1373  if( idy ) { MovePS(0,idy); idy = 0; }
1374  MovePS(ix,iy);
1375  } else if ( ix ) {
1376  if( idy ) { MovePS(0,idy); idy = 0;}
1377  if( !idx ) { idx = ix;}
1378  else if( TMath::Sign(ix,idx) == ix ) idx += ix;
1379  else { MovePS(idx,0); idx = ix;}
1380  } else if( iy ) {
1381  if( idx ) { MovePS(idx,0); idx = 0;}
1382  if( !idy) { idy = iy;}
1383  else if( TMath::Sign(iy,idy) == iy) idy += iy;
1384  else { MovePS(0,idy); idy = iy;}
1385  }
1386  }
1387  if (idx) MovePS(idx,0);
1388  if (idy) MovePS(0,idy);
1389 
1390  if (nn > 0 ) {
1391  if (xw[0] == xw[n-1] && yw[0] == yw[n-1]) PrintFast(3," cl");
1392  PrintFast(2," s");
1393  } else {
1394  if (fais == 0) {PrintFast(5," cl s"); goto END;}
1395  if (fais == 3 || fais == 2) {
1396  if (fasi > 0 && fasi < 26) {
1397  PrintFast(3," FA");
1398  fRed = -1;
1399  fGreen = -1;
1400  fBlue = -1;
1401  }
1402  goto END;
1403  }
1404  PrintFast(2," f");
1405  }
1406 END:
1407  if (nn < 0) {
1408  SetLineStyle(linestylesav);
1409  SetLineWidth(linewidthsav);
1410  }
1411 }
1412 
1413 ////////////////////////////////////////////////////////////////////////////////
1414 /// Draw Fill area with hatch styles
1415 
1417 {
1418  Warning("DrawHatch", "hatch fill style not yet implemented");
1419 }
1420 
1421 ////////////////////////////////////////////////////////////////////////////////
1422 /// Draw Fill area with hatch styles
1423 
1425 {
1426  Warning("DrawHatch", "hatch fill style not yet implemented");
1427 }
1428 
1429 ////////////////////////////////////////////////////////////////////////////////
1430 
1432 {
1433  std::ifstream font_file(filename, std::ios::binary);
1434 
1435  // We cannot read directly using iostream iterators due to
1436  // signedness
1437  font_file.seekg(0, std::ios::end);
1438 
1439  const size_t font_file_length = font_file.tellg();
1440 
1441  font_file.seekg(0, std::ios::beg);
1442 
1443  std::vector<unsigned char> font_data(font_file_length, '\0');
1444 
1445  font_file.read(reinterpret_cast<char *>(&font_data[0]),
1446  font_file_length);
1447 
1448  std::string font_name;
1449  std::string postscript_string =
1450  mathtext::font_embed_postscript_t::font_embed_type_1(
1451  font_name, font_data);
1452 
1453  if (!postscript_string.empty()) {
1454  PrintRaw(postscript_string.size(), postscript_string.data());
1455  PrintStr("@");
1456 
1457  return true;
1458  }
1459 
1460  return false;
1461 }
1462 
1463 ////////////////////////////////////////////////////////////////////////////////
1464 
1466 {
1467  std::ifstream font_file(filename, std::ios::binary);
1468 
1469  // We cannot read directly using iostream iterators due to
1470  // signedness
1471  font_file.seekg(0, std::ios::end);
1472 
1473  const size_t font_file_length = font_file.tellg();
1474 
1475  font_file.seekg(0, std::ios::beg);
1476 
1477  std::vector<unsigned char> font_data(font_file_length, '\0');
1478 
1479  font_file.read(reinterpret_cast<char *>(&font_data[0]), font_file_length);
1480 
1481  std::string font_name;
1482  std::string postscript_string =
1483  mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1484 
1485  if (!postscript_string.empty()) {
1486  PrintRaw(postscript_string.size(), postscript_string.data());
1487  PrintStr("@");
1488 
1489  return true;
1490  }
1491 
1492  return false;
1493 }
1494 
1495 ////////////////////////////////////////////////////////////////////////////////
1496 
1498 {
1499  std::ifstream font_file(filename, std::ios::binary);
1500 
1501  // We cannot read directly using iostream iterators due to signedness
1502 
1503  font_file.seekg(0, std::ios::end);
1504 
1505  const size_t font_file_length = font_file.tellg();
1506 
1507  font_file.seekg(0, std::ios::beg);
1508 
1509  std::vector<unsigned char> font_data(font_file_length, '\0');
1510 
1511  font_file.read(reinterpret_cast<char *>(&font_data[0]), font_file_length);
1512 
1513  std::string font_name;
1514  std::string postscript_string =
1515  mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1516 
1517  if (!postscript_string.empty()) {
1518  PrintRaw(postscript_string.size(), postscript_string.data());
1519  PrintStr("@");
1520 
1521  return true;
1522  }
1523  fprintf(stderr, "%s:%d:\n", __FILE__, __LINE__);
1524 
1525  return false;
1526 }
1527 
1528 ////////////////////////////////////////////////////////////////////////////////
1529 /// Embed font in PS file.
1530 
1532 {
1533  PrintStr("%%IncludeResource: ProcSet (FontSetInit)@");
1534 
1535  for (Int_t fontid = 1; fontid < 30; fontid++) {
1536  if (fontid != 15 && MustEmbed[fontid-1]) {
1537 
1538  char *ttfont = NULL;
1539 
1540  FcPattern *pat, *match;
1541  FcCharSet *set = NULL;
1542  FcResult result;
1543 
1544  pat = FcPatternCreate ();
1545 
1546  switch (fontid) {
1547  case 1:
1548  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freeserif");
1549  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1550  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1551  break;
1552  case 2:
1553  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freeserif");
1554  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1555  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1556  break;
1557  case 3:
1558  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freeserif");
1559  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1560  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1561  break;
1562  case 4:
1563  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freesans");
1564  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1565  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1566  break;
1567  case 5:
1568  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freesans");
1569  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1570  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1571  break;
1572  case 6:
1573  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freesans");
1574  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1575  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1576  break;
1577  case 7:
1578  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freesans");
1579  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1580  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1581  break;
1582  case 8:
1583  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freemono");
1584  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1585  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1586  break;
1587  case 9:
1588  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freemono");
1589  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1590  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1591  break;
1592  case 10:
1593  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freemono");
1594  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1595  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1596  break;
1597  case 11:
1598  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freemono");
1599  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1600  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1601  break;
1602  case 12:
1603  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"symbol");
1604  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1605  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1606  break;
1607  case 13:
1608  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"freeserif");
1609  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1610  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1611  break;
1612  case 14:
1613  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"dingbats");
1614  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1615  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1616  break;
1617  case 16:
1618  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixgeneral");
1619  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1620  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1621  break;
1622  case 17:
1623  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixgeneral");
1624  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1625  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1626  break;
1627  case 18:
1628  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixgeneral");
1629  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1630  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1631  break;
1632  case 19:
1633  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixgeneral");
1634  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1635  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1636  break;
1637  case 20:
1638  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize1");
1639  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1640  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1641  break;
1642  case 21:
1643  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize1");
1644  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1645  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1646  break;
1647  case 22:
1648  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize2");
1649  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1650  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1651  break;
1652  case 23:
1653  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize2");
1654  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1655  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1656  break;
1657  case 24:
1658  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize3");
1659  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1660  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1661  break;
1662  case 25:
1663  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize3");
1664  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1665  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1666  break;
1667  case 26:
1668  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize4");
1669  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1670  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1671  break;
1672  case 27:
1673  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize4");
1674  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1675  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1676  break;
1677  case 28:
1678  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"stixsize5");
1679  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1680  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1681  break;
1682  case 29:
1683  FcPatternAddString (pat, FC_FAMILY, (const FcChar8*)"droidsansfallback");
1684  FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1685  FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1686  set = FcCharSetCreate ();
1687  FcCharSetAddChar (set, 0x0410); // Cyrillic
1688  FcCharSetAddChar (set, 0x4e00); // CJK
1689  FcPatternAddCharSet (pat, FC_CHARSET, set);
1690  break;
1691  }
1692 
1693  FcConfigSubstitute (NULL, pat, FcMatchPattern);
1694  FcDefaultSubstitute (pat);
1695  match = FcFontMatch (NULL, pat, &result);
1696  char *ttfnt;
1697  FcPatternGetString (match, FC_FILE, 0, (FcChar8**)&ttfnt);
1698  ttfont = StrDup(ttfnt);
1699  FcPatternDestroy (match);
1700  FcPatternDestroy (pat);
1701  if (set) FcCharSetDestroy (set);
1702 
1703  if (!ttfont) {
1704  Error("TPostScript::FontEmbed", "font %d not found in path",
1705  fontid);
1706  } else {
1707  if (FontEmbedType2(ttfont)) {
1708  // nothing
1709  } else if(FontEmbedType1(ttfont)) {
1710  // nothing
1711  } else if(FontEmbedType42(ttfont)) {
1712  // nothing
1713  } else {
1714  Error("TPostScript::FontEmbed", "failed to embed font %d)",
1715  fontid);
1716  }
1717  delete [] ttfont;
1718  }
1719  }
1720  }
1721  PrintStr("%%IncludeResource: font Times-Roman@");
1722  PrintStr("%%IncludeResource: font Times-Italic@");
1723  PrintStr("%%IncludeResource: font Times-Bold@");
1724  PrintStr("%%IncludeResource: font Times-BoldItalic@");
1725  PrintStr("%%IncludeResource: font Helvetica@");
1726  PrintStr("%%IncludeResource: font Helvetica-Oblique@");
1727  PrintStr("%%IncludeResource: font Helvetica-Bold@");
1728  PrintStr("%%IncludeResource: font Helvetica-BoldOblique@");
1729  PrintStr("%%IncludeResource: font Courier@");
1730  PrintStr("%%IncludeResource: font Courier-Oblique@");
1731  PrintStr("%%IncludeResource: font Courier-Bold@");
1732  PrintStr("%%IncludeResource: font Courier-BoldOblique@");
1733  PrintStr("%%IncludeResource: font Symbol@");
1734  PrintStr("%%IncludeResource: font ZapfDingbats@");
1735 
1736  fFontEmbed = kTRUE;
1737 }
1738 
1739 ////////////////////////////////////////////////////////////////////////////////
1740 /// Font Re-encoding
1741 
1743 {
1744  PrintStr("/reEncode ");
1745  PrintStr("{exch findfont");
1746  PrintStr(" dup length dict begin");
1747  PrintStr(" {1 index /FID eq ");
1748  PrintStr(" {pop pop}");
1749  PrintStr(" {def} ifelse");
1750  PrintStr(" } forall");
1751  PrintStr(" /Encoding exch def");
1752  PrintStr(" currentdict end");
1753  PrintStr(" dup /FontName get exch");
1754  PrintStr(" definefont pop");
1755  PrintStr(" } def");
1756  PrintStr(" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1757  PrintStr(" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1758  PrintStr(" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1759  PrintStr(" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1760  PrintStr(" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1761  PrintStr(" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1762  PrintStr(" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1763  PrintStr(" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1764  PrintStr(" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1765  PrintStr(" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1766  PrintStr(" ] {ISOLatin1Encoding reEncode } forall");
1767 }
1768 
1769 ////////////////////////////////////////////////////////////////////////////////
1770 /// PostScript Initialisation
1771 ///
1772 /// This method initialize the following PostScript procedures:
1773 ///
1774 /// | Macro Name | Input parameters | Explanation |
1775 /// |------------|------------------|-----------------------------------|
1776 /// | l | x y | Draw a line to the x y position |
1777 /// | m | x y | Move to the position x y |
1778 /// | box | dx dy x y | Define a box |
1779 /// | bl | dx dy x y | Draw a line box |
1780 /// | bf | dx dy x y | Draw a filled box |
1781 /// | t | x y | Translate |
1782 /// | r | angle | Rotate |
1783 /// | rl | i j | Roll the stack |
1784 /// | d | x y | Draw a relative line to x y |
1785 /// | X | x | Draw a relative line to x (y=0) |
1786 /// | Y | y | Draw a relative line to y (x=0) |
1787 /// | rm | x y | Move relatively to x y |
1788 /// | gr | | Restore the graphic context |
1789 /// | lw | lwidth | Set line width to lwidth |
1790 /// | sd | [] 0 | Set dash line define by [] |
1791 /// | s | | Stroke mode |
1792 /// | c | r g b | Set rgb color to r g b |
1793 /// | cl | | Close path |
1794 /// | f | | Fill the last describe path |
1795 /// | mXX | x y | Draw the marker type XX at (x,y) |
1796 /// | Zone | ix iy | Define the current zone |
1797 /// | black | | The color is black |
1798 /// | C | dx dy x y | Clipping on |
1799 /// | NC | | Clipping off |
1800 /// | R | | repeat |
1801 /// | ita | | Used to make the symbols italic |
1802 /// | K | | kshow |
1803 
1805 {
1806  Double_t rpxmin, rpymin, width, heigth;
1807  rpxmin = rpymin = width = heigth = 0;
1808  Int_t format;
1809  fNpages=1;
1810  for (Int_t i=0;i<32;i++) fPatterns[i]=0;
1811 
1812  // Mode is last digit of PostScript Workstation type
1813  // mode=1,2 for portrait/landscape black and white
1814  // mode=3 for Encapsulated PostScript File
1815  // mode=4 for portrait colour
1816  // mode=5 for lanscape colour
1817  Int_t atype = abs(fType);
1818  fMode = atype%10;
1819  if( fMode <= 0 || fMode > 5) {
1820  Error("Initialize", "invalid file type %d", fMode);
1821  return;
1822  }
1823 
1824  // fNXzone (fNYzone) is the total number of windows in x (y)
1825  fNXzone = (atype%1000)/100;
1826  fNYzone = (atype%100)/10;
1827  if( fNXzone <= 0 ) fNXzone = 1;
1828  if( fNYzone <= 0 ) fNYzone = 1;
1829  fIXzone = 1;
1830  fIYzone = 1;
1831 
1832  // format = 0-99 is the European page format (A4,A3 ...)
1833  // format = 100 is the US format 8.5x11.0 inch
1834  // format = 200 is the US format 8.5x14.0 inch
1835  // format = 300 is the US format 11.0x17.0 inch
1836  format = atype/1000;
1837  if( format == 0 ) format = 4;
1838  if( format == 99 ) format = 0;
1839 
1840  PrintStr("%%Title: ");
1841  const char *pstitle = gStyle->GetTitlePS();
1842  if (gPad && !pstitle[0]) pstitle = gPad->GetMother()->GetTitle();
1843  if (strlen(GetName())<=80) PrintStr(GetName());
1844  if(!pstitle[0] && fMode != 3) {;
1845  PrintFast(2," (");
1846  if ( format <= 99 ) {;
1847  PrintFast(2," A");
1848  WriteInteger(format);
1849  PrintFast(1,")");
1850  }
1851  else {
1852  if ( format == 100 ) PrintFast(8," Letter)");
1853  if ( format == 200 ) PrintFast(7," Legal)");
1854  if ( format == 300 ) PrintFast(8," Ledger)");
1855  }
1856  PrintStr("@");
1857  PrintStr("%%Pages: (atend)@");
1858  }
1859  else {
1860  if (!strchr(pstitle,'\n')) {
1861  PrintFast(2,": ");
1862  PrintStr(pstitle);
1863  }
1864  PrintStr("@");
1865  }
1866 
1867  PrintFast(24,"%%Creator: ROOT Version ");
1868  PrintStr(gROOT->GetVersion());
1869  PrintStr("@");
1870  PrintFast(16,"%%CreationDate: ");
1871  TDatime t;
1872  PrintStr(t.AsString());
1873  PrintStr("@");
1874 
1875  if ( fMode == 1 || fMode == 4) PrintStr("%%Orientation: Portrait@");
1876  if ( fMode == 2 || fMode == 5) PrintStr("%%Orientation: Landscape@");
1877 
1878  PrintStr("%%EndComments@");
1879  PrintStr("%%BeginProlog@");
1880 
1881  if( fMode == 3)PrintStr("80 dict begin@");
1882 
1883  // Initialisation of PostScript procedures
1884  PrintStr("/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1885  PrintStr("/r {rotate} def /rl {roll} def /R {repeat} def@");
1886  PrintStr("/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1887  if (gStyle->GetColorModelPS()) {
1888  PrintStr("/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1889  } else {
1890  PrintStr("/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1891  }
1892  PrintStr("/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1893  PrintStr("/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1894  PrintStr("/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1895  PrintStr("/bl {box s} def /bf {gsave box gsave f grestore 1 lw [] 0 sd s grestore} def /Y { 0 exch d} def /X { 0 d} def @");
1896  PrintStr("/K {{pop pop 0 moveto} exch kshow} bind def@");
1897  PrintStr("/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1898 
1899  DefineMarkers();
1900 
1901  FontEncode();
1902 
1903  // mode=1 for portrait black/white
1904  if (fMode == 1) {
1905  rpxmin = 0.7;
1906  rpymin = TMath::Sqrt(2.)*rpxmin;
1907  switch (format) {
1908  case 100 :
1909  width = (8.5*2.54)-2.*rpxmin;
1910  heigth = (11.*2.54)-2.*rpymin;
1911  break;
1912  case 200 :
1913  width = (8.5*2.54)-2.*rpxmin;
1914  heigth = (14.*2.54)-2.*rpymin;
1915  break;
1916  case 300 :
1917  width = (11.*2.54)-2.*rpxmin;
1918  heigth = (17.*2.54)-2.*rpymin;
1919  break;
1920  default :
1921  width = 21.0-2.*rpxmin;
1922  heigth = 29.7-2.*rpymin;
1923  };
1924  }
1925 
1926  // mode=2 for landscape black/white
1927  if (fMode == 2) {
1928  rpymin = 0.7;
1929  rpxmin = TMath::Sqrt(2.)*rpymin;
1930  switch (format) {
1931  case 100 :
1932  width = (11.*2.54)-2.*rpxmin;
1933  heigth = (8.5*2.54)-2.*rpymin;
1934  break;
1935  case 200 :
1936  width = (14.*2.54)-2.*rpxmin;
1937  heigth = (8.5*2.54)-2.*rpymin;
1938  break;
1939  case 300 :
1940  width = (17.*2.54)-2.*rpxmin;
1941  heigth = (11.*2.54)-2.*rpymin;
1942  break;
1943  default :
1944  width = 29.7-2.*rpxmin;
1945  heigth = 21-2.*rpymin;
1946  };
1947  }
1948 
1949  // mode=3 encapsulated PostScript
1950  if (fMode == 3) {
1951  width = 20;
1952  heigth = 20;
1953  format = 4;
1954  fNXzone = 1;
1955  fNYzone = 1;
1956  }
1957 
1958  // mode=4 for portrait colour
1959  if (fMode == 4) {
1960  rpxmin = 0.7;
1961  rpymin = 3.4;
1962  switch (format) {
1963  case 100 :
1964  width = (8.5*2.54)-2.*rpxmin;
1965  heigth = (11.*2.54)-2.*rpymin;
1966  break;
1967  case 200 :
1968  width = (8.5*2.54)-2.*rpxmin;
1969  heigth = (14.*2.54)-2.*rpymin;
1970  break;
1971  case 300 :
1972  width = (11.*2.54)-2.*rpxmin;
1973  heigth = (17.*2.54)-2.*rpymin;
1974  break;
1975  default :
1976  width = (21.0-2*rpxmin);
1977  heigth = (29.7-2.*rpymin);
1978  };
1979  }
1980 
1981  // mode=5 for lanscape colour
1982  if (fMode == 5) {
1983  rpxmin = 3.4;
1984  rpymin = 0.7;
1985  switch (format) {
1986  case 100 :
1987  width = (11.*2.54)-2.*rpxmin;
1988  heigth = (8.5*2.54)-2.*rpymin;
1989  break;
1990  case 200 :
1991  width = (14.*2.54)-2.*rpxmin;
1992  heigth = (8.5*2.54)-2.*rpymin;
1993  break;
1994  case 300 :
1995  width = (17.*2.54)-2.*rpxmin;
1996  heigth = (11.*2.54)-2.*rpymin;
1997  break;
1998  default :
1999  width = (29.7-2*rpxmin);
2000  heigth = (21-2.*rpymin);
2001  };
2002  }
2003 
2004  Double_t value = 0;
2005  if (format < 100) value = 21*TMath::Power(TMath::Sqrt(2.), 4-format);
2006  else if (format == 100) value = 8.5*2.54;
2007  else if (format == 200) value = 8.5*2.54;
2008  else if (format == 300) value = 11.*2.54;
2009  if (format >= 100) format = 4;
2010 
2011  // Compute size (in points) of the window for each picture = f(fNXzone,fNYzone)
2012  Double_t sizex = width/Double_t(fNXzone)*TMath::Power(TMath::Sqrt(2.), 4-format);
2013  Double_t sizey = heigth/Double_t(fNYzone)*TMath::Power(TMath::Sqrt(2.), 4-format);
2014  Int_t npx = 4*CMtoPS(sizex);
2015  Int_t npy = 4*CMtoPS(sizey);
2016  if (sizex > sizey) fMaxsize = CMtoPS(sizex);
2017  else fMaxsize = CMtoPS(sizey);
2018 
2019  // Procedure Zone
2020  if (fMode != 3) {
2021  PrintFast(33,"/Zone {/iy exch def /ix exch def ");
2022  PrintFast(10," ix 1 sub ");
2023  WriteInteger(npx);
2024  PrintFast(5," mul ");
2026  PrintFast(8," iy sub ");
2027  WriteInteger(npy);
2028  PrintStr(" mul t} def@");
2029  } else {
2030  PrintStr("@");
2031  }
2032 
2033  PrintStr("%%EndProlog@");
2034  PrintStr("%%BeginSetup@");
2035  PrintStr("%%EndSetup@");
2036  PrintFast(8,"newpath ");
2037  SaveRestore(1);
2038  if (fMode == 1 || fMode == 4) {
2039  WriteInteger(CMtoPS(rpxmin));
2040  WriteInteger(CMtoPS(rpymin));
2041  PrintFast(2," t");
2042  }
2043  if (fMode == 2 || fMode == 5) {
2044  PrintFast(7," 90 r 0");
2045  WriteInteger(CMtoPS(-value));
2046  PrintFast(3," t ");
2047  WriteInteger(CMtoPS(rpxmin));
2048  WriteInteger(CMtoPS(rpymin));
2049  PrintFast(2," t");
2050  }
2051 
2052  PrintFast(15," .25 .25 scale ");
2053  if (fMode != 3) {
2054  SaveRestore(1);
2055  PrintStr("@");
2056  PrintStr("%%Page: 1 1@");
2057  SaveRestore(1);
2058  }
2059 
2060  //Check is user has defined a special header in the current style
2061  Int_t nh = strlen(gStyle->GetHeaderPS());
2062  if (nh) {
2063  PrintFast(nh,gStyle->GetHeaderPS());
2064  if (fMode != 3) SaveRestore(1);
2065  }
2066 }
2067 
2068 ////////////////////////////////////////////////////////////////////////////////
2069 /// Move to a new position
2070 
2072 {
2073  if (ix != 0 && iy != 0) {
2074  WriteInteger(ix);
2075  WriteInteger(iy);
2076  PrintFast(2," d");
2077  } else if (ix != 0) {
2078  WriteInteger(ix);
2079  PrintFast(2," X");
2080  } else if (iy != 0) {
2081  WriteInteger(iy);
2082  PrintFast(2," Y");
2083  }
2084 }
2085 
2086 ////////////////////////////////////////////////////////////////////////////////
2087 /// Move to a new PostScript page
2088 
2090 {
2091  // Compute pad conversion coefficients
2092  if (gPad) {
2093  // if (!gPad->GetPadPaint()) gPad->Update();
2094  Double_t ww = gPad->GetWw();
2095  Double_t wh = gPad->GetWh();
2096  fYsize = fXsize*wh/ww;
2097  } else fYsize = 27;
2098 
2099  if(fType == 113 && !fBoundingBox) {
2100  Bool_t psave = fPrinted;
2101  PrintStr("@%%BoundingBox: ");
2102  Double_t xlow=0, ylow=0, xup=1, yup=1;
2103  if (gPad) {
2104  xlow = gPad->GetAbsXlowNDC();
2105  xup = xlow + gPad->GetAbsWNDC();
2106  ylow = gPad->GetAbsYlowNDC();
2107  yup = ylow + gPad->GetAbsHNDC();
2108  }
2109  WriteInteger(CMtoPS(fXsize*xlow));
2110  WriteInteger(CMtoPS(fYsize*ylow));
2111  WriteInteger(CMtoPS(fXsize*xup));
2112  WriteInteger(CMtoPS(fYsize*yup));
2113  PrintStr("@");
2114  Initialize();
2115  fBoundingBox = kTRUE;
2116  fPrinted = psave;
2117  }
2118  if (fPrinted) {
2119  if (fSave) SaveRestore(-1);
2120  fClear = kTRUE;
2121  fPrinted = kFALSE;
2122  }
2123  Zone();
2124 }
2125 
2126 ////////////////////////////////////////////////////////////////////////////////
2127 /// Set the range for the paper in centimeters
2128 
2130 {
2131  Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2132 
2133  fXsize = xsize;
2134  fYsize = ysize;
2135  if( fType != 113) { xps = fXsize; yps = fYsize; }
2136  else { xps = xsize; yps = ysize; }
2137 
2138  if( xsize <= xps && ysize < yps) {
2139  if ( xps > yps ) xymax = xps;
2140  else xymax = yps;
2141  xncm = xsize/xymax;
2142  yncm = ysize/xymax;
2143  dxwn = ((xps/xymax)-xncm)/2;
2144  dywn = ((yps/xymax)-yncm)/2;
2145  } else {
2146  if (xps/yps < 1) xwkwn = xps/yps;
2147  else xwkwn = 1;
2148  if (yps/xps < 1) ywkwn = yps/xps;
2149  else ywkwn = 1;
2150 
2151  if (xsize < ysize) {
2152  xncm = ywkwn*xsize/ysize;
2153  yncm = ywkwn;
2154  dxwn = (xwkwn-xncm)/2;
2155  dywn = 0;
2156  if( dxwn < 0) {
2157  xncm = xwkwn;
2158  dxwn = 0;
2159  yncm = xwkwn*ysize/xsize;
2160  dywn = (ywkwn-yncm)/2;
2161  }
2162  } else {
2163  xncm = xwkwn;
2164  yncm = xwkwn*ysize/xsize;
2165  dxwn = 0;
2166  dywn = (ywkwn-yncm)/2;
2167  if( dywn < 0) {
2168  yncm = ywkwn;
2169  dywn = 0;
2170  xncm = ywkwn*xsize/ysize;
2171  dxwn = (xwkwn-xncm)/2;
2172  }
2173  }
2174  }
2175  fXVP1 = dxwn;
2176  fXVP2 = xncm+dxwn;
2177  fYVP1 = dywn;
2178  fYVP2 = yncm+dywn;
2179  fRange = kTRUE;
2180 }
2181 
2182 ////////////////////////////////////////////////////////////////////////////////
2183 /// Compute number of gsaves for restore
2184 /// This allows to write the correct number of grestore at the
2185 /// end of the PS file.
2186 
2188 {
2189  if (flag == 1) { PrintFast(7," gsave "); fSave++; }
2190  else { PrintFast(4," gr "); fSave--; }
2191 }
2192 
2193 ////////////////////////////////////////////////////////////////////////////////
2194 /// Set color index for fill areas
2195 
2197 {
2198  fFillColor = cindex;
2199  if (gStyle->GetFillColor() <= 0) cindex = 0;
2200  SetColor(Int_t(cindex));
2201 }
2202 
2203 ////////////////////////////////////////////////////////////////////////////////
2204 /// Patterns definition
2205 ///
2206 /// Define the pattern ipat in the current PS file. ipat can vary from
2207 /// 1 to 25. Together with the pattern, the color (color) in which the
2208 /// pattern has to be drawn is also required. A pattern is defined in the
2209 /// current PS file only the first time it is used. Some level 2
2210 /// Postscript functions are used, so on level 1 printers, patterns will
2211 /// not work. This is not a big problem because patterns are
2212 /// defined only if they are used, so if they are not used a PS level 1
2213 /// file will not be polluted by level 2 features, and in any case the old
2214 /// patterns used a lot of memory which made them almost unusable on old
2215 /// level 1 printers. Finally we should say that level 1 devices are
2216 /// becoming very rare. The official PostScript is now level 3 !
2217 
2219 {
2220  char cdef[28];
2221  char cpat[5];
2222  snprintf(cpat,5," P%2.2d", ipat);
2223 
2224  // fPatterns is used as an array of chars. If fPatterns[ipat] != 0 the
2225  // pattern number ipat as already be defined is this file and it
2226  // is not necessary to redefine it. fPatterns is set to zero in Initialize.
2227  // The pattern number 26 allows to know if the macro "cs" has already
2228  // been defined in the current file (see label 200).
2229  if (fPatterns[ipat] == 0) {
2230 
2231  // Define the Patterns. Line width must be 1
2232  // Setting fLineWidth to -1 will force the line width definition next time
2233  // TPostScript::SetLineWidth will be called.
2234  fLineWidth = -1;
2235  PrintFast(5," 1 lw");
2236  PrintStr(" << /PatternType 1 /PaintType 2 /TilingType 1");
2237  switch (ipat) {
2238  case 1 :
2239  PrintStr(" /BBox [ 0 0 98 4 ]");
2240  PrintStr(" /XStep 98 /YStep 4");
2241  PrintStr(" /PaintProc { begin gsave");
2242  PrintStr(" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2243  PrintStr(" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2244  PrintStr(" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2245  break;
2246  case 2 :
2247  PrintStr(" /BBox [ 0 0 96 4 ]");
2248  PrintStr(" /XStep 96 /YStep 4");
2249  PrintStr(" /PaintProc { begin gsave");
2250  PrintStr(" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2251  PrintStr(" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2252  PrintStr(" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2253  break;
2254  case 3 :
2255  PrintStr(" /BBox [ 0 0 96 16 ]");
2256  PrintStr(" /XStep 96 /YStep 16");
2257  PrintStr(" /PaintProc { begin gsave");
2258  PrintStr(" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2259  PrintStr(" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2260  PrintStr(" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2261  break;
2262  case 4 :
2263  PrintStr(" /BBox [ 0 0 100 100 ]");
2264  PrintStr(" /XStep 100 /YStep 100");
2265  PrintStr(" /PaintProc { begin gsave");
2266  PrintStr(" 0 0 m 100 100 l s");
2267  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2268  break;
2269  case 5 :
2270  PrintStr(" /BBox [ 0 0 100 100 ]");
2271  PrintStr(" /XStep 100 /YStep 100");
2272  PrintStr(" /PaintProc { begin gsave");
2273  PrintStr(" 0 100 m 100 0 l s");
2274  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2275  break;
2276  case 6 :
2277  PrintStr(" /BBox [ 0 0 100 100 ]");
2278  PrintStr(" /XStep 100 /YStep 100");
2279  PrintStr(" /PaintProc { begin gsave");
2280  PrintStr(" 50 0 m 50 100 l s");
2281  PrintStr(" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2282  break;
2283  case 7 :
2284  PrintStr(" /BBox [ 0 0 100 100 ]");
2285  PrintStr(" /XStep 100 /YStep 100");
2286  PrintStr(" /PaintProc { begin gsave");
2287  PrintStr(" 0 50 m 100 50 l s");
2288  PrintStr(" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2289  break;
2290  case 8 :
2291  PrintStr(" /BBox [ 0 0 101 101 ]");
2292  PrintStr(" /XStep 100 /YStep 100");
2293  PrintStr(" /PaintProc { begin gsave");
2294  PrintStr(" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2295  PrintStr(" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2296  PrintStr(" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2297  PrintStr(" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2298  PrintStr(" 70 0 l s 80 50 m 100 70 l s");
2299  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2300  break;
2301  case 9 :
2302  PrintStr(" /BBox [ 0 0 100 100 ]");
2303  PrintStr(" /XStep 100 /YStep 100");
2304  PrintStr(" /PaintProc { begin gsave");
2305  PrintStr(" 0 50 m 50 50 50 180 360 arc");
2306  PrintStr(" 0 50 m 0 100 50 270 360 arc");
2307  PrintStr(" 50 100 m 100 100 50 180 270 arc s");
2308  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2309  break;
2310  case 10 :
2311  PrintStr(" /BBox [ 0 0 100 100 ]");
2312  PrintStr(" /XStep 100 /YStep 100");
2313  PrintStr(" /PaintProc { begin gsave");
2314  PrintStr(" 0 50 m 100 50 l 1 1 m 100 1 l");
2315  PrintStr(" 0 0 m 0 50 l 100 0 m 100 50 l");
2316  PrintStr(" 50 50 m 50 100 l s");
2317  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2318  break;
2319  case 11 :
2320  PrintStr(" /BBox [ 0 0 100 100 ]");
2321  PrintStr(" /XStep 100 /YStep 100");
2322  PrintStr(" /PaintProc { begin gsave");
2323  PrintStr(" 0 0 m 0 20 l 50 0 m 50 20 l");
2324  PrintStr(" 100 0 m 100 20 l 0 80 m 0 100 l");
2325  PrintStr(" 50 80 m 50 100 l 100 80 m 100 100 l");
2326  PrintStr(" 25 30 m 25 70 l 75 30 m 75 70 l");
2327  PrintStr(" 0 100 m 20 85 l 50 100 m 30 85 l");
2328  PrintStr(" 50 100 m 70 85 l 100 100 m 80 85 l");
2329  PrintStr(" 0 0 m 20 15 l 50 0 m 30 15 l");
2330  PrintStr(" 50 0 m 70 15 l 100 0 m 80 15 l");
2331  PrintStr(" 5 35 m 45 65 l 5 65 m 45 35 l");
2332  PrintStr(" 55 35 m 95 65 l 55 65 m 95 35 l s");
2333  PrintStr(" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2334  break;
2335  case 12 :
2336  PrintStr(" /BBox [ 0 0 100 100 ]");
2337  PrintStr(" /XStep 100 /YStep 100");
2338  PrintStr(" /PaintProc { begin gsave");
2339  PrintStr(" 0 80 m 0 100 20 270 360 arc");
2340  PrintStr(" 30 100 m 50 100 20 180 360 arc");
2341  PrintStr(" 80 100 m 100 100 20 180 270 arc");
2342  PrintStr(" 20 0 m 0 0 20 0 90 arc");
2343  PrintStr(" 70 0 m 50 0 20 0 180 arc");
2344  PrintStr(" 100 20 m 100 0 20 90 180 arc");
2345  PrintStr(" 45 50 m 25 50 20 0 360 arc");
2346  PrintStr(" 95 50 m 75 50 20 0 360 arc s");
2347  PrintStr(" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2348  break;
2349  case 13 :
2350  PrintStr(" /BBox [ 0 0 100 100 ]");
2351  PrintStr(" /XStep 100 /YStep 100");
2352  PrintStr(" /PaintProc { begin gsave");
2353  PrintStr(" 0 0 m 100 100 l 0 100 m 100 0 l s");
2354  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2355  break;
2356  case 14 :
2357  PrintStr(" /BBox [ 0 0 100 100 ]");
2358  PrintStr(" /XStep 80 /YStep 80");
2359  PrintStr(" /PaintProc { begin gsave");
2360  PrintStr(" 0 20 m 100 20 l 20 0 m 20 100 l");
2361  PrintStr(" 0 80 m 100 80 l 80 0 m 80 100 l");
2362  PrintStr(" 20 40 m 60 40 l 60 20 m 60 60 l");
2363  PrintStr(" 40 40 m 40 80 l 40 60 m 80 60 l s");
2364  PrintStr(" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2365  break;
2366  case 15 :
2367  PrintStr(" /BBox [ 0 0 60 60 ]");
2368  PrintStr(" /XStep 60 /YStep 60");
2369  PrintStr(" /PaintProc { begin gsave");
2370  PrintStr(" 0 55 m 0 60 5 270 360 arc");
2371  PrintStr(" 25 60 m 30 60 5 180 360 arc");
2372  PrintStr(" 55 60 m 60 60 5 180 270 arc");
2373  PrintStr(" 20 30 m 15 30 5 0 360 arc");
2374  PrintStr(" 50 30 m 45 30 5 0 360");
2375  PrintStr(" arc 5 0 m 0 0 5 0 90 arc");
2376  PrintStr(" 35 0 m 30 0 5 0 180 arc");
2377  PrintStr(" 60 5 m 60 0 5 90 180 arc s");
2378  PrintStr(" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2379  break;
2380  case 16 :
2381  PrintStr(" /BBox [ 0 0 100 100 ]");
2382  PrintStr(" /XStep 100 /YStep 100");
2383  PrintStr(" /PaintProc { begin gsave");
2384  PrintStr(" 50 50 m 25 50 25 0 180 arc s");
2385  PrintStr(" 50 50 m 75 50 25 180 360 arc s");
2386  PrintStr(" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2387  break;
2388  case 17 :
2389  PrintStr(" /BBox [ 0 0 100 100 ]");
2390  PrintStr(" /XStep 100 /YStep 100");
2391  PrintStr(" /PaintProc { begin gsave");
2392  PrintStr(" [24] 0 setdash 0 0 m 100 100 l s");
2393  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2394  break;
2395  case 18 :
2396  PrintStr(" /BBox [ 0 0 100 100 ]");
2397  PrintStr(" /XStep 100 /YStep 100");
2398  PrintStr(" /PaintProc { begin gsave");
2399  PrintStr(" [24] 0 setdash 0 100 m 100 0 l s");
2400  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2401  break;
2402  case 19 :
2403  PrintStr(" /BBox [ 0 0 100 100 ]");
2404  PrintStr(" /XStep 100 /YStep 100");
2405  PrintStr(" /PaintProc { begin gsave");
2406  PrintStr(" 90 50 m 50 50 40 0 360 arc");
2407  PrintStr(" 0 50 m 0 100 50 270 360 arc");
2408  PrintStr(" 50 0 m 0 0 50 0 90 arc");
2409  PrintStr(" 100 50 m 100 0 50 90 180 arc");
2410  PrintStr(" 50 100 m 100 100 50 180 270 arc s");
2411  PrintStr(" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2412  break;
2413  case 20 :
2414  PrintStr(" /BBox [ 0 0 100 100 ]");
2415  PrintStr(" /XStep 100 /YStep 100");
2416  PrintStr(" /PaintProc { begin gsave");
2417  PrintStr(" 50 50 m 50 75 25 270 450 arc s");
2418  PrintStr(" 50 50 m 50 25 25 90 270 arc s");
2419  PrintStr(" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2420  break;
2421  case 21 :
2422  PrintStr(" /BBox [ 0 0 101 101 ]");
2423  PrintStr(" /XStep 100 /YStep 100");
2424  PrintStr(" /PaintProc { begin gsave");
2425  PrintStr(" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2426  PrintStr(" 75 50 l 75 75 l 100 75 l 100 100 l");
2427  PrintStr(" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2428  PrintStr(" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2429  PrintStr(" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2430  break;
2431  case 22 :
2432  PrintStr(" /BBox [ 0 0 101 101 ]");
2433  PrintStr(" /XStep 100 /YStep 100");
2434  PrintStr(" /PaintProc { begin gsave");
2435  PrintStr(" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2436  PrintStr(" 75 50 l 75 25 l 100 25 l 100 1 l");
2437  PrintStr(" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2438  PrintStr(" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2439  PrintStr(" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2440  break;
2441  case 23 :
2442  PrintStr(" /BBox [ 0 0 100 100 ]");
2443  PrintStr(" /XStep 100 /YStep 100");
2444  PrintStr(" /PaintProc { begin gsave");
2445  PrintStr(" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2446  PrintStr(" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2447  PrintStr(" add l s } for 100 0 m 100 100 l 50 50 l f");
2448  PrintStr(" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2449  break;
2450  case 24 :
2451  PrintStr(" /BBox [ 0 0 100 100 ]");
2452  PrintStr(" /XStep 100 /YStep 100");
2453  PrintStr(" /PaintProc { begin gsave");
2454  PrintStr(" 100 100 m 100 36 l 88 36 l 88 88 l f");
2455  PrintStr(" 100 0 m 100 12 l 56 12 l 50 0 l f");
2456  PrintStr(" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2457  PrintStr(" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2458  PrintStr(" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2459  PrintStr(" 16 exch 4 sub m 88 exch 4 sub l s } for");
2460  PrintStr(" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2461  PrintStr(" 4 exch 4 sub m 36 exch 4 sub l s } for");
2462  PrintStr(" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2463  PrintStr(" 16 exch 4 sub m 36 exch 4 sub l s } for");
2464  PrintStr(" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2465  PrintStr(" 60 exch 4 sub m 100 exch 4 sub l s } for");
2466  PrintStr(" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2467  break;
2468  case 25 :
2469  PrintStr(" /BBox [ 0 0 101 101 ]");
2470  PrintStr(" /XStep 100 /YStep 100");
2471  PrintStr(" /PaintProc { begin gsave");
2472  PrintStr(" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2473  PrintStr(" f 30 30 m 30 70 l 70 70 l f");
2474  PrintStr(" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2475  };
2476  snprintf(cdef,28," makepattern /%s exch def",&cpat[1]);
2477  PrintStr(cdef);
2478  fPatterns[ipat] = 1;
2479  }
2480 
2481  // Define the macro cs and FA if they are not yet defined.
2482  if (fPatterns[26] == 0) {
2483  if (gStyle->GetColorModelPS()) {
2484  PrintStr(" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2485  PrintStr(" /FA {f [/DeviceCMYK] setcolorspace} def");
2486  } else {
2487  PrintStr(" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2488  PrintStr(" /FA {f [/DeviceRGB] setcolorspace} def");
2489  }
2490  fPatterns[26] = 1;
2491  }
2492 
2493  // Activate the pattern.
2494  PrintFast(3," cs");
2495  TColor *col = gROOT->GetColor(color);
2496  if (col) {
2497  Double_t colRed = col->GetRed();
2498  Double_t colGreen = col->GetGreen();
2499  Double_t colBlue = col->GetBlue();
2500  if (gStyle->GetColorModelPS()) {
2501  Double_t colBlack = TMath::Min(TMath::Min(1-colRed,1-colGreen),1-colBlue);
2502  if (colBlack==1) {
2503  WriteReal(0);
2504  WriteReal(0);
2505  WriteReal(0);
2506  WriteReal(colBlack);
2507  } else {
2508  Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2509  Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2510  Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2511  WriteReal(colCyan);
2512  WriteReal(colMagenta);
2513  WriteReal(colYellow);
2514  WriteReal(colBlack);
2515  }
2516  } else {
2517  WriteReal(colRed);
2518  WriteReal(colGreen);
2519  WriteReal(colBlue);
2520  }
2521  }
2522  PrintFast(4,cpat);
2523  PrintFast(9," setcolor");
2524 }
2525 
2526 ////////////////////////////////////////////////////////////////////////////////
2527 /// Set color index for lines
2528 
2530 {
2531  fLineColor = cindex;
2532  SetColor(Int_t(cindex));
2533 }
2534 
2535 ////////////////////////////////////////////////////////////////////////////////
2536 /// Set the value of the global parameter TPostScript::fgLineJoin.
2537 /// This parameter determines the appearance of joining lines in a PostScript
2538 /// output.
2539 /// It takes one argument which may be:
2540 /// - 0 (miter join)
2541 /// - 1 (round join)
2542 /// - 2 (bevel join)
2543 /// The default value is 0 (miter join).
2544 ///
2545 /// \image html postscript_1.png
2546 ///
2547 /// To change the line join behaviour just do:
2548 /// ~~~ {.cpp}
2549 /// gStyle->SetLineJoinPS(2); // Set the PS line join to bevel.
2550 /// ~~~
2551 
2553 {
2554  fgLineJoin = linejoin;
2555  if (fgLineJoin<0) fgLineJoin=0;
2556  if (fgLineJoin>2) fgLineJoin=2;
2557 }
2558 
2559 ////////////////////////////////////////////////////////////////////////////////
2560 /// Change the line style
2561 ///
2562 /// - linestyle = 2 dashed
2563 /// - linestyle = 3 dotted
2564 /// - linestyle = 4 dash-dotted
2565 /// - linestyle = else = solid
2566 ///
2567 /// See TStyle::SetLineStyleString for style definition
2568 
2570 {
2571  if ( linestyle == fLineStyle) return;
2572  fLineStyle = linestyle;
2573  const char *st = gStyle->GetLineStyleString(linestyle);
2574  PrintFast(1,"[");
2575  Int_t nch = strlen(st);
2576  PrintFast(nch,st);
2577  PrintFast(6,"] 0 sd");
2578 }
2579 
2580 ////////////////////////////////////////////////////////////////////////////////
2581 /// Change the line width
2582 
2584 {
2585  if ( linewidth == fLineWidth) return;
2586  fLineWidth = linewidth;
2587  if (fLineWidth!=0) {
2589  PrintFast(3," lw");
2590  }
2591 }
2592 
2593 ////////////////////////////////////////////////////////////////////////////////
2594 /// Set color index for markers
2595 
2597 {
2598  fMarkerColor = cindex;
2599  SetColor(Int_t(cindex));
2600 }
2601 
2602 ////////////////////////////////////////////////////////////////////////////////
2603 /// Set the current color.
2604 
2606 {
2607  if (color < 0) color = 0;
2608  fCurrentColor = color;
2609  TColor *col = gROOT->GetColor(color);
2610  if (col)
2611  SetColor(col->GetRed(), col->GetGreen(), col->GetBlue());
2612  else
2613  SetColor(1., 1., 1.);
2614 }
2615 
2616 ////////////////////////////////////////////////////////////////////////////////
2617 /// Set directly current color (don't go via TColor).
2618 
2620 {
2621  if (r == fRed && g == fGreen && b == fBlue) return;
2622 
2623  fRed = r;
2624  fGreen = g;
2625  fBlue = b;
2626 
2627  if (fRed <= 0 && fGreen <= 0 && fBlue <= 0 ) {
2628  PrintFast(6," black");
2629  } else {
2630  if (gStyle->GetColorModelPS()) {
2631  Double_t colBlack = TMath::Min(TMath::Min(1-fRed,1-fGreen),1-fBlue);
2632  Double_t colCyan = (1-fRed-colBlack)/(1-colBlack);
2633  Double_t colMagenta = (1-fGreen-colBlack)/(1-colBlack);
2634  Double_t colYellow = (1-fBlue-colBlack)/(1-colBlack);
2635  WriteReal(colCyan);
2636  WriteReal(colMagenta);
2637  WriteReal(colYellow);
2638  WriteReal(colBlack);
2639  } else {
2640  WriteReal(fRed);
2641  WriteReal(fGreen);
2642  WriteReal(fBlue);
2643  }
2644  PrintFast(2," c");
2645  }
2646 }
2647 
2648 ////////////////////////////////////////////////////////////////////////////////
2649 /// Set color index for text
2650 
2652 {
2653  fTextColor = cindex;
2654 
2655  SetColor( Int_t(cindex) );
2656 }
2657 
2658 ////////////////////////////////////////////////////////////////////////////////
2659 /// Write a string of characters
2660 ///
2661 /// This method writes the string chars into a PostScript file
2662 /// at position xx,yy in world coordinates.
2663 
2664 void TPostScript::Text(Double_t xx, Double_t yy, const char *chars)
2665 {
2666  static const char *psfont[31][2] = {
2667  { "Root.PSFont.1", "/Times-Italic" },
2668  { "Root.PSFont.2", "/Times-Bold" },
2669  { "Root.PSFont.3", "/Times-BoldItalic" },
2670  { "Root.PSFont.4", "/Helvetica" },
2671  { "Root.PSFont.5", "/Helvetica-Oblique" },
2672  { "Root.PSFont.6", "/Helvetica-Bold" },
2673  { "Root.PSFont.7", "/Helvetica-BoldOblique" },
2674  { "Root.PSFont.8", "/Courier" },
2675  { "Root.PSFont.9", "/Courier-Oblique" },
2676  { "Root.PSFont.10", "/Courier-Bold" },
2677  { "Root.PSFont.11", "/Courier-BoldOblique" },
2678  { "Root.PSFont.12", "/Symbol" },
2679  { "Root.PSFont.13", "/Times-Roman" },
2680  { "Root.PSFont.14", "/ZapfDingbats" },
2681  { "Root.PSFont.15", "/Symbol" },
2682  { "Root.PSFont.STIXGen", "/STIXGeneral" },
2683  { "Root.PSFont.STIXGenIt", "/STIXGeneral-Italic" },
2684  { "Root.PSFont.STIXGenBd", "/STIXGeneral-Bold" },
2685  { "Root.PSFont.STIXGenBdIt", "/STIXGeneral-BoldItalic" },
2686  { "Root.PSFont.STIXSiz1Sym", "/STIXSize1Symbols" },
2687  { "Root.PSFont.STIXSiz1SymBd", "/STIXSize1Symbols-Bold" },
2688  { "Root.PSFont.STIXSiz2Sym", "/STIXSize2Symbols" },
2689  { "Root.PSFont.STIXSiz2SymBd", "/STIXSize2Symbols-Bold" },
2690  { "Root.PSFont.STIXSiz3Sym", "/STIXSize3Symbols" },
2691  { "Root.PSFont.STIXSiz3SymBd", "/STIXSize3Symbols-Bold" },
2692  { "Root.PSFont.STIXSiz4Sym", "/STIXSize4Symbols" },
2693  { "Root.PSFont.STIXSiz4SymBd", "/STIXSize4Symbols-Bold" },
2694  { "Root.PSFont.STIXSiz5Sym", "/STIXSize5Symbols" },
2695  { "Root.PSFont.ME", "/DroidSansFallback" },
2696  { "Root.PSFont.CJKMing", "/DroidSansFallback" },
2697  { "Root.PSFont.CJKGothic", "/DroidSansFallback" }
2698  };
2699 
2700  const Double_t kDEGRAD = TMath::Pi()/180.;
2701  Double_t x = xx;
2702  Double_t y = yy;
2703  if (!gPad) return;
2704 
2705  // Compute the font size. Exit if it is 0
2706  // The font size is computed from the TTF size to get exactly the same
2707  // size on the screen and in the PostScript file.
2708  Double_t wh = (Double_t)gPad->XtoPixel(gPad->GetX2());
2709  Double_t hh = (Double_t)gPad->YtoPixel(gPad->GetY1());
2710  Float_t tsize, ftsize;
2711 
2712  if (wh < hh) {
2713  tsize = fTextSize*wh;
2714  Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2715  ftsize = (sizeTTF*fXsize*gPad->GetAbsWNDC())/wh;
2716  } else {
2717  tsize = fTextSize*hh;
2718  Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2719  ftsize = (sizeTTF*fYsize*gPad->GetAbsHNDC())/hh;
2720  }
2721  Double_t fontsize = 4*(72*(ftsize)/2.54);
2722  if( fontsize <= 0) return;
2723 
2724  Float_t tsizex = gPad->AbsPixeltoX(Int_t(tsize))-gPad->AbsPixeltoX(0);
2725  Float_t tsizey = gPad->AbsPixeltoY(0)-gPad->AbsPixeltoY(Int_t(tsize));
2726 
2727  Int_t font = abs(fTextFont)/10;
2728  if( font > 31 || font < 1) font = 1;
2729 
2730  // Text color.
2732 
2733  // Text alignment.
2734  Int_t txalh = fTextAlign/10;
2735  if (txalh <1) txalh = 1; else if (txalh > 3) txalh = 3;
2736  Int_t txalv = fTextAlign%10;
2737  if (txalv <1) txalv = 1; else if (txalv > 3) txalv = 3;
2738  if (txalv == 3) {
2739  y -= 0.8*tsizey*TMath::Cos(kDEGRAD*fTextAngle);
2740  x += 0.8*tsizex*TMath::Sin(kDEGRAD*fTextAngle);
2741  } else if (txalv == 2) {
2742  y -= 0.4*tsizey*TMath::Cos(kDEGRAD*fTextAngle);
2743  x += 0.4*tsizex*TMath::Sin(kDEGRAD*fTextAngle);
2744  }
2745 
2746  UInt_t w = 0, w0 = 0;
2747  Bool_t kerning;
2748  // In order to measure the precise character positions we need to trick
2749  // FreeType into rendering high-resolution characters otherwise it will
2750  // stick to the screen pixel grid, which is far worse than we can achieve
2751  // on print.
2752  const Float_t scale = 16.0;
2753  // Save current text attributes.
2754  TText saveAttText;
2755  saveAttText.TAttText::operator=(*this);
2756  const Int_t len=strlen(chars);
2757  Int_t *charWidthsCumul = 0;
2758  TText t;
2759  t.SetTextSize(fTextSize * scale);
2761  t.GetTextAdvance(w, chars);
2762  t.GetTextAdvance(w0, chars, kFALSE);
2763  t.TAttText::Modify();
2764  if (w0-w != 0) kerning = kTRUE;
2765  else kerning = kFALSE;
2766  if (kerning) {
2767  // Calculate the individual character placements.
2768  charWidthsCumul = new Int_t[len];
2769  for (Int_t i = len - 1;i >= 0;i--) {
2770  UInt_t ww = 0;
2771  t.GetTextAdvance(ww, chars + i);
2772  Double_t wwl = (gPad->AbsPixeltoX(ww)-gPad->AbsPixeltoX(0));
2773  charWidthsCumul[i] = (Int_t)((XtoPS(wwl) - XtoPS(0)) / scale);
2774  }
2775  }
2776  // Restore text attributes.
2777  saveAttText.TAttText::Modify();
2778 
2779  Double_t charsLength = gPad->AbsPixeltoX(w)-gPad->AbsPixeltoX(0);
2780  Int_t psCharsLength = (Int_t)((XtoPS(charsLength)-XtoPS(0)) / scale);
2781 
2782  // Text angle.
2783  Int_t psangle = Int_t(0.5 + fTextAngle);
2784 
2785  // Save context.
2786  PrintStr("@");
2787  SaveRestore(1);
2788 
2789  // Clipping
2790  Int_t xc1 = XtoPS(gPad->GetX1());
2791  Int_t xc2 = XtoPS(gPad->GetX2());
2792  Int_t yc1 = YtoPS(gPad->GetY1());
2793  Int_t yc2 = YtoPS(gPad->GetY2());
2794  WriteInteger(xc2 - xc1);
2795  WriteInteger(yc2 - yc1);
2796  WriteInteger(xc1);
2797  WriteInteger(yc1);
2798  PrintStr(" C");
2799 
2800  // Output text position and angle. The text position is computed
2801  // using Double_t to avoid precision problems.
2802  Double_t vx = (x - gPad->GetX1())/(gPad->GetX2()-gPad->GetX1());
2803  Double_t cmx = fXsize*(gPad->GetAbsXlowNDC()+vx*gPad->GetAbsWNDC());
2804  WriteReal((288.*cmx)/2.54);
2805  Double_t vy = (y - gPad->GetY1())/(gPad->GetY2()-gPad->GetY1());
2806  Double_t cmy = fYsize*(gPad->GetAbsYlowNDC()+vy*gPad->GetAbsHNDC());
2807  WriteReal((288.*cmy)/2.54);
2808  PrintStr(Form(" t %d r ", psangle));
2809  if(txalh == 2) PrintStr(Form(" %d 0 t ", -psCharsLength/2));
2810  if(txalh == 3) PrintStr(Form(" %d 0 t ", -psCharsLength));
2811  PrintStr(gEnv->GetValue(psfont[font-1][0], psfont[font-1][1]));
2812  if (font != 15) {
2813  PrintStr(Form(" findfont %g sf 0 0 m ",fontsize));
2814  } else {
2815  PrintStr(Form(" findfont %g sf 0 0 m ita ",fontsize));
2816  }
2817 
2818  if (kerning) {
2819  PrintStr("@");
2820  // Output individual character placements
2821  for (Int_t i = len-1; i >= 1; i--) {
2822  WriteInteger(charWidthsCumul[0] - charWidthsCumul[i]);
2823  }
2824  delete [] charWidthsCumul;
2825  PrintStr("@");
2826  }
2827 
2828  // Output text.
2829  PrintStr("(");
2830 
2831  // Inside a PostScript string, the new line (if needed to break up long lines) must be escaped by a backslash.
2832  const char *crsave = fImplicitCREsc;
2833  fImplicitCREsc = "\\";
2834 
2835  char str[8];
2836  for (Int_t i=0; i<len;i++) {
2837  if (chars[i]!='\n') {
2838  if (chars[i]=='(' || chars[i]==')' || chars[i]=='\\') {
2839  snprintf(str,8,"\\%c",chars[i]);
2840  PrintStr(str);
2841  } else if ((chars[i]=='-') && (font != 12)) {
2842  PrintStr("\\255");
2843  } else {
2844  snprintf(str,8,"%c",chars[i]);
2845  PrintFast(1,str);
2846  }
2847  }
2848  }
2849  PrintStr(")");
2850  fImplicitCREsc = crsave;
2851 
2852  if (kerning) {
2853  if (font != 15) PrintStr(" K NC");
2854  else PrintStr(" K gr NC");
2855  } else {
2856  if (font != 15) PrintStr(" show NC");
2857  else PrintStr(" show gr NC");
2858  }
2859 
2860  SaveRestore(-1);
2861 }
2862 
2863 ////////////////////////////////////////////////////////////////////////////////
2864 /// Write a string of characters
2865 ///
2866 /// This method writes the string chars into a PostScript file
2867 /// at position xx,yy in world coordinates.
2868 
2869 void TPostScript::Text(Double_t xx, Double_t yy, const wchar_t *chars)
2870 {
2871  static const char *psfont[31][2] = {
2872  { "Root.PSFont.1", "/FreeSerifItalic" },
2873  { "Root.PSFont.2", "/FreeSerifBold" },
2874  { "Root.PSFont.3", "/FreeSerifBoldItalic" },
2875  { "Root.PSFont.4", "/FreeSans" },
2876  { "Root.PSFont.5", "/FreeSansOblique" },
2877  { "Root.PSFont.6", "/FreeSansBold" },
2878  { "Root.PSFont.7", "/FreeSansBoldOblique" },
2879  { "Root.PSFont.8", "/FreeMono" },
2880  { "Root.PSFont.9", "/FreeMonoOblique" },
2881  { "Root.PSFont.10", "/FreeMonoBold" },
2882  { "Root.PSFont.11", "/FreeMonoBoldOblique" },
2883  { "Root.PSFont.12", "/StandardSymbolsL" },
2884  { "Root.PSFont.13", "/FreeSerif" },
2885  { "Root.PSFont.14", "/Dingbats" },
2886  { "Root.PSFont.15", "/StandardSymbolsL" },
2887  { "Root.PSFont.STIXGen", "/STIXGeneral" },
2888  { "Root.PSFont.STIXGenIt", "/STIXGeneral-Italic" },
2889  { "Root.PSFont.STIXGenBd", "/STIXGeneral-Bold" },
2890  { "Root.PSFont.STIXGenBdIt", "/STIXGeneral-BoldItalic" },
2891  { "Root.PSFont.STIXSiz1Sym", "/STIXSize1Symbols" },
2892  { "Root.PSFont.STIXSiz1SymBd", "/STIXSize1Symbols-Bold" },
2893  { "Root.PSFont.STIXSiz2Sym", "/STIXSize2Symbols" },
2894  { "Root.PSFont.STIXSiz2SymBd", "/STIXSize2Symbols-Bold" },
2895  { "Root.PSFont.STIXSiz3Sym", "/STIXSize3Symbols" },
2896  { "Root.PSFont.STIXSiz3SymBd", "/STIXSize3Symbols-Bold" },
2897  { "Root.PSFont.STIXSiz4Sym", "/STIXSize4Symbols" },
2898  { "Root.PSFont.STIXSiz4SymBd", "/STIXSize4Symbols-Bold" },
2899  { "Root.PSFont.STIXSiz5Sym", "/STIXSize5Symbols" },
2900  { "Root.PSFont.ME", "/DroidSansFallback" },
2901  { "Root.PSFont.CJKMing", "/DroidSansFallback" },
2902  { "Root.PSFont.CJKGothic", "/DroidSansFallback" }
2903  };
2904 
2905  Int_t len = wcslen(chars);
2906  if (len<=0) return;
2907 
2908  const Double_t kDEGRAD = TMath::Pi()/180.;
2909  Double_t x = xx;
2910  Double_t y = yy;
2911  if (!gPad) return;
2912 
2913  // Compute the font size. Exit if it is 0
2914  // The font size is computed from the TTF size to get exactly the same
2915  // size on the screen and in the PostScript file.
2916  Double_t wh = (Double_t)gPad->XtoPixel(gPad->GetX2());
2917  Double_t hh = (Double_t)gPad->YtoPixel(gPad->GetY1());
2918  Float_t tsize, ftsize;
2919 
2920  if (wh < hh) {
2921  tsize = fTextSize*wh;
2922  Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2923  ftsize = (sizeTTF*fXsize*gPad->GetAbsWNDC())/wh;
2924  } else {
2925  tsize = fTextSize*hh;
2926  Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2927  ftsize = (sizeTTF*fYsize*gPad->GetAbsHNDC())/hh;
2928  }
2929  Double_t fontsize = 4*(72*(ftsize)/2.54);
2930  if( fontsize <= 0) return;
2931 
2932  Float_t tsizex = gPad->AbsPixeltoX(Int_t(tsize))-gPad->AbsPixeltoX(0);
2933  Float_t tsizey = gPad->AbsPixeltoY(0)-gPad->AbsPixeltoY(Int_t(tsize));
2934 
2935  Int_t font = abs(fTextFont)/10;
2936  if( font > 29 || font < 1) font = 1;
2937 
2938  // Text color.
2940 
2941  // Text alignment.
2942  Int_t txalh = fTextAlign/10;
2943  if (txalh <1) txalh = 1; else if (txalh > 3) txalh = 3;
2944  Int_t txalv = fTextAlign%10;
2945  if (txalv <1) txalv = 1; else if (txalv > 3) txalv = 3;
2946  if (txalv == 3) {
2947  y -= 0.8*tsizey*TMath::Cos(kDEGRAD*fTextAngle);
2948  x += 0.8*tsizex*TMath::Sin(kDEGRAD*fTextAngle);
2949  } else if (txalv == 2) {
2950  y -= 0.4*tsizey*TMath::Cos(kDEGRAD*fTextAngle);
2951  x += 0.4*tsizex*TMath::Sin(kDEGRAD*fTextAngle);
2952  }
2953  UInt_t w = 0, h = 0;
2954 
2955  TText t;
2958  t.GetTextExtent(w, h, chars);
2959  Double_t charsLength = gPad->AbsPixeltoX(w)-gPad->AbsPixeltoX(0);
2960  Int_t psCharsLength = XtoPS(charsLength)-XtoPS(0);
2961 
2962  // Text angle.
2963  Int_t psangle = Int_t(0.5 + fTextAngle);
2964 
2965  // Save context.
2966  PrintStr("@");
2967  SaveRestore(1);
2968 
2969  // Clipping
2970  Int_t xc1 = XtoPS(gPad->GetX1());
2971  Int_t xc2 = XtoPS(gPad->GetX2());
2972  Int_t yc1 = YtoPS(gPad->GetY1());
2973  Int_t yc2 = YtoPS(gPad->GetY2());
2974  WriteInteger(xc2 - xc1);
2975  WriteInteger(yc2 - yc1);
2976  WriteInteger(xc1);
2977  WriteInteger(yc1);
2978  PrintStr(" C");
2979 
2980  // Output text position and angle.
2981  WriteInteger(XtoPS(x));
2982  WriteInteger(YtoPS(y));
2983  PrintStr(Form(" t %d r ", psangle));
2984  if(txalh == 2) PrintStr(Form(" %d 0 t ", -psCharsLength/2));
2985  if(txalh == 3) PrintStr(Form(" %d 0 t ", -psCharsLength));
2986  MustEmbed[font-1] = kTRUE; // This font will be embedded in the file at EOF time.
2987  PrintStr(gEnv->GetValue(psfont[font-1][0], psfont[font-1][1]));
2988  PrintStr(Form(" findfont %g sf 0 0 m ",fontsize));
2989 
2990  // Output text.
2991  if (len > 1) PrintStr(Form("%d ", len));
2992  for(Int_t i = 0; i < len; i++) {
2993  // Adobe Glyph Naming Convention
2994  // http://www.adobe.com/devnet/opentype/archives/glyph.html
2995 #include "AdobeGlyphList.h"
2996  const wchar_t *lower = std::lower_bound(
2998  chars[i]);
2999  if(lower < adobe_glyph_ucs + nadobe_glyph &&
3000  *lower == chars[i]) {
3001  // Named glyph from AGL 1.2
3002  const unsigned long index =
3003  lower - adobe_glyph_ucs;
3004  PrintStr(Form("/%s ", adobe_glyph_name[index]));
3005  }
3006  else if((unsigned int)chars[i] < 0xffff) {
3007  // Unicode BMP
3008  PrintStr(Form("/uni%04X ",
3009  (unsigned int)chars[i]));
3010  }
3011  else {
3012  // Unicode supplemental planes
3013  PrintStr(Form("/u%04X ",
3014  (unsigned int)chars[i]));
3015  }
3016  }
3017  if(len > 1) {
3018  PrintStr("{glyphshow} repeat ");
3019  }
3020  else {
3021  PrintStr("glyphshow ");
3022  }
3023 
3024  PrintStr("NC");
3025 
3026  SaveRestore(-1);
3027 }
3028 
3029 ////////////////////////////////////////////////////////////////////////////////
3030 /// Write a string of characters in NDC
3031 
3032 void TPostScript::TextNDC(Double_t u, Double_t v, const char *chars)
3033 {
3034  Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1());
3035  Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1());
3036  Text(x, y, chars);
3037 }
3038 
3039 ////////////////////////////////////////////////////////////////////////////////
3040 /// Write a string of characters in NDC
3041 
3042 void TPostScript::TextNDC(Double_t u, Double_t v, const wchar_t *chars)
3043 {
3044  Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1());
3045  Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1());
3046  Text(x, y, chars);
3047 }
3048 
3049 ////////////////////////////////////////////////////////////////////////////////
3050 /// Convert U from NDC coordinate to PostScript
3051 
3053 {
3054  Double_t cm = fXsize*(gPad->GetAbsXlowNDC() + u*gPad->GetAbsWNDC());
3055  return Int_t(0.5 + 288*cm/2.54);
3056 }
3057 
3058 ////////////////////////////////////////////////////////////////////////////////
3059 /// Convert V from NDC coordinate to PostScript
3060 
3062 {
3063  Double_t cm = fYsize*(gPad->GetAbsYlowNDC() + v*gPad->GetAbsHNDC());
3064  return Int_t(0.5 + 288*cm/2.54);
3065 }
3066 
3067 ////////////////////////////////////////////////////////////////////////////////
3068 /// Convert X from world coordinate to PostScript
3069 
3071 {
3072  Double_t u = (x - gPad->GetX1())/(gPad->GetX2() - gPad->GetX1());
3073  return UtoPS(u);
3074 }
3075 
3076 ////////////////////////////////////////////////////////////////////////////////
3077 /// Convert Y from world coordinate to PostScript
3078 
3080 {
3081  Double_t v = (y - gPad->GetY1())/(gPad->GetY2() - gPad->GetY1());
3082  return VtoPS(v);
3083 }
3084 
3085 ////////////////////////////////////////////////////////////////////////////////
3086 /// Initialize the PostScript page in zones
3087 
3089 {
3090  if( !fClear )return;
3091  fClear = kFALSE;
3092 
3093  // When Zone has been called, fZone is TRUE
3094  fZone = kTRUE;
3095 
3096  if( fIYzone > fNYzone) {
3097  fIYzone=1;
3098  if( fMode != 3) {
3099  PrintStr("@showpage");
3100  SaveRestore(-1);
3101  fNpages++;
3102  PrintStr("@%%Page:");
3105  PrintStr("@");
3106  } else {
3107  PrintFast(9," showpage");
3108  SaveRestore(-1);
3109  }
3110  }
3111 
3112  // No grestore the first time
3113  if( fMode != 3) {
3114  if( fIXzone != 1 || fIYzone != 1) SaveRestore(-1);
3115  SaveRestore(1);
3116  PrintStr("@");
3119  PrintFast(5," Zone");
3120  PrintStr("@");
3121  fIXzone++;
3122  if( fIXzone > fNXzone) { fIXzone=1; fIYzone++; }
3123  }
3124 
3125  // Picture Initialisation
3126  SaveRestore(1);
3127  if (fgLineJoin) {
3129  PrintFast(12," setlinejoin");
3130  }
3131  PrintFast(6," 0 0 t");
3132  fRed = -1;
3133  fGreen = -1;
3134  fBlue = -1;
3135  fPrinted = kFALSE;
3136  fLineColor = -1;
3137  fLineStyle = -1;
3138  fLineWidth = -1;
3139  fFillColor = -1;
3140  fFillStyle = -1;
3141  fMarkerSizeCur = -1;
3142 }
Interface to PostScript.
Definition: TPostScript.h:22
virtual ~TPostScript()
Default PostScript destructor.
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition: TStyle.cxx:792
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1265
static Bool_t MustEmbed[32]
const char * GetHeaderPS() const
Definition: TStyle.h:284
Int_t fNBSameColorCell
Number of boxes with the same color.
Definition: TPostScript.h:79
char * fBuffer
Definition: TVirtualPS.h:52
void Text(Double_t x, Double_t y, const char *string)
Write a string of characters.
virtual int GetPid()
Get process id.
Definition: TSystem.cxx:712
Float_t fXsize
Page size along X.
Definition: TPostScript.h:47
Float_t fYVP2
Definition: TPostScript.h:42
T1 Sign(T1 a, T2 b)
Definition: TMathBase.h:155
short Style_t
Definition: RtypesCore.h:76
Bool_t fClear
True when page must be cleared.
Definition: TPostScript.h:67
TLine * line
void On()
Activate an already open PostScript file.
float Float_t
Definition: RtypesCore.h:53
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
const char Option_t
Definition: RtypesCore.h:62
Int_t CMtoPS(Double_t u)
Definition: TPostScript.h:95
void DefineMarkers()
Define the markers.
R__EXTERN TStyle * gStyle
Definition: TStyle.h:418
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Float_t fYsize
Page size along Y.
Definition: TPostScript.h:48
TH1 * h
Definition: legend2.C:5
Float_t fXVP2
Definition: TPostScript.h:40
const char * fImplicitCREsc
Definition: TVirtualPS.h:53
Size_t fMarkerSize
Marker size.
Definition: TAttMarker.h:29
Bool_t fBoundingBox
True for Encapsulated PostScript.
Definition: TPostScript.h:66
Int_t fCurrentColor
current Postscript color index
Definition: TPostScript.h:61
#define gROOT
Definition: TROOT.h:379
Basic string class.
Definition: TString.h:137
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
Definition: TVirtualPS.cxx:170
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
Definition: TStyle.cxx:810
Float_t GetLineScalePS() const
Definition: TStyle.h:288
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:170
static const unsigned long nadobe_glyph
Definition: AdobeGlyphList.h:1
Int_t fLastCellRed
Last red value.
Definition: TPostScript.h:76
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Float_t fMarkerSizeCur
current transformed value of marker size
Definition: TPostScript.h:60
const Bool_t kFALSE
Definition: Rtypes.h:92
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
Float_t GetGreen() const
Definition: TColor.h:61
Int_t fNXzone
Number of zones along X.
Definition: TPostScript.h:56
char fPatterns[32]
Indicate if pattern n is defined.
Definition: TPostScript.h:71
Bool_t fFontEmbed
True is FontEmbed has been called.
Definition: TPostScript.h:81
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
void FontEmbed()
Embed font in PS file.
bool FontEmbedType42(const char *filename)
static std::string format(double x, double y, int digits, int width)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Definition: TMath.h:501
Int_t GetJoinLinePS() const
Definition: TStyle.h:287
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
Definition: TVirtualPS.cxx:185
virtual int Rename(const char *from, const char *to)
Rename a file.
Definition: TSystem.cxx:1319
Int_t fType
PostScript workstation type.
Definition: TPostScript.h:63
void SetLineStyle(Style_t linestyle=1)
Change the line style.
const char * Data() const
Definition: TString.h:349
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition: TAttText.h:51
Int_t fSave
Number of gsave for restore.
Definition: TPostScript.h:55
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Definition: TSystem.cxx:1346
static const double x2[5]
Float_t fMaxsize
Largest dimension of X and Y.
Definition: TPostScript.h:49
Int_t fNpages
number of pages
Definition: TPostScript.h:62
Double_t x[n]
Definition: legend1.C:17
TPostScript()
Default PostScript constructor.
void SetLineWidth(Width_t linewidth=1)
Change the line width.
void Open(const char *filename, Int_t type=-111)
Open a PostScript file.
static Int_t fgLineJoin
Appearance of joining lines.
Definition: TPostScript.h:83
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
Definition: TVirtualPS.cxx:72
TString fFileName
PS file name.
Definition: TPostScript.h:80
Int_t fNYzone
Number of zones along Y.
Definition: TPostScript.h:57
bool FontEmbedType2(const char *filename)
Float_t GetBlue() const
Definition: TColor.h:62
Int_t fNbCellW
Number of boxes per line.
Definition: TPostScript.h:73
Bool_t fClipStatus
Clipping Indicator.
Definition: TPostScript.h:68
Base class for several text objects.
Definition: TText.h:33
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:925
Int_t fIYzone
Current zone along Y.
Definition: TPostScript.h:59
Int_t fNbCellLine
Number of boxes in the current line.
Definition: TPostScript.h:74
short Color_t
Definition: RtypesCore.h:79
Int_t GetColorModelPS() const
Definition: TStyle.h:198
void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light)
Draw a Frame around a box.
Style_t fMarkerStyle
Marker style.
Definition: TAttMarker.h:28
TCanvas * kerning()
Definition: kerning.C:1
void CellArrayEnd()
End the Cell Array painting.
void MovePS(Int_t x, Int_t y)
Move to a new position.
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
Float_t fTextAngle
Text angle.
Definition: TAttText.h:27
Style_t fLineStyle
Line style.
Definition: TAttLine.h:28
TRandom2 r(17)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
SVector< double, 2 > v
Definition: Dict.h:5
XPoint xy[kMAXMK]
Definition: TGX11.cxx:122
Int_t fSizBuffer
Definition: TVirtualPS.h:49
Color_t fLineColor
Line color.
Definition: TAttLine.h:27
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Definition: TEnv.cxx:482
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points x, y.
virtual Color_t GetFillColor() const
Return the fill area color.
Definition: TAttFill.h:35
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
unsigned int UInt_t
Definition: RtypesCore.h:42
Width_t fLineWidth
Line width.
Definition: TAttLine.h:29
Float_t fXVP1
Definition: TPostScript.h:39
const Float_t kScale
Definition: TGQuartz.mm:47
char * Form(const char *fmt,...)
Int_t fLastCellBlue
Last blue value.
Definition: TPostScript.h:78
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
Definition: TText.cxx:587
Bool_t fPrinted
Definition: TVirtualPS.h:50
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
std::ofstream * fStream
Definition: TVirtualPS.h:51
void FontEncode()
Font Re-encoding.
Float_t fRed
Per cent of red.
Definition: TPostScript.h:50
Font_t fTextFont
Text font.
Definition: TAttText.h:31
Bool_t fRange
True when a range has been defined.
Definition: TPostScript.h:69
Double_t Cos(Double_t)
Definition: TMath.h:424
short Width_t
Definition: RtypesCore.h:78
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2514
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Draw a Cell Array.
PyObject * fType
Double_t Pi()
Definition: TMath.h:44
2-D graphics point (world coordinates).
Definition: TPoints.h:21
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
virtual void PrintRaw(Int_t len, const char *str)
Print a raw.
Definition: TVirtualPS.cxx:200
Int_t fNbinCT
Number of entries in the current Cell Array.
Definition: TPostScript.h:72
static const double x1[5]
void Off()
Deactivate an already open PostScript file.
#define ClassImp(name)
Definition: Rtypes.h:279
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
double Double_t
Definition: RtypesCore.h:55
virtual void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
Definition: TVirtualPS.cxx:103
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
Bool_t fZone
Zone indicator.
Definition: TPostScript.h:70
bool FontEmbedType1(const char *filename)
Double_t y[n]
Definition: legend1.C:17
Int_t fIXzone
Current zone along X.
Definition: TPostScript.h:58
The color creation and management class.
Definition: TColor.h:23
Float_t GetRed() const
Definition: TColor.h:60
Float_t fTextSize
Text size.
Definition: TAttText.h:28
void Zone()
Initialize the PostScript page in zones.
void SetColor(Int_t color=1)
Set the current color.
Int_t fLenBuffer
Definition: TVirtualPS.h:48
static const char * adobe_glyph_name[nadobe_glyph]
void SetLineScale(Float_t scale=3)
Definition: TPostScript.h:127
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
void Close(Option_t *opt="")
Close a PostScript file.
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
Color_t fFillColor
Fill area color.
Definition: TAttFill.h:27
Double_t Sin(Double_t)
Definition: TMath.h:421
Int_t fClip
Clipping mode.
Definition: TPostScript.h:65
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
void Initialize()
PostScript Initialisation.
#define NULL
Definition: Rtypes.h:82
#define snprintf
Definition: civetweb.c:822
R__EXTERN TVirtualPS * gVirtualPS
Definition: TVirtualPS.h:91
#define gPad
Definition: TVirtualPad.h:289
Int_t fMode
PostScript mode.
Definition: TPostScript.h:64
Int_t fLastCellGreen
Last green value.
Definition: TPostScript.h:77
void NewPage()
Move to a new PostScript page.
virtual void GetTextAdvance(UInt_t &a, const char *text, const Bool_t kern=kTRUE) const
Return text advance for string text if kern is true (default) kerning is taken into account...
Definition: TText.cxx:615
Float_t fLineScale
Line width scale factor.
Definition: TPostScript.h:53
double result[121]
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:40
const int nn
Double_t Sqrt(Double_t x)
Definition: TMath.h:464
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:52
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
const char * AsString() const
Return the date &amp; time as a string (ctime() format).
Definition: TDatime.cxx:101
const Bool_t kTRUE
Definition: Rtypes.h:91
Color_t fMarkerColor
Marker color.
Definition: TAttMarker.h:27
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:155
const char * GetTitlePS() const
Definition: TStyle.h:285
Color_t fTextColor
Text color.
Definition: TAttText.h:30
void SetTextColor(Color_t cindex=1)
Set color index for text.
const Int_t n
Definition: legend1.C:16
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Float_t fGreen
Per cent of green.
Definition: TPostScript.h:51
Float_t fYVP1
Definition: TPostScript.h:41
Int_t fMaxLines
Maximum number of lines in a PS array.
Definition: TPostScript.h:75
Float_t fBlue
Per cent of blue.
Definition: TPostScript.h:52
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:39
Style_t fFillStyle
Fill area style.
Definition: TAttFill.h:28
Short_t fTextAlign
Text alignment.
Definition: TAttText.h:29
static const wchar_t adobe_glyph_ucs[nadobe_glyph]
Definition: AdobeGlyphList.h:2
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:911