Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPDF.cxx
Go to the documentation of this file.
1// @(#)root/postscript:$Id: TPDF.cxx,v 1.0
2// Author: Olivier Couet
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 TPDF
13\ingroup PS
14
15\brief Interface to PDF.
16
17Like PostScript, PDF is a vector graphics output format allowing a very high
18graphics output quality. The functionalities provided by this class are very
19similar to those provided by `TPostScript`.
20
21Compare to PostScript output, the PDF files are usually smaller because some
22parts of them can be compressed.
23
24PDF also allows to define table of contents. This facility can be used in ROOT.
25The following example shows how to proceed:
26~~~ {.cpp}
27{
28 TCanvas* canvas = new TCanvas("canvas");
29 TH1F* histo = new TH1F("histo","test 1",10,0.,10.);
30 histo->SetFillColor(2);
31 histo->Fill(2.);
32 histo->Draw();
33 canvas->Print("plots.pdf(","Title:One bin filled");
34 histo->Fill(4.);
35 histo->Draw();
36 canvas->Print("plots.pdf","Title:Two bins filled");
37 histo->Fill(6.);
38 histo->Draw();
39 canvas->Print("plots.pdf","Title:Three bins filled");
40 histo->Fill(8.);
41 histo->Draw();
42 canvas->Print("plots.pdf","Title:Four bins filled");
43 histo->Fill(8.);
44 histo->Draw();
45 canvas->Print("plots.pdf)","Title:The fourth bin content is 2");
46}
47~~~
48Each character string following the keyword "Title:" makes a new entry in
49the table of contents.
50*/
51
52#ifdef WIN32
53#pragma optimize("",off)
54#endif
55
56#include <cstdlib>
57#include <cstring>
58#include <cctype>
59#include <fstream>
60
61#include "TROOT.h"
62#include "TDatime.h"
63#include "TColor.h"
64#include "TVirtualPad.h"
65#include "TPoints.h"
66#include "TPDF.h"
67#include "TStyle.h"
68#include "TMath.h"
69#include "TStorage.h"
70#include "TText.h"
71#include "zlib.h"
72#include "TObjString.h"
73#include "TObjArray.h"
74#include "snprintf.h"
75
76// To scale fonts to the same size as the old TT version
77const Float_t kScale = 0.93376068;
78
79// Objects numbers
80const Int_t kObjRoot = 1; // Root object
81const Int_t kObjInfo = 2; // Info object
82const Int_t kObjOutlines = 3; // Outlines object
83const Int_t kObjPages = 4; // Pages object (pages index)
84const Int_t kObjPageResources = 5; // Pages Resources object
85const Int_t kObjContents = 6; // Table of content
86const Int_t kObjFont = 7; // First Font object (14 in total)
87const Int_t kObjColorSpace = 22; // ColorSpace object
88const Int_t kObjPatternResourses = 23; // Pattern Resources object
89const Int_t kObjPatternList = 24; // Pattern list object
90const Int_t kObjTransList = 25; // List of transparencies
91const Int_t kObjPattern = 26; // First pattern object (25 in total)
92const Int_t kObjFirstPage = 51; // First page object
93
94// Number of fonts
96
100
101
102////////////////////////////////////////////////////////////////////////////////
103/// Default PDF constructor
104
106{
107 fStream = nullptr;
110 gVirtualPS = this;
111 fRed = 0.;
112 fGreen = 0.;
113 fBlue = 0.;
114 fAlpha = 1.;
115 fXsize = 0.;
116 fYsize = 0.;
117 fType = 0;
118 fPageFormat = 0;
120 fStartStream = 0;
121 fLineScale = 0.;
122 fNbPage = 0;
123 fRange = kFALSE;
124 SetTitle("PDF");
125}
126
127////////////////////////////////////////////////////////////////////////////////
128/// Initialize the PDF interface
129///
130/// - fname : PDF file name
131/// - wtype : PDF workstation type. Not used in the PDF driver. But as TPDF
132/// inherits from TVirtualPS it should be kept. Anyway it is not
133/// necessary to specify this parameter at creation time because it
134/// has a default value (which is ignore in the PDF case).
135
137{
138 fStream = nullptr;
141 fRed = 0.;
142 fGreen = 0.;
143 fBlue = 0.;
144 fAlpha = 1.;
145 fXsize = 0.;
146 fYsize = 0.;
147 fType = 0;
148 fPageFormat = 0;
150 fStartStream = 0;
151 fLineScale = 0.;
152 fNbPage = 0;
153 fRange = kFALSE;
154 SetTitle("PDF");
155 Open(fname, wtype);
156}
157
158////////////////////////////////////////////////////////////////////////////////
159/// Default PDF destructor
160
162{
163 Close();
164
165 if (fObjPos) delete [] fObjPos;
166}
167
168////////////////////////////////////////////////////////////////////////////////
169/// Begin the Cell Array painting
170
172 Double_t)
173{
174 Warning("TPDF::CellArrayBegin", "not yet implemented");
175}
176
177////////////////////////////////////////////////////////////////////////////////
178/// Paint the Cell Array
179
181{
182 Warning("TPDF::CellArrayFill", "not yet implemented");
183}
184
185////////////////////////////////////////////////////////////////////////////////
186/// End the Cell Array painting
187
189{
190 Warning("TPDF::CellArrayEnd", "not yet implemented");
191}
192
193////////////////////////////////////////////////////////////////////////////////
194/// Close a PDF file
195
197{
198 Int_t i;
199
200 if (!gVirtualPS) return;
201 if (!fStream) return;
202 if (gPad) gPad->Update();
203
204 // Close the currently opened page
206 PrintStr("endstream@");
208 EndObject();
211 PrintStr("@");
212 EndObject();
214 PrintStr("<<@");
215 if (!strstr(GetTitle(),"PDF")) {
216 PrintStr("/Title (");
218 PrintStr(")@");
219 } else {
220 PrintStr("/Title (Page");
222 PrintStr(")@");
223 }
224 PrintStr("/Dest [");
226 PrintStr(" 0 R /XYZ null null 0]@");
227 PrintStr("/Parent");
229 PrintStr(" 0 R");
230 PrintStr("@");
231 if (fNbPage > 1) {
232 PrintStr("/Prev");
234 PrintStr(" 0 R");
235 PrintStr("@");
236 }
237 PrintStr(">>@");
238 EndObject();
239
241 PrintStr("<<@");
242 PrintStr("/Type /Outlines@");
243 PrintStr("/Count");
245 PrintStr("@");
246 PrintStr("/First");
248 PrintStr(" 0 R");
249 PrintStr("@");
250 PrintStr("/Last");
252 PrintStr(" 0 R");
253 PrintStr("@");
254 PrintStr(">>@");
255 EndObject();
256
258 PrintStr("<<@");
259 PrintStr("/Title (Contents)@");
260 PrintStr("/Dest [");
262 PrintStr(" 0 R /XYZ null null 0]@");
263 PrintStr("/Count");
265 PrintStr("@");
266 PrintStr("/Parent");
268 PrintStr(" 0 R");
269 PrintStr("@");
270 PrintStr("/First");
272 PrintStr(" 0 R");
273 PrintStr("@");
274 PrintStr("/Last");
276 PrintStr(" 0 R");
277 PrintStr("@");
278 PrintStr(">>@");
279 EndObject();
280
281 // List of all the pages
283 PrintStr("<<@");
284 PrintStr("/Type /Pages@");
285 PrintStr("/Count");
287 PrintStr("@");
288 PrintStr("/Kids [");
289 for (i=1; i<=fNbPage; i++) {
291 PrintStr(" 0 R");
292 }
293 PrintStr(" ]");
294 PrintStr("@");
295 PrintStr(">>@");
296 EndObject();
297
299 PrintStr("<<@");
300 for (i=0; i<(int)fAlphas.size(); i++) {
301 PrintStr(
302 Form("/ca%3.2f << /Type /ExtGState /ca %3.2f >> /CA%3.2f << /Type /ExtGState /CA %3.2f >>@",
303 fAlphas[i],fAlphas[i],fAlphas[i],fAlphas[i]));
304 }
305 PrintStr(">>@");
306 EndObject();
307 if (!fAlphas.empty()) fAlphas.clear();
308
309 // Cross-Reference Table
311 PrintStr("xref@");
312 PrintStr("0");
314 PrintStr("@");
315 PrintStr("0000000000 65535 f @");
316 char str[21];
317 for (i=0; i<fNbObj; i++) {
318 snprintf(str,21,"%10.10d 00000 n @",fObjPos[i]);
319 PrintStr(str);
320 }
321
322 // Trailer
323 PrintStr("trailer@");
324 PrintStr("<<@");
325 PrintStr("/Size");
327 PrintStr("@");
328 PrintStr("/Root");
330 PrintStr(" 0 R");
331 PrintStr("@");
332 PrintStr("/Info");
334 PrintStr(" 0 R@");
335 PrintStr(">>@");
336 PrintStr("startxref@");
337 WriteInteger(refInd, false);
338 PrintStr("@");
339 PrintStr("%%EOF@");
340
341 // Close file stream
342 if (fStream) { fStream->close(); delete fStream; fStream = nullptr;}
343
344 gVirtualPS = nullptr;
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// Draw a Box
349
351{
352 static Double_t x[4], y[4];
357 Int_t fillis = fFillStyle/1000;
358 Int_t fillsi = fFillStyle%1000;
359
360 if (fillis == 3 || fillis == 2) {
361 if (fillsi > 99) {
362 x[0] = x1; y[0] = y1;
363 x[1] = x2; y[1] = y1;
364 x[2] = x2; y[2] = y2;
365 x[3] = x1; y[3] = y2;
366 return;
367 }
368 if (fillsi > 0 && fillsi < 26) {
369 x[0] = x1; y[0] = y1;
370 x[1] = x2; y[1] = y1;
371 x[2] = x2; y[2] = y2;
372 x[3] = x1; y[3] = y2;
373 DrawPS(-4, &x[0], &y[0]);
374 }
375 if (fillsi == -3) {
376 SetColor(5);
377 if (fAlpha == 1) PrintFast(15," q 0.4 w [] 0 d");
378 WriteReal(ix1);
379 WriteReal(iy1);
380 WriteReal(ix2 - ix1);
381 WriteReal(iy2 - iy1);
382 if (fAlpha == 1) PrintFast(8," re b* Q");
383 else PrintFast(6," re f*");
384 }
385 }
386 if (fillis == 1) {
388 if (fAlpha == 1) PrintFast(15," q 0.4 w [] 0 d");
389 WriteReal(ix1);
390 WriteReal(iy1);
391 WriteReal(ix2 - ix1);
392 WriteReal(iy2 - iy1);
393 if (fAlpha == 1) PrintFast(8," re b* Q");
394 else PrintFast(6," re f*");
395 }
396 if (fillis == 0) {
397 if (fLineWidth<=0) return;
399 WriteReal(ix1);
400 WriteReal(iy1);
401 WriteReal(ix2 - ix1);
402 WriteReal(iy2 - iy1);
403 PrintFast(5," re S");
404 }
405}
406
407////////////////////////////////////////////////////////////////////////////////
408/// Draw a Frame around a box
409///
410/// - mode = -1 box looks as it is behind the screen
411/// - mode = 1 box looks as it is in front of the screen
412/// - border is the border size in already precomputed PDF units
413/// - dark is the color for the dark part of the frame
414/// - light is the color for the light part of the frame
415
417 Int_t mode, Int_t border, Int_t dark, Int_t light)
418{
419 static Double_t xps[7], yps[7];
420 Int_t i;
421
422 // Draw top&left part of the box
423 if (mode == -1) SetColor(dark);
424 else SetColor(light);
425 xps[0] = XtoPDF(xl); yps[0] = YtoPDF(yl);
426 xps[1] = xps[0] + border; yps[1] = yps[0] + border;
427 xps[2] = xps[1]; yps[2] = YtoPDF(yt) - border;
428 xps[3] = XtoPDF(xt) - border; yps[3] = yps[2];
429 xps[4] = XtoPDF(xt); yps[4] = YtoPDF(yt);
430 xps[5] = xps[0]; yps[5] = yps[4];
431 xps[6] = xps[0]; yps[6] = yps[0];
432
433 MoveTo(xps[0], yps[0]);
434 for (i=1;i<7;i++) LineTo(xps[i], yps[i]);
435 PrintFast(3," f*");
436
437 // Draw bottom&right part of the box
438 if (mode == -1) SetColor(light);
439 else SetColor(dark);
440 xps[0] = XtoPDF(xl); yps[0] = YtoPDF(yl);
441 xps[1] = xps[0] + border; yps[1] = yps[0] + border;
442 xps[2] = XtoPDF(xt) - border; yps[2] = yps[1];
443 xps[3] = xps[2]; yps[3] = YtoPDF(yt) - border;
444 xps[4] = XtoPDF(xt); yps[4] = YtoPDF(yt);
445 xps[5] = xps[4]; yps[5] = yps[0];
446 xps[6] = xps[0]; yps[6] = yps[0];
447
448 MoveTo(xps[0], yps[0]);
449 for (i=1;i<7;i++) LineTo(xps[i], yps[i]);
450 PrintFast(3," f*");
451}
452
453////////////////////////////////////////////////////////////////////////////////
454/// Draw Fill area with hatch styles
455
457{
458 Warning("DrawHatch", "hatch fill style not yet implemented");
459}
460
461////////////////////////////////////////////////////////////////////////////////
462/// Draw Fill area with hatch styles
463
465{
466 Warning("DrawHatch", "hatch fill style not yet implemented");
467}
468
469////////////////////////////////////////////////////////////////////////////////
470/// Draw a PolyLine
471///
472/// Draw a polyline through the points xy.
473///
474/// - If NN=1 moves only to point x,y.
475/// - If NN=0 the x,y are written in the PDF file
476/// according to the current transformation.
477/// - If NN>0 the line is clipped as a line.
478/// - If NN<0 the line is clipped as a fill area.
479
481{
482 Int_t n;
483
486
487 if (nn > 0) {
488 if (fLineWidth<=0) return;
489 n = nn;
493 } else {
494 n = -nn;
495 SetLineStyle(1);
496 SetLineWidth(1);
498 }
499
500 WriteReal(XtoPDF(xy[0].GetX()));
501 WriteReal(YtoPDF(xy[0].GetY()));
502 if (n <= 1) {
503 if (n == 0) return;
504 PrintFast(2," m");
505 return;
506 }
507
508 PrintFast(2," m");
509
510 for (Int_t i=1;i<n;i++) LineTo(XtoPDF(xy[i].GetX()), YtoPDF(xy[i].GetY()));
511
512 if (nn > 0) {
513 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY()) PrintFast(3," cl");
514 PrintFast(2," S");
515 } else {
516 PrintFast(3," f*");
517 }
518
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Draw a PolyLine in NDC space
525///
526/// Draw a polyline through the points xy.
527///
528/// - If NN=1 moves only to point x,y.
529/// - If NN=0 the x,y are written in the PDF file
530/// according to the current transformation.
531/// - If NN>0 the line is clipped as a line.
532/// - If NN<0 the line is clipped as a fill area.
533
535{
536 Int_t n;
537
540
541 if (nn > 0) {
542 if (fLineWidth<=0) return;
543 n = nn;
547 } else {
548 n = -nn;
549 SetLineStyle(1);
550 SetLineWidth(1);
552 }
553
554 WriteReal(UtoPDF(xy[0].GetX()));
555 WriteReal(VtoPDF(xy[0].GetY()));
556 if (n <= 1) {
557 if (n == 0) return;
558 PrintFast(2," m");
559 return;
560 }
561
562 PrintFast(2," m");
563
564 for (Int_t i=1;i<n;i++) LineTo(UtoPDF(xy[i].GetX()), VtoPDF(xy[i].GetY()));
565
566 if (nn > 0) {
567 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY()) PrintFast(3," cl");
568 PrintFast(2," S");
569 } else {
570 PrintFast(3," f*");
571 }
572
575}
576
577////////////////////////////////////////////////////////////////////////////////
578/// Draw markers at the n WC points xw, yw
579
581{
585 SetLineStyle(1);
589
590 if (ms == 4)
591 ms = 24;
592 else if (ms >= 6 && ms <= 8)
593 ms = 20;
594 else if (ms >= 9 && ms <= 19)
595 ms = 1;
596
597 // Define the marker size
599 if (fMarkerStyle == 1 || (fMarkerStyle >= 9 && fMarkerStyle <= 19)) {
600 msize = 1.;
601 } else if (fMarkerStyle == 6) {
602 msize = 1.;
603 } else if (fMarkerStyle == 7) {
604 msize = 1.5;
605 } else {
606 const Int_t kBASEMARKER = 8;
608 Float_t s2x = sbase / Float_t(gPad->GetWw() * gPad->GetAbsWNDC());
609 msize = this->UtoPDF(s2x) - this->UtoPDF(0);
610 }
611
612 Double_t m = msize;
613 Double_t m2 = m/2;
614 Double_t m3 = m/3;
615 Double_t m4 = m2*1.333333333333;
616 Double_t m6 = m/6;
617 Double_t m0 = m/10.;
618 Double_t m8 = m/4;
619 Double_t m9 = m/8;
620
621 // Draw the marker according to the type
622 Double_t ix,iy;
623 for (Int_t i=0;i<n;i++) {
624 ix = XtoPDF(xw[i]);
625 iy = YtoPDF(yw[i]);
626 // Dot (.)
627 if (ms == 1) {
628 MoveTo(ix-1, iy);
629 LineTo(ix , iy);
630 // Plus (+)
631 } else if (ms == 2) {
632 MoveTo(ix-m2, iy);
633 LineTo(ix+m2, iy);
634 MoveTo(ix , iy-m2);
635 LineTo(ix , iy+m2);
636 // X shape (X)
637 } else if (ms == 5) {
638 MoveTo(ix-m2*0.707, iy-m2*0.707);
639 LineTo(ix+m2*0.707, iy+m2*0.707);
640 MoveTo(ix-m2*0.707, iy+m2*0.707);
641 LineTo(ix+m2*0.707, iy-m2*0.707);
642 // Asterisk shape (*)
643 } else if (ms == 3 || ms == 31) {
644 MoveTo(ix-m2, iy);
645 LineTo(ix+m2, iy);
646 MoveTo(ix , iy-m2);
647 LineTo(ix , iy+m2);
648 MoveTo(ix-m2*0.707, iy-m2*0.707);
649 LineTo(ix+m2*0.707, iy+m2*0.707);
650 MoveTo(ix-m2*0.707, iy+m2*0.707);
651 LineTo(ix+m2*0.707, iy-m2*0.707);
652 // Circle
653 } else if (ms == 24 || ms == 20) {
654 MoveTo(ix-m2, iy);
655 WriteReal(ix-m2); WriteReal(iy+m4);
656 WriteReal(ix+m2); WriteReal(iy+m4);
657 WriteReal(ix+m2); WriteReal(iy) ; PrintFast(2," c");
658 WriteReal(ix+m2); WriteReal(iy-m4);
659 WriteReal(ix-m2); WriteReal(iy-m4);
660 WriteReal(ix-m2); WriteReal(iy) ; PrintFast(4," c h");
661 // Square
662 } else if (ms == 25 || ms == 21) {
663 WriteReal(ix-m2); WriteReal(iy-m2);
664 WriteReal(m) ; WriteReal(m) ; PrintFast(3," re");
665 // Down triangle
666 } else if (ms == 23 || ms == 32) {
667 MoveTo(ix , iy-m2);
668 LineTo(ix+m2, iy+m2);
669 LineTo(ix-m2, iy+m2);
670 PrintFast(2," h");
671 // Up triangle
672 } else if (ms == 26 || ms == 22) {
673 MoveTo(ix-m2, iy-m2);
674 LineTo(ix+m2, iy-m2);
675 LineTo(ix , iy+m2);
676 PrintFast(2," h");
677 } else if (ms == 27 || ms == 33) {
678 MoveTo(ix , iy-m2);
679 LineTo(ix+m3, iy);
680 LineTo(ix , iy+m2);
681 LineTo(ix-m3, iy) ;
682 PrintFast(2," h");
683 } else if (ms == 28 || ms == 34) {
684 MoveTo(ix-m6, iy-m6);
685 LineTo(ix-m6, iy-m2);
686 LineTo(ix+m6, iy-m2);
687 LineTo(ix+m6, iy-m6);
688 LineTo(ix+m2, iy-m6);
689 LineTo(ix+m2, iy+m6);
690 LineTo(ix+m6, iy+m6);
691 LineTo(ix+m6, iy+m2);
692 LineTo(ix-m6, iy+m2);
693 LineTo(ix-m6, iy+m6);
694 LineTo(ix-m2, iy+m6);
695 LineTo(ix-m2, iy-m6);
696 PrintFast(2," h");
697 } else if (ms == 29 || ms == 30) {
698 MoveTo(ix , iy+m2);
699 LineTo(ix+0.112255*m, iy+0.15451*m);
700 LineTo(ix+0.47552*m , iy+0.15451*m);
701 LineTo(ix+0.181635*m, iy-0.05902*m);
702 LineTo(ix+0.29389*m , iy-0.40451*m);
703 LineTo(ix , iy-0.19098*m);
704 LineTo(ix-0.29389*m , iy-0.40451*m);
705 LineTo(ix-0.181635*m, iy-0.05902*m);
706 LineTo(ix-0.47552*m , iy+0.15451*m);
707 LineTo(ix-0.112255*m, iy+0.15451*m);
708 PrintFast(2," h");
709 } else if (ms == 35 ) {
710 // diamond with cross
711 MoveTo(ix-m2, iy );
712 LineTo(ix , iy-m2);
713 LineTo(ix+m2, iy );
714 LineTo(ix , iy+m2);
715 LineTo(ix-m2, iy );
716 LineTo(ix+m2, iy );
717 LineTo(ix , iy+m2);
718 LineTo(ix , iy-m2);
719 PrintFast(2," h");
720 } else if (ms == 36 ) {
721 // square with diagonal cross
722 MoveTo(ix-m2, iy-m2);
723 LineTo(ix+m2, iy-m2);
724 LineTo(ix+m2, iy+m2);
725 LineTo(ix-m2, iy+m2);
726 LineTo(ix-m2, iy-m2);
727 LineTo(ix+m2, iy+m2);
728 LineTo(ix-m2, iy+m2);
729 LineTo(ix+m2, iy-m2);
730 PrintFast(2," h");
731 } else if (ms == 37 || ms == 39 ) {
732 // square with cross
733 MoveTo(ix , iy );
734 LineTo(ix-m8, iy+m2);
735 LineTo(ix-m2, iy );
736 LineTo(ix , iy );
737 LineTo(ix-m8, iy-m2);
738 LineTo(ix+m8, iy-m2);
739 LineTo(ix , iy );
740 LineTo(ix+m2, iy );
741 LineTo(ix+m8, iy+m2);
742 LineTo(ix , iy );
743 PrintFast(2," h");
744 } else if (ms == 38 ) {
745 // + shaped marker with octagon
746 MoveTo(ix-m2, iy );
747 LineTo(ix-m2, iy-m8);
748 LineTo(ix-m8, iy-m2);
749 LineTo(ix+m8, iy-m2);
750 LineTo(ix+m2, iy-m8);
751 LineTo(ix+m2, iy+m8);
752 LineTo(ix+m8, iy+m2);
753 LineTo(ix-m8, iy+m2);
754 LineTo(ix-m2, iy+m8);
755 LineTo(ix-m2, iy );
756 LineTo(ix+m2, iy );
757 LineTo(ix , iy );
758 LineTo(ix , iy-m2);
759 LineTo(ix , iy+m2);
760 LineTo(ix , iy);
761 PrintFast(2," h");
762 } else if (ms == 40 || ms == 41 ) {
763 // four triangles X
764 MoveTo(ix , iy );
765 LineTo(ix+m8, iy+m2);
766 LineTo(ix+m2, iy+m8);
767 LineTo(ix , iy );
768 LineTo(ix+m2, iy-m8);
769 LineTo(ix+m8, iy-m2);
770 LineTo(ix , iy );
771 LineTo(ix-m8, iy-m2);
772 LineTo(ix-m2, iy-m8);
773 LineTo(ix , iy );
774 LineTo(ix-m2, iy+m8);
775 LineTo(ix-m8, iy+m2);
776 LineTo(ix , iy );
777 PrintFast(2," h");
778 } else if (ms == 42 || ms == 43 ) {
779 // double diamonds
780 MoveTo(ix , iy+m2);
781 LineTo(ix-m9, iy+m9);
782 LineTo(ix-m2, iy );
783 LineTo(ix-m9, iy-m9);
784 LineTo(ix , iy-m2);
785 LineTo(ix+m9, iy-m9);
786 LineTo(ix+m2, iy );
787 LineTo(ix+m9, iy+m9);
788 LineTo(ix , iy+m2);
789 PrintFast(2," h");
790 } else if (ms == 44 ) {
791 // open four triangles plus
792 MoveTo(ix , iy );
793 LineTo(ix+m8, iy+m2);
794 LineTo(ix-m8, iy+m2);
795 LineTo(ix+m8, iy-m2);
796 LineTo(ix-m8, iy-m2);
797 LineTo(ix , iy );
798 LineTo(ix+m2, iy+m8);
799 LineTo(ix+m2, iy-m8);
800 LineTo(ix-m2, iy+m8);
801 LineTo(ix-m2, iy-m8);
802 LineTo(ix , iy );
803 PrintFast(2," h");
804 } else if (ms == 45 ) {
805 // filled four triangles plus
806 MoveTo(ix+m0, iy+m0);
807 LineTo(ix+m8, iy+m2);
808 LineTo(ix-m8, iy+m2);
809 LineTo(ix-m0, iy+m0);
810 LineTo(ix-m2, iy+m8);
811 LineTo(ix-m2, iy-m8);
812 LineTo(ix-m0, iy-m0);
813 LineTo(ix-m8, iy-m2);
814 LineTo(ix+m8, iy-m2);
815 LineTo(ix+m0, iy-m0);
816 LineTo(ix+m2, iy-m8);
817 LineTo(ix+m2, iy+m8);
818 LineTo(ix+m0, iy+m0);
819 PrintFast(2," h");
820 } else if (ms == 46 || ms == 47 ) {
821 // four triangles X
822 MoveTo(ix , iy+m8);
823 LineTo(ix-m8, iy+m2);
824 LineTo(ix-m2, iy+m8);
825 LineTo(ix-m8, iy );
826 LineTo(ix-m2, iy-m8);
827 LineTo(ix-m8, iy-m2);
828 LineTo(ix , iy-m8);
829 LineTo(ix+m8, iy-m2);
830 LineTo(ix+m2, iy-m8);
831 LineTo(ix+m8, iy );
832 LineTo(ix+m2, iy+m8);
833 LineTo(ix+m8, iy+m2);
834 LineTo(ix , iy+m8);
835 PrintFast(2," h");
836 } else if (ms == 48 ) {
837 // four filled squares X
838 MoveTo(ix , iy+m8*1.01);
839 LineTo(ix-m8, iy+m2);
840 LineTo(ix-m2, iy+m8);
841 LineTo(ix-m8, iy );
842 LineTo(ix-m2, iy-m8);
843 LineTo(ix-m8, iy-m2);
844 LineTo(ix , iy-m8);
845 LineTo(ix+m8, iy-m2);
846 LineTo(ix+m2, iy-m8);
847 LineTo(ix+m8, iy );
848 LineTo(ix+m2, iy+m8);
849 LineTo(ix+m8, iy+m2);
850 LineTo(ix , iy+m8*0.99);
851 LineTo(ix+m8*0.99, iy );
852 LineTo(ix , iy-m8*0.99);
853 LineTo(ix-m8*0.99, iy );
854 LineTo(ix , iy+m8*0.99);
855 PrintFast(2," h");
856 } else if (ms == 49 ) {
857 // four filled squares plus
858 MoveTo(ix-m6, iy-m6*1.01);
859 LineTo(ix-m6, iy-m2);
860 LineTo(ix+m6, iy-m2);
861 LineTo(ix+m6, iy-m6);
862 LineTo(ix+m2, iy-m6);
863 LineTo(ix+m2, iy+m6);
864 LineTo(ix+m6, iy+m6);
865 LineTo(ix+m6, iy+m2);
866 LineTo(ix-m6, iy+m2);
867 LineTo(ix-m6, iy+m6);
868 LineTo(ix-m2, iy+m6);
869 LineTo(ix-m2, iy-m6);
870 LineTo(ix-m6, iy-m6*0.99);
871 LineTo(ix-m6, iy+m6);
872 LineTo(ix+m6, iy+m6);
873 LineTo(ix+m6, iy-m6);
874 PrintFast(2," h");
875 } else {
876 MoveTo(ix-m6, iy-m6);
877 LineTo(ix-m6, iy-m2);
878 }
879
880 if ((ms > 19 && ms < 24) || ms == 29 || ms == 33 || ms == 34 ||
881 ms == 39 || ms == 41 || ms == 43 || ms == 45 ||
882 ms == 47 || ms == 48 || ms == 49) {
883 PrintFast(2," f");
884 } else {
885 PrintFast(2," S");
886 }
887 }
888
891}
892
893////////////////////////////////////////////////////////////////////////////////
894/// Draw markers at the n WC points xw, yw
895
897{
901 SetLineStyle(1);
905
906 if (ms == 4)
907 ms = 24;
908 else if (ms >= 6 && ms <= 8)
909 ms = 20;
910 else if (ms >= 9 && ms <= 19)
911 ms = 1;
912
913 // Define the marker size
915 if (fMarkerStyle == 1 || (fMarkerStyle >= 9 && fMarkerStyle <= 19)) {
916 msize = 1.;
917 } else if (fMarkerStyle == 6) {
918 msize = 1.5;
919 } else if (fMarkerStyle == 7) {
920 msize = 3.;
921 } else {
922 const Int_t kBASEMARKER = 8;
924 Float_t s2x = sbase / Float_t(gPad->GetWw() * gPad->GetAbsWNDC());
925 msize = this->UtoPDF(s2x) - this->UtoPDF(0);
926 }
927
928 Double_t m = msize;
929 Double_t m2 = m/2;
930 Double_t m3 = m/3;
931 Double_t m4 = m2*1.333333333333;
932 Double_t m6 = m/6;
933 Double_t m8 = m/4;
934 Double_t m9 = m/8;
935
936 // Draw the marker according to the type
937 Double_t ix,iy;
938 for (Int_t i=0;i<n;i++) {
939 ix = XtoPDF(xw[i]);
940 iy = YtoPDF(yw[i]);
941 // Dot (.)
942 if (ms == 1) {
943 MoveTo(ix-1, iy);
944 LineTo(ix , iy);
945 // Plus (+)
946 } else if (ms == 2) {
947 MoveTo(ix-m2, iy);
948 LineTo(ix+m2, iy);
949 MoveTo(ix , iy-m2);
950 LineTo(ix , iy+m2);
951 // X shape (X)
952 } else if (ms == 5) {
953 MoveTo(ix-m2*0.707, iy-m2*0.707);
954 LineTo(ix+m2*0.707, iy+m2*0.707);
955 MoveTo(ix-m2*0.707, iy+m2*0.707);
956 LineTo(ix+m2*0.707, iy-m2*0.707);
957 // Asterisk shape (*)
958 } else if (ms == 3 || ms == 31) {
959 MoveTo(ix-m2, iy);
960 LineTo(ix+m2, iy);
961 MoveTo(ix , iy-m2);
962 LineTo(ix , iy+m2);
963 MoveTo(ix-m2*0.707, iy-m2*0.707);
964 LineTo(ix+m2*0.707, iy+m2*0.707);
965 MoveTo(ix-m2*0.707, iy+m2*0.707);
966 LineTo(ix+m2*0.707, iy-m2*0.707);
967 // Circle
968 } else if (ms == 24 || ms == 20) {
969 MoveTo(ix-m2, iy);
970 WriteReal(ix-m2); WriteReal(iy+m4);
971 WriteReal(ix+m2); WriteReal(iy+m4);
972 WriteReal(ix+m2); WriteReal(iy) ; PrintFast(2," c");
973 WriteReal(ix+m2); WriteReal(iy-m4);
974 WriteReal(ix-m2); WriteReal(iy-m4);
975 WriteReal(ix-m2); WriteReal(iy) ; PrintFast(4," c h");
976 // Square
977 } else if (ms == 25 || ms == 21) {
978 WriteReal(ix-m2); WriteReal(iy-m2);
979 WriteReal(m) ; WriteReal(m) ; PrintFast(3," re");
980 // Down triangle
981 } else if (ms == 23 || ms == 32) {
982 MoveTo(ix , iy-m2);
983 LineTo(ix+m2, iy+m2);
984 LineTo(ix-m2, iy+m2);
985 PrintFast(2," h");
986 // Up triangle
987 } else if (ms == 26 || ms == 22) {
988 MoveTo(ix-m2, iy-m2);
989 LineTo(ix+m2, iy-m2);
990 LineTo(ix , iy+m2);
991 PrintFast(2," h");
992 } else if (ms == 27 || ms == 33) {
993 MoveTo(ix , iy-m2);
994 LineTo(ix+m3, iy);
995 LineTo(ix , iy+m2);
996 LineTo(ix-m3, iy) ;
997 PrintFast(2," h");
998 } else if (ms == 28 || ms == 34) {
999 MoveTo(ix-m6, iy-m6);
1000 LineTo(ix-m6, iy-m2);
1001 LineTo(ix+m6, iy-m2);
1002 LineTo(ix+m6, iy-m6);
1003 LineTo(ix+m2, iy-m6);
1004 LineTo(ix+m2, iy+m6);
1005 LineTo(ix+m6, iy+m6);
1006 LineTo(ix+m6, iy+m2);
1007 LineTo(ix-m6, iy+m2);
1008 LineTo(ix-m6, iy+m6);
1009 LineTo(ix-m2, iy+m6);
1010 LineTo(ix-m2, iy-m6);
1011 PrintFast(2," h");
1012 } else if (ms == 29 || ms == 30) {
1013 MoveTo(ix , iy-m2);
1014 LineTo(ix-0.112255*m, iy-0.15451*m);
1015 LineTo(ix-0.47552*m , iy-0.15451*m);
1016 LineTo(ix-0.181635*m, iy+0.05902*m);
1017 LineTo(ix-0.29389*m , iy+0.40451*m);
1018 LineTo(ix , iy+0.19098*m);
1019 LineTo(ix+0.29389*m , iy+0.40451*m);
1020 LineTo(ix+0.181635*m, iy+0.05902*m);
1021 LineTo(ix+0.47552*m , iy-0.15451*m);
1022 LineTo(ix+0.112255*m, iy-0.15451*m);
1023 PrintFast(2," h");
1024 } else if (ms == 35 ) {
1025 MoveTo(ix-m2, iy );
1026 LineTo(ix , iy-m2);
1027 LineTo(ix+m2, iy );
1028 LineTo(ix , iy+m2);
1029 LineTo(ix-m2, iy );
1030 LineTo(ix+m2, iy );
1031 LineTo(ix , iy+m2);
1032 LineTo(ix , iy-m2);
1033 PrintFast(2," h");
1034 } else if (ms == 36 ) {
1035 MoveTo(ix-m2, iy-m2);
1036 LineTo(ix+m2, iy-m2);
1037 LineTo(ix+m2, iy+m2);
1038 LineTo(ix-m2, iy+m2);
1039 LineTo(ix-m2, iy-m2);
1040 LineTo(ix+m2, iy+m2);
1041 LineTo(ix-m2, iy+m2);
1042 LineTo(ix+m2, iy-m2);
1043 PrintFast(2," h");
1044 } else if (ms == 37 || ms == 39 ) {
1045 MoveTo(ix , iy );
1046 LineTo(ix-m8, iy+m2);
1047 LineTo(ix-m2, iy );
1048 LineTo(ix , iy );
1049 LineTo(ix-m8, iy-m2);
1050 LineTo(ix+m8, iy-m2);
1051 LineTo(ix , iy );
1052 LineTo(ix+m2, iy );
1053 LineTo(ix+m8, iy+m2);
1054 LineTo(ix , iy );
1055 PrintFast(2," h");
1056 } else if (ms == 38 ) {
1057 MoveTo(ix-m2, iy );
1058 LineTo(ix-m2, iy-m8);
1059 LineTo(ix-m8, iy-m2);
1060 LineTo(ix+m8, iy-m2);
1061 LineTo(ix+m2, iy-m8);
1062 LineTo(ix+m2, iy+m8);
1063 LineTo(ix+m8, iy+m2);
1064 LineTo(ix-m8, iy+m2);
1065 LineTo(ix-m2, iy+m8);
1066 LineTo(ix-m2, iy );
1067 LineTo(ix+m2, iy );
1068 LineTo(ix , iy );
1069 LineTo(ix , iy-m2);
1070 LineTo(ix , iy+m2);
1071 LineTo(ix , iy );
1072 PrintFast(2," h");
1073 } else if (ms == 40 || ms == 41 ) {
1074 MoveTo(ix , iy );
1075 LineTo(ix+m8, iy+m2);
1076 LineTo(ix+m2, iy+m8);
1077 LineTo(ix , iy );
1078 LineTo(ix+m2, iy-m8);
1079 LineTo(ix+m8, iy-m2);
1080 LineTo(ix , iy );
1081 LineTo(ix-m8, iy-m2);
1082 LineTo(ix-m2, iy-m8);
1083 LineTo(ix , iy );
1084 LineTo(ix-m2, iy+m8);
1085 LineTo(ix-m8, iy+m2);
1086 LineTo(ix , iy );
1087 PrintFast(2," h");
1088 } else if (ms == 42 || ms == 43 ) {
1089 MoveTo(ix , iy+m2);
1090 LineTo(ix-m9, iy+m9);
1091 LineTo(ix-m2, iy );
1092 LineTo(ix-m9, iy-m9);
1093 LineTo(ix , iy-m2);
1094 LineTo(ix+m9, iy-m9);
1095 LineTo(ix+m2, iy );
1096 LineTo(ix+m9, iy+m9);
1097 LineTo(ix , iy+m2);
1098 PrintFast(2," h");
1099 } else if (ms == 44 ) {
1100 MoveTo(ix , iy );
1101 LineTo(ix+m8, iy+m2);
1102 LineTo(ix-m8, iy+m2);
1103 LineTo(ix+m8, iy-m2);
1104 LineTo(ix-m8, iy-m2);
1105 LineTo(ix , iy );
1106 LineTo(ix+m2, iy+m8);
1107 LineTo(ix+m2, iy-m8);
1108 LineTo(ix-m2, iy+m8);
1109 LineTo(ix-m2, iy-m8);
1110 LineTo(ix , iy );
1111 PrintFast(2," h");
1112 } else if (ms == 45 ) {
1113 MoveTo(ix+m6/2., iy+m6/2.);
1114 LineTo(ix+m8, iy+m2);
1115 LineTo(ix-m8, iy+m2);
1116 LineTo(ix-m6/2., iy+m6/2.);
1117 LineTo(ix-m2, iy+m8);
1118 LineTo(ix-m2, iy-m8);
1119 LineTo(ix-m6/2., iy-m6/2.);
1120 LineTo(ix-m8, iy-m2);
1121 LineTo(ix+m8, iy-m2);
1122 LineTo(ix+m6/2., iy-m6/2.);
1123 LineTo(ix+m2, iy-m8);
1124 LineTo(ix+m2, iy+m8);
1125 LineTo(ix+m6/2., iy+m6/2.);
1126 PrintFast(2," h");
1127 } else if (ms == 46 || ms == 47 ) {
1128 MoveTo(ix , iy+m8);
1129 LineTo(ix-m8, iy+m2);
1130 LineTo(ix-m2, iy+m8);
1131 LineTo(ix-m8, iy );
1132 LineTo(ix-m2, iy-m8);
1133 LineTo(ix-m8, iy-m2);
1134 LineTo(ix , iy-m8);
1135 LineTo(ix+m8, iy-m2);
1136 LineTo(ix+m2, iy-m8);
1137 LineTo(ix+m8, iy );
1138 LineTo(ix+m2, iy+m8);
1139 LineTo(ix+m8, iy+m2);
1140 LineTo(ix , iy+m8);
1141 PrintFast(2," h");
1142 } else if (ms == 48 ) {
1143 MoveTo(ix , iy+m8*1.005);
1144 LineTo(ix-m8, iy+m2);
1145 LineTo(ix-m2, iy+m8);
1146 LineTo(ix-m8, iy );
1147 LineTo(ix-m2, iy-m8);
1148 LineTo(ix-m8, iy-m2);
1149 LineTo(ix , iy-m8);
1150 LineTo(ix+m8, iy-m2);
1151 LineTo(ix+m2, iy-m8);
1152 LineTo(ix+m8, iy );
1153 LineTo(ix+m2, iy+m8);
1154 LineTo(ix+m8, iy+m2);
1155 LineTo(ix , iy+m8*0.995);
1156 LineTo(ix+m8*0.995, iy );
1157 LineTo(ix , iy-m8*0.995);
1158 LineTo(ix-m8*0.995, iy );
1159 LineTo(ix , iy+m8*0.995);
1160 PrintFast(2," h");
1161 } else if (ms == 49 ) {
1162 MoveTo(ix-m6, iy-m6*1.01);
1163 LineTo(ix-m6, iy-m2);
1164 LineTo(ix+m6, iy-m2);
1165 LineTo(ix+m6, iy-m6);
1166 LineTo(ix+m2, iy-m6);
1167 LineTo(ix+m2, iy+m6);
1168 LineTo(ix+m6, iy+m6);
1169 LineTo(ix+m6, iy+m2);
1170 LineTo(ix-m6, iy+m2);
1171 LineTo(ix-m6, iy+m6);
1172 LineTo(ix-m2, iy+m6);
1173 LineTo(ix-m2, iy-m6);
1174 LineTo(ix-m6, iy-m6*0.99);
1175 LineTo(ix-m6, iy+m6);
1176 LineTo(ix+m6, iy+m6);
1177 LineTo(ix+m6, iy-m6);
1178 MoveTo(ix-m6, iy-m6*1.01);
1179 PrintFast(2," h");
1180 } else {
1181 MoveTo(ix-1, iy);
1182 LineTo(ix , iy);
1183 }
1184 if ((ms > 19 && ms < 24) || ms == 29 || ms == 33 || ms == 34 ||
1185 ms == 39 || ms == 41 || ms == 43 || ms == 45 ||
1186 ms == 47 || ms == 48 || ms == 49) {
1187 PrintFast(2," f");
1188 } else {
1189 PrintFast(2," S");
1190 }
1191 }
1192
1195}
1196
1197////////////////////////////////////////////////////////////////////////////////
1198/// Draw a PolyLine
1199///
1200/// Draw a polyline through the points xw,yw.
1201///
1202/// - If nn=1 moves only to point xw,yw.
1203/// - If nn=0 the XW(1) and YW(1) are written in the PDF file
1204/// according to the current NT.
1205/// - If nn>0 the line is clipped as a line.
1206/// - If nn<0 the line is clipped as a fill area.
1207
1209{
1210 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1211 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1212 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1213 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1214 180, 90,135, 45,150, 30,120, 60,
1215 180, 90,135, 45,150, 30,120, 60};
1216 Int_t n = 0, fais = 0 , fasi = 0;
1217
1220
1221 if (nn > 0) {
1222 if (fLineWidth<=0) return;
1223 n = nn;
1227 }
1228 if (nn < 0) {
1229 n = -nn;
1230 SetLineStyle(1);
1231 SetLineWidth(1);
1233 fais = fFillStyle/1000;
1234 fasi = fFillStyle%1000;
1235 if (fais == 3 || fais == 2) {
1236 if (fasi > 100 && fasi <125) {
1237 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1240 return;
1241 }
1242 if (fasi > 0 && fasi < 26) {
1244 }
1245 }
1246 }
1247
1248 WriteReal(XtoPDF(xw[0]));
1249 WriteReal(YtoPDF(yw[0]));
1250 if (n <= 1) {
1251 if (n == 0) return;
1252 PrintFast(2," m");
1253 return;
1254 }
1255
1256 PrintFast(2," m");
1257
1258 for (Int_t i=1;i<n;i++) LineTo(XtoPDF(xw[i]), YtoPDF(yw[i]));
1259
1260 if (nn > 0) {
1261 if (xw[0] == xw[n-1] && yw[0] == yw[n-1]) PrintFast(2," h");
1262 PrintFast(2," S");
1263 } else {
1264 if (fais == 0) {PrintFast(2," s"); return;}
1265 if (fais == 3 || fais == 2) {
1266 if (fasi > 0 && fasi < 26) {
1267 PrintFast(3," f*");
1268 fRed = -1;
1269 fGreen = -1;
1270 fBlue = -1;
1271 fAlpha = -1.;
1272 }
1275 return;
1276 }
1277 PrintFast(3," f*");
1278 }
1279
1282}
1283
1284////////////////////////////////////////////////////////////////////////////////
1285/// Draw a PolyLine
1286///
1287/// Draw a polyline through the points xw,yw.
1288///
1289/// - If nn=1 moves only to point xw,yw.
1290/// - If nn=0 the xw(1) and YW(1) are written in the PDF file
1291/// according to the current NT.
1292/// - If nn>0 the line is clipped as a line.
1293/// - If nn<0 the line is clipped as a fill area.
1294
1296{
1297 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1298 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1299 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1300 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1301 180, 90,135, 45,150, 30,120, 60,
1302 180, 90,135, 45,150, 30,120, 60};
1303 Int_t n = 0, fais = 0, fasi = 0;
1304
1307
1308 if (nn > 0) {
1309 if (fLineWidth<=0) return;
1310 n = nn;
1314 }
1315 if (nn < 0) {
1316 n = -nn;
1317 SetLineStyle(1);
1318 SetLineWidth(1);
1320 fais = fFillStyle/1000;
1321 fasi = fFillStyle%1000;
1322 if (fais == 3 || fais == 2) {
1323 if (fasi > 100 && fasi <125) {
1324 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1327 return;
1328 }
1329 if (fasi > 0 && fasi < 26) {
1331 }
1332 }
1333 }
1334
1335 WriteReal(XtoPDF(xw[0]));
1336 WriteReal(YtoPDF(yw[0]));
1337 if (n <= 1) {
1338 if (n == 0) return;
1339 PrintFast(2," m");
1340 return;
1341 }
1342
1343 PrintFast(2," m");
1344
1345 for (Int_t i=1;i<n;i++) LineTo(XtoPDF(xw[i]), YtoPDF(yw[i]));
1346
1347 if (nn > 0) {
1348 if (xw[0] == xw[n-1] && yw[0] == yw[n-1]) PrintFast(2," h");
1349 PrintFast(2," S");
1350 } else {
1351 if (fais == 0) {PrintFast(2," s"); return;}
1352 if (fais == 3 || fais == 2) {
1353 if (fasi > 0 && fasi < 26) {
1354 PrintFast(3," f*");
1355 fRed = -1;
1356 fGreen = -1;
1357 fBlue = -1;
1358 fAlpha = -1.;
1359 }
1362 return;
1363 }
1364 PrintFast(3," f*");
1365 }
1366
1369}
1370
1371////////////////////////////////////////////////////////////////////////////////
1372/// Close the current opened object
1373
1375{
1376 if (!fgObjectIsOpen)
1377 Warning("TPDF::EndObject", "No Object currently opened.");
1379
1380 PrintStr("endobj@");
1381}
1382
1383////////////////////////////////////////////////////////////////////////////////
1384/// Font encoding
1385
1387{
1388 static const char *sdtfonts[] = {
1389 "/Times-Italic" , "/Times-Bold" , "/Times-BoldItalic",
1390 "/Helvetica" , "/Helvetica-Oblique" , "/Helvetica-Bold" ,
1391 "/Helvetica-BoldOblique", "/Courier" , "/Courier-Oblique" ,
1392 "/Courier-Bold" , "/Courier-BoldOblique", "/Symbol" ,
1393 "/Times-Roman" , "/ZapfDingbats" , "/Symbol"};
1394
1395 for (Int_t i=0; i<kNumberOfFonts; i++) {
1397 PrintStr("<<@");
1398 PrintStr("/Type /Font@");
1399 PrintStr("/Subtype /Type1@");
1400 PrintStr("/Name /F");
1401 WriteInteger(i+1,false);
1402 PrintStr("@");
1403 PrintStr("/BaseFont ");
1404 PrintStr(sdtfonts[i]);
1405 PrintStr("@");
1406 if (i!=11 && i!=13 && i!=14) {
1407 PrintStr("/Encoding /WinAnsiEncoding");
1408 PrintStr("@");
1409 }
1410 PrintStr(">>@");
1411 EndObject();
1412 }
1413}
1414
1415////////////////////////////////////////////////////////////////////////////////
1416/// Draw a line to a new position
1417
1419{
1420 WriteReal(x);
1421 WriteReal(y);
1422 PrintFast(2," l");
1423}
1424
1425////////////////////////////////////////////////////////////////////////////////
1426/// Move to a new position
1427
1429{
1430 WriteReal(x);
1431 WriteReal(y);
1432 PrintFast(2," m");
1433}
1434
1435////////////////////////////////////////////////////////////////////////////////
1436/// Create a new object in the PDF file
1437
1439{
1440 if (fgObjectIsOpen)
1441 Warning("TPDF::NewObject", "An Object is already open.");
1443 if (!fObjPos || n >= fObjPosSize) {
1445 Int_t *saveo = new Int_t [newN];
1446 if (fObjPos && fObjPosSize) {
1449 delete [] fObjPos;
1450 }
1451 fObjPos = saveo;
1452 fObjPosSize = newN;
1453 }
1454 fObjPos[n-1] = fNByte;
1456 WriteInteger(n, false);
1457 PrintStr(" 0 obj");
1458 PrintStr("@");
1459}
1460
1461////////////////////////////////////////////////////////////////////////////////
1462/// Start a new PDF page.
1463
1465{
1466 if (!fPageNotEmpty) return;
1467
1468 // Compute pad conversion coefficients
1469 if (gPad) {
1470 Double_t ww = gPad->GetWw();
1471 Double_t wh = gPad->GetWh();
1472 fYsize = fXsize*wh/ww;
1473 } else {
1474 fYsize = 27;
1475 }
1476
1477 fNbPage++;
1478
1479 if (fNbPage>1) {
1480 // Close the currently opened page
1482 PrintStr("endstream@");
1484 EndObject();
1486 WriteInteger(streamLength, false);
1487 PrintStr("@");
1488 EndObject();
1490 PrintStr("<<@");
1491 if (!strstr(GetTitle(),"PDF")) {
1492 PrintStr("/Title (");
1493 PrintStr(GetTitle());
1494 PrintStr(")@");
1495 } else {
1496 PrintStr("/Title (Page");
1498 PrintStr(")@");
1499 }
1500 PrintStr("/Dest [");
1502 PrintStr(" 0 R /XYZ null null 0]@");
1503 PrintStr("/Parent");
1505 PrintStr(" 0 R");
1506 PrintStr("@");
1507 PrintStr("/Next");
1509 PrintStr(" 0 R");
1510 PrintStr("@");
1511 if (fNbPage>2) {
1512 PrintStr("/Prev");
1514 PrintStr(" 0 R");
1515 PrintStr("@");
1516 }
1517 PrintStr(">>@");
1518 EndObject();
1519 }
1520
1521 // Start a new page
1523 PrintStr("<<@");
1524 PrintStr("/Type /Page@");
1525 PrintStr("@");
1526 PrintStr("/Parent");
1528 PrintStr(" 0 R");
1529 PrintStr("@");
1530
1531 Double_t xlow=0, ylow=0, xup=1, yup=1;
1532 if (gPad) {
1533 xlow = gPad->GetAbsXlowNDC();
1534 xup = xlow + gPad->GetAbsWNDC();
1535 ylow = gPad->GetAbsYlowNDC();
1536 yup = ylow + gPad->GetAbsHNDC();
1537 }
1538
1539 PrintStr("/MediaBox [");
1541 switch (fPageFormat) {
1542 case 100 :
1543 width = 8.5*2.54;
1544 height = 11.*2.54;
1545 break;
1546 case 200 :
1547 width = 8.5*2.54;
1548 height = 14.*2.54;
1549 break;
1550 case 300 :
1551 width = 11.*2.54;
1552 height = 17.*2.54;
1553 break;
1554 default :
1557 };
1558 WriteReal(CMtoPDF(fXsize*xlow));
1559 WriteReal(CMtoPDF(fYsize*ylow));
1562 PrintStr("]");
1563 PrintStr("@");
1564
1565 Double_t xmargin = CMtoPDF(0.7);
1566 Double_t ymargin = 0;
1567 if (fPageOrientation == 1) ymargin = CMtoPDF(TMath::Sqrt(2.)*0.7);
1568 if (fPageOrientation == 2) ymargin = CMtoPDF(height)-CMtoPDF(0.7);
1569
1570 PrintStr("/CropBox [");
1571 if (fPageOrientation == 1) {
1576 }
1577 if (fPageOrientation == 2) {
1582 }
1583 PrintStr("]");
1584 PrintStr("@");
1585
1586 if (fPageOrientation == 1) PrintStr("/Rotate 0@");
1587 if (fPageOrientation == 2) PrintStr("/Rotate 90@");
1588
1589 PrintStr("/Resources");
1591 PrintStr(" 0 R");
1592 PrintStr("@");
1593
1594 PrintStr("/Contents");
1596 PrintStr(" 0 R@");
1597 PrintStr(">>@");
1598 EndObject();
1599
1601 PrintStr("<<@");
1602 PrintStr("/Length");
1604 PrintStr(" 0 R@");
1605 PrintStr("/Filter [/FlateDecode]@");
1606 PrintStr(">>@");
1607 PrintStr("stream@");
1609 fCompress = kTRUE;
1610
1611 // Force the line width definition next time TPDF::SetLineWidth will be called.
1612 fLineWidth = -1;
1613
1614 // Force the color definition next time TPDF::SetColor will be called.
1615 fRed = -1;
1616 fGreen = -1;
1617 fBlue = -1;
1618 fAlpha = -1.;
1619
1620 PrintStr("1 0 0 1");
1621 if (fPageOrientation == 2) {
1624 }
1627 PrintStr(" cm");
1628 if (fPageOrientation == 2) PrintStr(" 0 1 -1 0 0 0 cm");
1629 if (fgLineJoin) {
1631 PrintFast(2," j");
1632 }
1633 if (fgLineCap) {
1635 PrintFast(2," J");
1636 }
1637}
1638
1639////////////////////////////////////////////////////////////////////////////////
1640/// Deactivate an already open PDF file
1641
1643{
1644 gVirtualPS = nullptr;
1645}
1646
1647////////////////////////////////////////////////////////////////////////////////
1648/// Activate an already open PDF file
1649
1651{
1652 // fType is used to know if the PDF file is open. Unlike TPostScript, TPDF
1653 // has no "workstation type".
1654
1655 if (!fType) {
1656 Error("On", "no PDF file open");
1657 Off();
1658 return;
1659 }
1660 gVirtualPS = this;
1661}
1662
1663////////////////////////////////////////////////////////////////////////////////
1664/// Open a PDF file
1665
1666void TPDF::Open(const char *fname, Int_t wtype)
1667{
1668 Int_t i;
1669
1670 if (fStream) {
1671 Warning("Open", "PDF file already open");
1672 return;
1673 }
1674
1675 fLenBuffer = 0;
1676 fRed = -1;
1677 fGreen = -1;
1678 fBlue = -1;
1679 fAlpha = -1.;
1680 fType = abs(wtype);
1686 if (gPad) {
1687 Double_t ww = gPad->GetWw();
1688 Double_t wh = gPad->GetWh();
1689 if (fType == 113) {
1690 ww *= gPad->GetWNDC();
1691 wh *= gPad->GetHNDC();
1692 }
1693 Double_t ratio = wh/ww;
1694 xrange = fXsize;
1695 yrange = fXsize*ratio;
1696 if (yrange > fYsize) { yrange = fYsize; xrange = yrange/ratio;}
1698 }
1699
1700 // Open OS file
1701 fStream = new std::ofstream();
1702#ifdef R__WIN32
1703 fStream->open(fname, std::ofstream::out | std::ofstream::binary);
1704#else
1705 fStream->open(fname, std::ofstream::out);
1706#endif
1707 if (!fStream || !fStream->good()) {
1708 printf("ERROR in TPDF::Open: Cannot open file:%s\n",fname);
1709 if (!fStream) return;
1710 }
1711
1712 gVirtualPS = this;
1713
1714 for (i=0; i<fSizBuffer; i++) fBuffer[i] = ' ';
1715
1716 // The page orientation is last digit of PDF workstation type
1717 // orientation = 1 for portrait
1718 // orientation = 2 for landscape
1721 Error("Open", "Invalid page orientation %d", fPageOrientation);
1722 return;
1723 }
1724
1725 // format = 0-99 is the European page format (A4,A3 ...)
1726 // format = 100 is the US format 8.5x11.0 inch
1727 // format = 200 is the US format 8.5x14.0 inch
1728 // format = 300 is the US format 11.0x17.0 inch
1729 fPageFormat = fType/1000;
1730 if (fPageFormat == 0) fPageFormat = 4;
1731 if (fPageFormat == 99) fPageFormat = 0;
1732
1733 fRange = kFALSE;
1734
1735 // Set a default range
1737
1738 fObjPos = nullptr;
1739 fObjPosSize = 0;
1740 fNbObj = 0;
1741 fNbPage = 0;
1742
1743 PrintStr("%PDF-1.4@");
1744 PrintStr("%\342\343\317\323");
1745 PrintStr("@");
1746
1748 PrintStr("<<@");
1749 PrintStr("/Type /Catalog@");
1750 PrintStr("/Pages");
1752 PrintStr(" 0 R@");
1753 PrintStr("/Outlines");
1755 PrintStr(" 0 R@");
1756 PrintStr("/PageMode /UseOutlines@");
1757 PrintStr(">>@");
1758 EndObject();
1759
1761 PrintStr("<<@");
1762 PrintStr("/Creator (ROOT Version ");
1763 PrintStr(gROOT->GetVersion());
1764 PrintStr(")");
1765 PrintStr("@");
1766 PrintStr("/CreationDate (");
1767 TDatime t;
1768 Int_t toff = t.Convert(kFALSE) - t.Convert(kTRUE); // time zone and dst offset
1769 toff = toff/60;
1770 char str[24];
1771 snprintf(str,24,"D:%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d%c%2.2d'%2.2d'",
1772 t.GetYear() , t.GetMonth(),
1773 t.GetDay() , t.GetHour(),
1774 t.GetMinute(), t.GetSecond(),
1775 toff < 0 ? '-' : '+',
1776 // TMath::Abs(toff/60), TMath::Abs(toff%60)); // format-truncation warning
1777 TMath::Abs(toff/60) & 0x3F, TMath::Abs(toff%60) & 0x3F); // now 2 digits
1778 PrintStr(str);
1779 PrintStr(")");
1780 PrintStr("@");
1781 PrintStr("/ModDate (");
1782 PrintStr(str);
1783 PrintStr(")");
1784 PrintStr("@");
1785 PrintStr("/Title (");
1786 if (strlen(GetName())<=80) PrintStr(GetName());
1787 PrintStr(")");
1788 PrintStr("@");
1789 PrintStr("/Keywords (ROOT)@");
1790 PrintStr(">>@");
1791 EndObject();
1792
1794 PrintStr("<<@");
1795 PrintStr("/ProcSet [/PDF /Text]@");
1796
1797 PrintStr("/Font@");
1798 PrintStr("<<@");
1799 for (i=0; i<kNumberOfFonts; i++) {
1800 PrintStr(" /F");
1801 WriteInteger(i+1,false);
1803 PrintStr(" 0 R");
1804 }
1805 PrintStr("@");
1806 PrintStr(">>@");
1807
1808 PrintStr("/ExtGState");
1810 PrintStr(" 0 R @");
1811 if (!fAlphas.empty()) fAlphas.clear();
1812
1813 PrintStr("/ColorSpace << /Cs8");
1815 PrintStr(" 0 R >>");
1816 PrintStr("@");
1817 PrintStr("/Pattern");
1819 PrintStr(" 0 R");
1820 PrintStr("@");
1821 PrintStr(">>@");
1822 EndObject();
1823
1824 FontEncode();
1825 PatternEncode();
1826
1827 NewPage();
1829}
1830
1831////////////////////////////////////////////////////////////////////////////////
1832/// Output the string str in the output buffer
1833
1834void TPDF::PrintStr(const char *str)
1835{
1836 Int_t len = strlen(str);
1837 if (len == 0) return;
1839
1840 if (fCompress) {
1841 if (fLenBuffer+len >= fSizBuffer) {
1844 }
1845 strcpy(fBuffer + fLenBuffer, str);
1846 fLenBuffer += len;
1847 return;
1848 }
1849
1851}
1852
1853////////////////////////////////////////////////////////////////////////////////
1854/// Fast version of Print
1855
1856void TPDF::PrintFast(Int_t len, const char *str)
1857{
1859 if (fCompress) {
1860 if (fLenBuffer+len >= fSizBuffer) {
1863 }
1864 strcpy(fBuffer + fLenBuffer, str);
1865 fLenBuffer += len;
1866 return;
1867 }
1868
1870}
1871
1872////////////////////////////////////////////////////////////////////////////////
1873/// Set the range for the paper in centimetres
1874
1876{
1877 fXsize = xsize;
1878 fYsize = ysize;
1879 fRange = kTRUE;
1880}
1881
1882////////////////////////////////////////////////////////////////////////////////
1883/// Set the alpha channel value.
1884
1886{
1887 if (a == fAlpha) return;
1888 fAlpha = a;
1889 if (fAlpha <= 0.000001) fAlpha = 0;
1890
1891 Bool_t known = kFALSE;
1892 for (int i=0; i<(int)fAlphas.size(); i++) {
1893 if (fAlpha == fAlphas[i]) {
1894 known = kTRUE;
1895 break;
1896 }
1897 }
1898 if (!known) fAlphas.push_back(fAlpha);
1899 PrintStr(Form(" /ca%3.2f gs /CA%3.2f gs",fAlpha,fAlpha));
1900}
1901
1902////////////////////////////////////////////////////////////////////////////////
1903/// Set color with its color index.
1904
1906{
1907 if (color < 0) color = 0;
1908 TColor *col = gROOT->GetColor(color);
1909
1910 if (col) {
1911 SetColor(col->GetRed(), col->GetGreen(), col->GetBlue());
1912 SetAlpha(col->GetAlpha());
1913 } else {
1914 SetColor(1., 1., 1.);
1915 SetAlpha(1.);
1916 }
1917}
1918
1919////////////////////////////////////////////////////////////////////////////////
1920/// Set color with its R G B components:
1921///
1922/// - r: % of red in [0,1]
1923/// - g: % of green in [0,1]
1924/// - b: % of blue in [0,1]
1925
1927{
1928 if (r == fRed && g == fGreen && b == fBlue) return;
1929
1930 fRed = r;
1931 fGreen = g;
1932 fBlue = b;
1933 if (fRed <= 0.000001) fRed = 0;
1934 if (fGreen <= 0.000001) fGreen = 0;
1935 if (fBlue <= 0.000001) fBlue = 0;
1936
1937 if (gStyle->GetColorModelPS()) {
1940 if (colBlack==1) {
1941 colCyan = 0;
1942 colMagenta = 0;
1943 colYellow = 0;
1944 } else {
1945 colCyan = (1-fRed-colBlack)/(1-colBlack);
1947 colYellow = (1-fBlue-colBlack)/(1-colBlack);
1948 }
1949 if (colCyan <= 0.000001) colCyan = 0;
1950 if (colMagenta <= 0.000001) colMagenta = 0;
1951 if (colYellow <= 0.000001) colYellow = 0;
1952 if (colBlack <= 0.000001) colBlack = 0;
1957 PrintFast(2," K");
1962 PrintFast(2," k");
1963 } else {
1964 WriteReal(fRed);
1967 PrintFast(3," RG");
1968 WriteReal(fRed);
1971 PrintFast(3," rg");
1972 }
1973}
1974
1975////////////////////////////////////////////////////////////////////////////////
1976/// Set color index for fill areas
1977
1982
1983////////////////////////////////////////////////////////////////////////////////
1984/// Set the fill patterns (1 to 25) for fill areas
1985
1987{
1988 char cpat[10];
1989 TColor *col = gROOT->GetColor(color);
1990 if (!col) return;
1991 PrintStr(" /Cs8 cs");
1992 Double_t colRed = col->GetRed();
1993 Double_t colGreen = col->GetGreen();
1994 Double_t colBlue = col->GetBlue();
1995 if (gStyle->GetColorModelPS()) {
1997 if (colBlack==1) {
1998 WriteReal(0);
1999 WriteReal(0);
2000 WriteReal(0);
2002 } else {
2010 }
2011 } else {
2015 }
2016
2017 if (fPageOrientation == 2) {
2018 switch (ipat) {
2019 case 4: ipat = 5; break;
2020 case 5: ipat = 4; break;
2021 case 6: ipat = 7; break;
2022 case 7: ipat = 6; break;
2023 case 17: ipat = 18; break;
2024 case 18: ipat = 17; break;
2025 case 20: ipat = 16; break;
2026 case 16: ipat = 20; break;
2027 case 21: ipat = 22; break;
2028 case 22: ipat = 21; break;
2029 }
2030 }
2031 snprintf(cpat,10," /P%2.2d scn", ipat);
2032 PrintStr(cpat);
2033}
2034
2035////////////////////////////////////////////////////////////////////////////////
2036/// Set color index for lines
2037
2042
2043////////////////////////////////////////////////////////////////////////////////
2044/// Set the value of the global parameter TPDF::fgLineJoin.
2045/// This parameter determines the appearance of joining lines in a PDF
2046/// output.
2047/// It takes one argument which may be:
2048/// - 0 (miter join)
2049/// - 1 (round join)
2050/// - 2 (bevel join)
2051/// The default value is 0 (miter join).
2052///
2053/// \image html postscript_1.png
2054///
2055/// To change the line join behaviour just do:
2056/// ~~~ {.cpp}
2057/// gStyle->SetJoinLinePS(2); // Set the PDF line join to bevel.
2058/// ~~~
2059
2061{
2063 if (fgLineJoin<0) fgLineJoin=0;
2064 if (fgLineJoin>2) fgLineJoin=2;
2065}
2066
2067////////////////////////////////////////////////////////////////////////////////
2068/// Set the value of the global parameter TPDF::fgLineCap.
2069/// This parameter determines the appearance of line caps in a PDF
2070/// output.
2071/// It takes one argument which may be:
2072/// - 0 (butt caps)
2073/// - 1 (round caps)
2074/// - 2 (projecting caps)
2075/// The default value is 0 (butt caps).
2076///
2077/// \image html postscript_2.png
2078///
2079/// To change the line cap behaviour just do:
2080/// ~~~ {.cpp}
2081/// gStyle->SetCapLinePS(2); // Set the PDF line cap to projecting.
2082/// ~~~
2083
2085{
2087 if (fgLineCap<0) fgLineCap=0;
2088 if (fgLineCap>2) fgLineCap=2;
2089}
2090
2091////////////////////////////////////////////////////////////////////////////////
2092/// Change the line style
2093///
2094/// - linestyle = 2 dashed
2095/// - linestyle = 3 dotted
2096/// - linestyle = 4 dash-dotted
2097/// - linestyle = else solid (1 in is used most of the time)
2098
2100{
2101 if ( linestyle == fLineStyle) return;
2104 PrintFast(2," [");
2105 TObjArray *tokens = st.Tokenize(" ");
2106 for (Int_t j = 0; j<tokens->GetEntries(); j++) {
2107 Int_t it;
2108 sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
2109 WriteInteger((Int_t)(it/4));
2110 }
2111 delete tokens;
2112 PrintFast(5,"] 0 d");
2113}
2114
2115////////////////////////////////////////////////////////////////////////////////
2116/// Change the line width
2117
2119{
2120 if (linewidth == fLineWidth) return;
2122 if (fLineWidth!=0) {
2124 PrintFast(2," w");
2125 }
2126}
2127
2128////////////////////////////////////////////////////////////////////////////////
2129/// Set color index for markers.
2130
2135
2136////////////////////////////////////////////////////////////////////////////////
2137/// Set color index for text
2138
2143
2144////////////////////////////////////////////////////////////////////////////////
2145/// Draw text
2146///
2147/// - xx: x position of the text
2148/// - yy: y position of the text
2149/// - chars: text to be drawn
2150
2152{
2153 if (fTextSize <= 0) return;
2154
2155 const Double_t kDEGRAD = TMath::Pi()/180.;
2156 char str[8];
2157 Double_t x = xx;
2158 Double_t y = yy;
2159
2160 // Font and text size
2161 Int_t font = abs(fTextFont)/10;
2162 if (font > kNumberOfFonts || font < 1) font = 1;
2163
2164 Double_t wh = (Double_t)gPad->XtoPixel(gPad->GetX2());
2165 Double_t hh = (Double_t)gPad->YtoPixel(gPad->GetY1());
2167 if (wh < hh) {
2168 tsize = fTextSize*wh;
2169 Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2170 ftsize = (sizeTTF*fXsize*gPad->GetAbsWNDC())/wh;
2171 } else {
2172 tsize = fTextSize*hh;
2173 Int_t sizeTTF = (Int_t)(tsize*kScale+0.5); // TTF size
2174 ftsize = (sizeTTF*fYsize*gPad->GetAbsHNDC())/hh;
2175 }
2176 Double_t fontsize = 72*(ftsize)/2.54;
2177 if (fontsize <= 0) return;
2178
2179 // Text color
2181
2182 // Clipping
2183 PrintStr(" q");
2184 Double_t x1 = XtoPDF(gPad->GetX1());
2185 Double_t x2 = XtoPDF(gPad->GetX2());
2186 Double_t y1 = YtoPDF(gPad->GetY1());
2187 Double_t y2 = YtoPDF(gPad->GetY2());
2188 WriteReal(x1);
2189 WriteReal(y1);
2190 WriteReal(x2 - x1);
2191 WriteReal(y2 - y1);
2192 PrintStr(" re W n");
2193
2194 // Start the text
2195 if (!fCompress) PrintStr("@");
2196
2197 // Text alignment
2198 Float_t tsizex = gPad->AbsPixeltoX(Int_t(tsize))-gPad->AbsPixeltoX(0);
2199 Float_t tsizey = gPad->AbsPixeltoY(0)-gPad->AbsPixeltoY(Int_t(tsize));
2200 Int_t txalh = fTextAlign/10;
2201 if (txalh < 1) txalh = 1; else if (txalh > 3) txalh = 3;
2202 Int_t txalv = fTextAlign%10;
2203 if (txalv < 1) txalv = 1; else if (txalv > 3) txalv = 3;
2204 if (txalv == 3) {
2207 } else if (txalv == 2) {
2210 }
2211
2212 if (txalh > 1) {
2213 TText t;
2214 UInt_t w=0, h;
2217 t.GetTextExtent(w, h, chars);
2218 Double_t twx = gPad->AbsPixeltoX(w)-gPad->AbsPixeltoX(0);
2219 Double_t twy = gPad->AbsPixeltoY(0)-gPad->AbsPixeltoY(w);
2220 if (txalh == 2) {
2223 }
2224 if (txalh == 3) {
2227 }
2228 }
2229
2230 // Text angle
2231 if (fTextAngle == 0) {
2232 PrintStr(" 1 0 0 1");
2233 WriteReal(XtoPDF(x));
2234 WriteReal(YtoPDF(y));
2235 } else if (fTextAngle == 90) {
2236 PrintStr(" 0 1 -1 0");
2237 WriteReal(XtoPDF(x));
2238 WriteReal(YtoPDF(y));
2239 } else if (fTextAngle == 270) {
2240 PrintStr(" 0 -1 1 0");
2241 WriteReal(XtoPDF(x));
2242 WriteReal(YtoPDF(y));
2243 } else {
2248 WriteReal(XtoPDF(x));
2249 WriteReal(YtoPDF(y));
2250 }
2251 PrintStr(" cm");
2252
2253 // Symbol Italic tan(15) = .26794
2254 if (font == 15) PrintStr(" 1 0 0.26794 1 0 0 cm");
2255
2256 PrintStr(" BT");
2257
2258 snprintf(str,8," /F%d",font);
2259 PrintStr(str);
2261 PrintStr(" Tf");
2262
2263 const Int_t len=strlen(chars);
2264
2265 // Calculate the individual character placements.
2266 // Otherwise, if a string is printed in one line the kerning is not
2267 // performed. In order to measure the precise character positions we need to
2268 // trick FreeType into rendering high-resolution characters otherwise it will
2269 // stick to the screen pixel grid which is far worse than we can achieve on
2270 // print.
2271 const Float_t scale = 16.0;
2272 // Save current text attributes.
2274 saveAttText.TAttText::operator=(*this);
2275 TText t;
2278 UInt_t wa1=0, wa0=0;
2281 t.TAttText::Modify();
2283 if (wa0-wa1 != 0) kerning = kTRUE;
2284 else kerning = kFALSE;
2285 Int_t *charDeltas = nullptr;
2286 if (kerning) {
2287 charDeltas = new Int_t[len];
2288 for (Int_t i = 0;i < len;i++) {
2289 UInt_t ww=0;
2290 t.GetTextAdvance(ww, chars + i);
2291 charDeltas[i] = wa1 - ww;
2292 }
2293 for (Int_t i = len - 1;i > 0;i--) {
2294 charDeltas[i] -= charDeltas[i-1];
2295 }
2296 char tmp[2];
2297 tmp[1] = 0;
2298 for (Int_t i = 1;i < len;i++) {
2299 tmp[0] = chars[i-1];
2300 UInt_t width=0;
2301 t.GetTextAdvance(width, &tmp[0], kFALSE);
2302 Double_t wwl = gPad->AbsPixeltoX(width - charDeltas[i]) - gPad->AbsPixeltoX(0);
2303 wwl -= 0.5*(gPad->AbsPixeltoX(1) - gPad->AbsPixeltoX(0)); // half a pixel ~ rounding error
2304 charDeltas[i] = (Int_t)((1000.0/Float_t(fontsize))*(XtoPDF(wwl) - XtoPDF(0))/scale);
2305 }
2306 }
2307 // Restore text attributes.
2308 saveAttText.TAttText::Modify();
2309
2310 // Output the text. Escape some characters if needed
2311 if (kerning) PrintStr(" [");
2312 else PrintStr(" (");
2313
2314 for (Int_t i=0; i<len;i++) {
2315 if (chars[i]!='\n') {
2316 if (kerning) PrintStr("(");
2317 if (chars[i]=='(' || chars[i]==')') {
2318 snprintf(str,8,"\\%c",chars[i]);
2319 } else {
2320 snprintf(str,8,"%c",chars[i]);
2321 }
2322 PrintStr(str);
2323 if (kerning) {
2324 PrintStr(") ");
2325 if (i < len-1) {
2327 }
2328 }
2329 }
2330 }
2331
2332 if (kerning) PrintStr("] TJ ET Q");
2333 else PrintStr(") Tj ET Q");
2334 if (!fCompress) PrintStr("@");
2335 if (kerning) delete [] charDeltas;
2336}
2337
2338////////////////////////////////////////////////////////////////////////////////
2339/// Write a string of characters
2340///
2341/// This method writes the string chars into a PDF file
2342/// at position xx,yy in world coordinates.
2343
2344void TPDF::Text(Double_t, Double_t, const wchar_t *)
2345{
2346}
2347
2348////////////////////////////////////////////////////////////////////////////////
2349/// Write a string of characters in NDC
2350
2352{
2353 Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1());
2354 Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1());
2355 Text(x, y, chars);
2356}
2357
2358////////////////////////////////////////////////////////////////////////////////
2359/// Write a string of characters in NDC
2360
2361void TPDF::TextNDC(Double_t u, Double_t v, const wchar_t *chars)
2362{
2363 Double_t x = gPad->GetX1() + u*(gPad->GetX2() - gPad->GetX1());
2364 Double_t y = gPad->GetY1() + v*(gPad->GetY2() - gPad->GetY1());
2365 Text(x, y, chars);
2366}
2367
2368////////////////////////////////////////////////////////////////////////////////
2369/// Convert U from NDC coordinate to PDF
2370
2372{
2373 Double_t cm = fXsize*(gPad->GetAbsXlowNDC() + u*gPad->GetAbsWNDC());
2374 return 72*cm/2.54;
2375}
2376
2377////////////////////////////////////////////////////////////////////////////////
2378/// Convert V from NDC coordinate to PDF
2379
2381{
2382 Double_t cm = fYsize*(gPad->GetAbsYlowNDC() + v*gPad->GetAbsHNDC());
2383 return 72*cm/2.54;
2384}
2385
2386////////////////////////////////////////////////////////////////////////////////
2387/// Convert X from world coordinate to PDF
2388
2390{
2391 Double_t u = (x - gPad->GetX1())/(gPad->GetX2() - gPad->GetX1());
2392 return UtoPDF(u);
2393}
2394
2395////////////////////////////////////////////////////////////////////////////////
2396/// Convert Y from world coordinate to PDF
2397
2399{
2400 Double_t v = (y - gPad->GetY1())/(gPad->GetY2() - gPad->GetY1());
2401 return VtoPDF(v);
2402}
2403
2404////////////////////////////////////////////////////////////////////////////////
2405/// Write the buffer in a compressed way
2406
2408{
2409 z_stream stream;
2410 int err;
2411 char *out = new char[2*fLenBuffer];
2412
2413 stream.next_in = (Bytef*)fBuffer;
2414 stream.avail_in = (uInt)fLenBuffer;
2415 stream.next_out = (Bytef*)out;
2416 stream.avail_out = (uInt)2*fLenBuffer;
2417 stream.zalloc = (alloc_func)nullptr;
2418 stream.zfree = (free_func)nullptr;
2419 stream.opaque = (voidpf)nullptr;
2420
2421 err = deflateInit(&stream, Z_DEFAULT_COMPRESSION);
2422 if (err != Z_OK) {
2423 Error("WriteCompressedBuffer", "error in deflateInit (zlib)");
2424 delete [] out;
2425 return;
2426 }
2427
2428 err = deflate(&stream, Z_FINISH);
2429 if (err != Z_STREAM_END) {
2430 deflateEnd(&stream);
2431 Error("WriteCompressedBuffer", "error in deflate (zlib)");
2432 delete [] out;
2433 return;
2434 }
2435
2436 err = deflateEnd(&stream);
2437 if (err != Z_OK) {
2438 Error("WriteCompressedBuffer", "error in deflateEnd (zlib)");
2439 }
2440
2441 fStream->write(out, stream.total_out);
2442
2443 fNByte += stream.total_out;
2444 fStream->write("\n",1); fNByte++;
2445 fLenBuffer = 0;
2446 delete [] out;
2447 fCompress = kFALSE;
2448}
2449
2450////////////////////////////////////////////////////////////////////////////////
2451/// Write a Real number to the file.
2452/// This method overwrites TVirtualPS::WriteReal. Some PDF reader like
2453/// Acrobat do not work when a PDF file contains reals with exponent. This
2454/// method writes the real number "z" using the format "%f" instead of the
2455/// format "%g" when writing it with "%g" generates a number with exponent.
2456
2458{
2459 char str[15];
2460 if (space) {
2461 snprintf(str,15," %g", z);
2462 if (strstr(str,"e") || strstr(str,"E")) snprintf(str,15," %10.8f", z);
2463 } else {
2464 snprintf(str,15,"%g", z);
2465 if (strstr(str,"e") || strstr(str,"E")) snprintf(str,15,"%10.8f", z);
2466 }
2467 PrintStr(str);
2468}
2469
2470////////////////////////////////////////////////////////////////////////////////
2471/// Patterns encoding
2472
2474{
2476
2478 if (gStyle->GetColorModelPS()) {
2479 PrintStr("[/Pattern /DeviceCMYK]@");
2480 } else {
2481 PrintStr("[/Pattern /DeviceRGB]@");
2482 }
2483 EndObject();
2485 PrintStr("<</ProcSet[/PDF]>>@");
2486 EndObject();
2487
2489 PrintStr("<<@");
2490 PrintStr(" /P01");
2492 PrintStr(" 0 R");
2493 PrintStr(" /P02");
2495 PrintStr(" 0 R");
2496 PrintStr(" /P03");
2498 PrintStr(" 0 R");
2499 PrintStr(" /P04");
2501 PrintStr(" 0 R");
2502 PrintStr(" /P05");
2504 PrintStr(" 0 R");
2505 PrintStr(" /P06");
2507 PrintStr(" 0 R");
2508 PrintStr(" /P07");
2510 PrintStr(" 0 R");
2511 PrintStr(" /P08");
2513 PrintStr(" 0 R");
2514 PrintStr(" /P09");
2516 PrintStr(" 0 R");
2517 PrintStr(" /P10");
2519 PrintStr(" 0 R");
2520 PrintStr(" /P11");
2522 PrintStr(" 0 R");
2523 PrintStr(" /P12");
2525 PrintStr(" 0 R");
2526 PrintStr(" /P13");
2528 PrintStr(" 0 R");
2529 PrintStr(" /P14");
2531 PrintStr(" 0 R");
2532 PrintStr(" /P15");
2534 PrintStr(" 0 R");
2535 PrintStr(" /P16");
2537 PrintStr(" 0 R");
2538 PrintStr(" /P17");
2540 PrintStr(" 0 R");
2541 PrintStr(" /P18");
2543 PrintStr(" 0 R");
2544 PrintStr(" /P19");
2546 PrintStr(" 0 R");
2547 PrintStr(" /P20");
2549 PrintStr(" 0 R");
2550 PrintStr(" /P21");
2552 PrintStr(" 0 R");
2553 PrintStr(" /P22");
2555 PrintStr(" 0 R");
2556 PrintStr(" /P23");
2558 PrintStr(" 0 R");
2559 PrintStr(" /P24");
2561 PrintStr(" 0 R");
2562 PrintStr(" /P25");
2564 PrintStr(" 0 R@");
2565 PrintStr(">>@");
2566 EndObject();
2567
2569
2570 // P01
2572 PrintStr("<</Type/Pattern/Matrix[1 0 0 1 20 28]/PatternType 1/Resources");
2574 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 98 4]/XStep 98/YStep 4/Length 91/Filter/FlateDecode>>");
2575 PrintStr("@");
2576 fStream->write("stream",6); fNByte += 6;
2577 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301P\241\034(\254\340\253\020m\250\020k\240\220\302e\244`\242\220\313ei\t\244r\200\272\215A\034\v \225\003\2241\202\310\030\201e\f!2\206@N0W \027@\200\001\0|c\024\357\n", 93);
2578 fNByte += 93;
2579 PrintStr("endstream@");
2580 EndObject();
2581
2582 // P02
2584 PrintStr("<</Type/Pattern/Matrix[0.75 0 0 0.75 20 28]/PatternType 1/Resources");
2586 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 96 4]/XStep 96/YStep 4/Length 92/Filter/FlateDecode>>@");
2587 PrintStr("@");
2588 fStream->write("stream",6); fNByte += 6;
2589 fStream->write("\r\nH\211$\2121\n\2000\024C\367\234\"G\370\277\025\321+\b\016\342\340P\334tP\252\240\213\3277\332!\204\274\227\v\316\2150\032\335J\356\025\023O\241Np\247\363\021f\317\344\214\234\215\v\002+\036h\033U\326/~\243Ve\231PL\370\215\027\343\032#\006\274\002\f\0\242`\025:\n", 94);
2590 fNByte += 94;
2591 PrintStr("endstream@");
2592 EndObject();
2593
2594 // P03
2596 PrintStr("<</Type/Pattern/Matrix[0.5 0 0 0.5 20 28]/PatternType 1/Resources");
2598 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 96 16]/XStep 96/YStep 16/Length 93/Filter/FlateDecode>>@");
2599 PrintStr("@");
2600 fStream->write("stream",6); fNByte += 6;
2601 fStream->write("\r\nH\211$\2121\n\2000\024C\367\234\"G\370\261(\366\n\202\20388\210\233\016J\025t\361\372\376\332!\204\274\227\033\342N\030\215\262\222g\303\304\313Q\347\360\240\370:f\317Y\f\\\214+**\360Dls'\177\306\274\032\257\344\256.\252\376\215\212\221\217\021\003>\001\006\0\317\243\025\254\n", 95);
2602 fNByte += 95;
2603 PrintStr("endstream@");
2604 EndObject();
2605
2606 // P04
2608 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2610 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 63/Filter/FlateDecode>>");
2611 PrintStr("@");
2612 fStream->write("stream",6); fNByte += 6;
2613 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002V\231\313\005S\233\303\025\314\025\310\005\020`\0\344\270\r\274\n", 65);
2614 fNByte += 65;
2615 PrintStr("endstream@");
2616 EndObject();
2617
2618 // P05
2620 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2622 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 66/Filter/FlateDecode>>");
2623 PrintStr("@");
2624 fStream->write("stream",6); fNByte += 6;
2625 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\302\005Q\223\313\005\"\r\024r\270\202\271\002\271\0\002\f\0\344\320\r\274\n", 68);
2626 fNByte += 68;
2627 PrintStr("endstream@");
2628 EndObject();
2629
2630 // P06
2632 PrintStr("<</Type/Pattern/Matrix[0.03 0 0 0.03 20 28]/PatternType 1/Resources");
2634 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 66/Filter/FlateDecode>>");
2635 PrintStr("@");
2636 fStream->write("stream",6); fNByte += 6;
2637 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\302e\nR\232\v\242@js\270\202\271\002\271\0\002\f\0\345X\r\305\n", 68);
2638 fNByte += 68;
2639 PrintStr("endstream@");
2640 EndObject();
2641
2642 // P07
2644 PrintStr("<</Type/Pattern/Matrix[0.03 0 0 0.03 20 28]/PatternType 1/Resources");
2646 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 68/Filter/FlateDecode>>");
2647 PrintStr("@");
2648 fStream->write("stream",6); fNByte += 6;
2649 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002\02465P\310\345\002)\0042r\270\202\271\002\271\0\002\f\0\345=\r\305\n", 70);
2650 fNByte += 70;
2651 PrintStr("endstream@");
2652 EndObject();
2653
2654 // P08
2656 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2658 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 139/Filter/FlateDecode>>");
2659 PrintStr("@");
2660 fStream->write("stream",6); fNByte += 6;
2661 fStream->write("\r\nH\211D\217\261\016\3020\fDw\177\305\315L6Q\225|\003\022C\305\300Puk+\201\032$\272\360\373\330\265\323\016\271\330\367\234\344\"x\201\030\214\252\232\030+%\353VZ.jd\367\205\003x\241({]\311\324]\323|\342\006\033J\201:\306\325\230Jg\226J\261\275D\257#\337=\220\260\354k\233\351\211\217Z75\337\020\374\324\306\035\303\310\230\342x=\303\371\275\307o\332s\331\223\224\240G\330\a\365\364\027`\0\nX1}\n",141);
2662 fNByte += 141;
2663 PrintStr("endstream@");
2664 EndObject();
2665
2666 // P09
2668 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2670 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 108/Filter/FlateDecode>>");
2671 PrintStr("@");
2672 fStream->write("stream",6); fNByte += 6;
2673 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002\02465P\310\005RFFz&\020\002,d\240\220\314en\256g\0065\b,\001b\230\202$\240\232\214@\362\246`\2169H\336\024\2426\231\v&\200,\n\326\030\314\025\310\005\020`\0\f@\036\227\n", 110);
2674 fNByte += 110;
2675 PrintStr("endstream@");
2676 EndObject();
2677
2678 // P10
2680 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2682 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 93/Filter/FlateDecode>>");
2683 PrintStr("@");
2684 fStream->write("stream",6); fNByte += 6;
2685 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002\02465P\310\345\002)\0042r\200\332\r\241\\C \017dN.\027L\312\0\302\205\2535\205j6\205X\224\303\025\314\025\310\005\020`\0\2127\031\t\n", 95);
2686 fNByte += 95;
2687 PrintStr("endstream@");
2688 EndObject();
2689
2690 // P11
2692 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2694 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 164/Filter/FlateDecode>>");
2695 PrintStr("@");
2696 fStream->write("stream",6); fNByte += 6;
2697 fStream->write("\r\nH\211\\\2171\016\3020\fEw\237\342\037\301ip\223^\001\211\001u`@l0\200(\022,\\\037;v\204\332\241\211\336\373\337V\363\246\204;\210\301H\354\337\347F'\274T\355U>\220\360U\215\003\316\027\306\2655\027=\a\306\223\304I\002m\332\330\356&\030\325\333fZ\275F\337\205\235\265O\270\032\004\331\214\336\305\270\004\227`\357i\256\223\342;]\344\255(!\372\356\205j\030\377K\335\220\344\377\210\274\306\022\330\337T{\214,\212;\301\3508\006\346\206\021O=\216|\212|\246#\375\004\030\0\216FF\207\n", 166);
2698 fNByte += 166;
2699 PrintStr("endstream@");
2700 EndObject();
2701
2702 // P12
2704 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2706 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 226/Filter/FlateDecode>>");
2707 PrintStr("@");
2708 fStream->write("stream",6); fNByte += 6;
2709 fStream->write("\r\nH\211<P;n\3030\f\335y\n\236 \220DK\242\256P\240C\321\241C\221\311\311\220\242\016\220.\275~D\221/\203I\342}\370(?(\363\215)q\342\234\374\373\273\322\027\337'\3646\301\037\316\374?a~\347\357s\342\313\2045\361A9\237\322fc\231\200\236F\263\301\334;\211\017\207\rN\311\252S\\\227{\247\006w\207\244\303\255p+(\205\333\360e/v\356a\315\317\360\272\320b|w\276\203o\340k\b\004\027\v$b\226\235,\242\254t(\024\nu\305Vm\313\021\375\327\272\257\227fuf\226ju\356\222x\030\024\313\261S\215\377\341\274,\203\254\253Z\\\262A\262\205eD\350\210\320\201\225\212\320\036\241\355\025\372JE,\2266\344\366\310U\344\016HFx>\351\203\236\002\f\0d}e\216\n", 228);
2710 fNByte += 228;
2711 PrintStr("endstream@");
2712 EndObject();
2713
2714 // P13
2716 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2718 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 69/Filter/FlateDecode>>");
2719 PrintStr("@");
2720 fStream->write("stream",6); fNByte += 6;
2721 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\002V\231\313\005S\233\303\005\241!\" ~0W \027@\200\001\0\331\227\020\253\n", 71);
2722 fNByte += 71;
2723 PrintStr("endstream@");
2724 EndObject();
2725
2726 // P14
2728 PrintStr("<</Type/Pattern/Matrix[0.15 0 0 0.15 20 28]/PatternType 1/Resources");
2730 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 80/YStep 80/Length 114/Filter/FlateDecode>>");
2731 PrintStr("@");
2732 fStream->write("stream",6); fNByte += 6;
2733 fStream->write("\r\nH\2114\214=\n\2000\f\205\367\234\342\035!-\241\364\f\202\20388\210\233\016J+\350\342\365M\3723\224\327\367}I\036r8A\f\206\343\372\336\203\026\334\212\006\205\027\004\237b\214X7\306\256\33032\331\240~\022y[\315\026\206\222\372\330}\264\036\253\217\335\353\240\030\b%\223\245o=X\227\346\245\355K\341\345@\3613M\364\v0\0\207o\"\261\n", 116);
2734 fNByte += 116;
2735 PrintStr("endstream@");
2736 EndObject();
2737
2738 // P15
2740 PrintStr("<</Type/Pattern/Matrix[0.102 0 0 0.102 20 28]/PatternType 1/Resources");
2742 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 60 60]/XStep 60/YStep 60/Length 218/Filter/FlateDecode>>");
2743 PrintStr("@");
2744 fStream->write("stream",6); fNByte += 6;
2745 fStream->write("\r\nH\211<\2211\016\3020\fEw\237\302'@\211c\267w@b@\f\f\210\2510\200(\022,\\\037\347\307\256Z\325\221\375\337\377\225\363\241\312\017\246\302\205'\274\337;\235\371\355\215\275\267\236\\\371\307\265\360\201/\327\3027o\233\361J\262\233\247~\362g\336\211zur!A]{\035}\031S\343\006p\241\226dKI\v\326\202\265\3153\331)X)\335fE\205M\235\373\327\r*\374\026\252\022\216u\223\200\361I\211\177\031\022\001#``\342GI\211\004c\221gi\246\231\247\221\247\231\247\233$XM3\315<\215<\315<K\211e\036#\215a4\366\344\035lm\214Z\314b\211Xj\337K\\\201$\332\325\v\365\2659\204\362\242\274'\v\221\r\321\211\216\364\027`\0\212'_\215\n", 220);
2746 fNByte += 220;
2747 PrintStr("endstream@");
2748 EndObject();
2749
2750 // P16
2752 PrintStr("<</Type/Pattern/Matrix[0.1 0 0 0.05 20 28]/PatternType 1/Resources");
2754 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 123/Filter/FlateDecode>>");
2755 PrintStr("@");
2756 fStream->write("stream",6); fNByte += 6;
2757 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020\035k\240\220\302ej\240\0D\271 \332\314X\317B\301\330\002H\230\233*\030\231\202\310d.CC=#\020\v*\rV\235\214\254\v\210r@\264\261\031P\241\031H5D\253\021H\267\005\3104 \v\344\016\260\002\020\003lB0W \027@\200\001\0hU \305\n", 125);
2758 fNByte += 125;
2759 PrintStr("endstream@");
2760 EndObject();
2761
2762 // P17
2764 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2766 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 66/Filter/FlateDecode>>");
2767 PrintStr("@");
2768 fStream->write("stream",6); fNByte += 6;
2769 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020md\242\020k\240\220\002V\234\313\005S\236\303\025\314\025\310\005\020`\0\r\351\016B\n", 68);
2770 fNByte += 68;
2771 PrintStr("endstream@");
2772 EndObject();
2773
2774 // P18
2776 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2778 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 69/Filter/FlateDecode>>");
2779 PrintStr("@");
2780 fStream->write("stream",6); fNByte += 6;
2781 fStream->write("\r\nH\211*\3442T\310T\3402P0P04\200\340\242T\256p\205<\240\220\027P0K\301D\241\034(\254\340\253\020md\242\020k\240\220\302\005Q\226\313\005\"\r\024r\270\202\271\002\271\0\002\f\0\016\001\016B\n", 71);
2782 fNByte += 71;
2783 PrintStr("endstream@");
2784 EndObject();
2785
2786 // P19
2788 PrintStr("<</Type/Pattern/Matrix[0.117 0 0 0.117 20 28]/PatternType 1/Resources");
2790 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 149/Filter/FlateDecode>>");
2791 PrintStr("@");
2792 fStream->write("stream",6); fNByte += 6;
2793 fStream->write("\r\nH\211L\216;\016\302@\fD{\237bN\020\331+6a\257\200D\201((P\252@\001R\220\240\341\372\370\263\216(\326\266f\336\330\373&\301\003\304`\b\307\373\334\351\202\227J\a\025\237\020|U\306\021\327\231q\243\306\250\214\325\372T\006\336\367\032\262\326\205\3124\264b\243$\"n.\244=\314\250!\2139\033\327\022i=\323\317\2518\332T}\347.\202\346W\373\372j\315\221\344\266\213=\237\241\344\034\361\264!\236w\344\177\271o8\323\211~\002\f\0\366\3026\233\n", 151);
2794 fNByte += 151;
2795 PrintStr("endstream@");
2796 EndObject();
2797
2798 // P20
2800 PrintStr("<</Type/Pattern/Matrix[0.05 0 0 0.1 20 28]/PatternType 1/Resources");
2802 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 122/Filter/FlateDecode>>");
2803 PrintStr("@");
2804 fStream->write("stream",6); fNByte += 6;
2805 fStream->write("\r\nH\211<L;\016\2030\f\335}\212w\002\344$M\2323 1 \006\006\304\224vhU\220`\341\372<\aT\311\366\263\336o\023\207\017D\241pz\355\376\226\021+\251\226\344\027\017\034\244\321a\232\025/\211\n\316r\343ORh\262}\317\210\344\032o\310)\302\2233\245\252[m\274\332\313\277!$\332\371\371\210`N\242\267$\217\263\246\252W\257\245\006\351\345\024`\0o\347 \305\n", 124);
2806 fNByte += 124;
2807 PrintStr("endstream@");
2808 EndObject();
2809
2810 // P21
2812 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2814 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 117/Filter/FlateDecode>>");
2815 PrintStr("@");
2816 fStream->write("stream",6); fNByte += 6;
2817 fStream->write("\r\nH\211D\2151\n\2000\fE\367\234\342\037!)\224\336Ap\020\a\aq\323A\251\202.^\337$-\025\022^\372\033^n\022\354 \006CX\274\237\215&\\\032u\032\036\020\274\032\243\307\2740V]\027\234\024\242\"\033\2642En\324\312\224bc\262\\\230\377\301\332WM\224\212(U\221\375\265\301\025\016?\350\317P\215\221\033\213o\244\201>\001\006\0\031I'f\n", 119);
2818 fNByte += 119;
2819 PrintStr("endstream@");
2820 EndObject();
2821
2822 // P22
2824 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2826 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 118/Filter/FlateDecode>>");
2827 PrintStr("@");
2828 fStream->write("stream",6); fNByte += 6;
2829 fStream->write("\r\nH\211<\215=\n\204P\f\204\373\234b\216\220<\b\357\016\302\026ba!vZ(\273\v\332x}\223\274\237\"|\223a\230\271Hp\200\030\fa\211\273w\232\3617k0\363\204\3401\033\037,+c#\3170~\2244\304\327EV\243r\247\272oOcr\337\323]H\t\226\252\334\252r\255\362\257\213(\t\304\250\326\315T\267\032\275q\242\221^\001\006\0\272\367(&\n", 120);
2830 fNByte += 120;
2831 PrintStr("endstream@");
2832 EndObject();
2833
2834 // P23
2836 PrintStr("<</Type/Pattern/Matrix[0.06 0 0 0.06 20 28]/PatternType 1/Resources");
2838 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 169/Filter/FlateDecode>>");
2839 PrintStr("@");
2840 fStream->write("stream",6); fNByte += 6;
2841 fStream->write("\r\nH\211<\220\273\n\0021\020E\373\371\212[[M\326\331\354\344\027\004\v\261\260\020;\025\224D\320\306\337w\036\254p\363\230\223\341$\344M\005\017\020\203Q8\307\347F'\274\f\355\f>Q\3605\214=\316\005\v.\214kt\217\230;)\324\366\245Fa\213e\320v\212r\022X\006\211Fi\3242\250J\224\302\020\367h\212\254I\\\325R\225o\03143\346U\235@a\t[\202Za\tA\202E`\351~O\002\235`\351~S\202\306h.m\253\264)\232K\217t\310\017q\354\a\353\247\364\377C\356\033\372\t0\0\bm:\375\n", 171);
2842 fNByte += 171;
2843 PrintStr("endstream@");
2844 EndObject();
2845
2846 // P24
2848 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2850 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 100 100]/XStep 100/YStep 100/Length 280/Filter/FlateDecode>>");
2851 PrintStr("@");
2852 fStream->write("stream",6); fNByte += 6;
2853 fStream->write("\r\nH\211DQ9N\004A\f\314\373\025\216\211\326\343v\037_@\"@\004\004\210\f\220@\003\022$|\177\335\345j\220v\345\251\303\343*\215\312\273\024\275\\d\375?\361dM\3162\306\337\214\337Y\336n\240m\217\036\301y\343\\<,i\250\0038F\035)\347l\322\026o\377\023\353|[\254\177\343\005;\315\317ky\224\257\240n\203\374\020\225\337\240\345N\236T\272<_\344\245\304^\3238\030\tc\236E\233xO\034\363\204>\251\317\324\233\023{\352\235\376\336S\357Fl\251\017\372\207\247>xoh&_\366Ud\331\253\314D\023\332\241\211\016\205\246\235\326\236*\275\307\204z8!s\031\335\306\\\306C\306\\\225\376\312\\\225\307\252\246\356\364\273Q\347\271:\371\341l\177\311e\210\3571\211\251#\374\302H\037:\342c\241\323\2617\320 \034\250\0\302\323a{\005%\302a\373(Zx\313\026\213@\215p\324}\026=\274e\217E8s\326}\026M\036\312}\271\n0\0\215\263\207\016\n", 282);
2854 fNByte += 282;
2855 PrintStr("endstream@");
2856 EndObject();
2857
2858 // P25
2860 PrintStr("<</Type/Pattern/Matrix[0.125 0 0 0.125 20 28]/PatternType 1/Resources");
2862 PrintStr(" 0 R/PaintType 2/TilingType 1/BBox[0 0 101 101]/XStep 100/YStep 100/Length 54/Filter/FlateDecode>>");
2863 PrintStr("@");
2864 fStream->write("stream",6); fNByte += 6;
2865 fStream->write("\r\nH\2112T\310T\3402P0P\310\34526P\0\242\034.s\004m\016\242\r\r\f\024@\030\302\002\321iZP\305`M\346\310\212\201R\0\001\006\0\206\322\017\200\n", 56);
2866 fNByte += 56;
2867 PrintStr("endstream@");
2868 EndObject();
2869}
#define b(i)
Definition RSha256.hxx:100
#define g(i)
Definition RSha256.hxx:105
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
short Style_t
Style number (short)
Definition RtypesCore.h:96
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Color_t
Color number (short)
Definition RtypesCore.h:99
short Width_t
Line width (short)
Definition RtypesCore.h:98
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
const Float_t kScale
Definition TASImage.cxx:135
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t cindex
Option_t Option_t SetLineWidth
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
const Int_t kObjFont
Definition TPDF.cxx:86
const Int_t kObjPatternList
Definition TPDF.cxx:89
const Int_t kObjInfo
Definition TPDF.cxx:81
const Int_t kObjRoot
Definition TPDF.cxx:80
const Float_t kScale
Definition TPDF.cxx:77
const Int_t kObjColorSpace
Definition TPDF.cxx:87
const Int_t kNumberOfFonts
Definition TPDF.cxx:95
const Int_t kObjPattern
Definition TPDF.cxx:91
const Int_t kObjContents
Definition TPDF.cxx:85
const Int_t kObjFirstPage
Definition TPDF.cxx:92
const Int_t kObjPages
Definition TPDF.cxx:83
const Int_t kObjPageResources
Definition TPDF.cxx:84
const Int_t kObjPatternResourses
Definition TPDF.cxx:88
const Int_t kObjTransList
Definition TPDF.cxx:90
const Int_t kObjOutlines
Definition TPDF.cxx:82
#define gROOT
Definition TROOT.h:411
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
R__EXTERN TVirtualPS * gVirtualPS
Definition TVirtualPS.h:81
#define gPad
#define snprintf
Definition civetweb.c:1579
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:24
Color_t fFillColor
Fill area color.
Definition TAttFill.h:23
Width_t fLineWidth
Line width.
Definition TAttLine.h:25
Style_t fLineStyle
Line style.
Definition TAttLine.h:24
Color_t fLineColor
Line color.
Definition TAttLine.h:23
Color_t fMarkerColor
Marker color.
Definition TAttMarker.h:23
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
Size_t fMarkerSize
Marker size.
Definition TAttMarker.h:25
Style_t fMarkerStyle
Marker style.
Definition TAttMarker.h:24
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
Color_t fTextColor
Text color.
Definition TAttText.h:26
Float_t fTextAngle
Text angle.
Definition TAttText.h:23
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:48
Font_t fTextFont
Text font.
Definition TAttText.h:27
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:49
Short_t fTextAlign
Text alignment.
Definition TAttText.h:25
Float_t fTextSize
Text size.
Definition TAttText.h:24
The color creation and management class.
Definition TColor.h:22
Float_t GetRed() const
Definition TColor.h:61
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1926
Float_t GetAlpha() const
Definition TColor.h:67
Float_t GetBlue() const
Definition TColor.h:63
Float_t GetGreen() const
Definition TColor.h:62
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition TDatime.h:37
Int_t GetMonth() const
Definition TDatime.h:66
Int_t GetDay() const
Definition TDatime.h:67
Int_t GetHour() const
Definition TDatime.h:69
Int_t GetSecond() const
Definition TDatime.h:71
Int_t GetYear() const
Definition TDatime.h:65
Int_t GetMinute() const
Definition TDatime.h:70
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
Definition TDatime.cxx:181
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
An array of TObjects.
Definition TObjArray.h:31
Collectable string class.
Definition TObjString.h:28
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1057
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
Definition TPDF.cxx:2099
void Off()
Deactivate an already open PDF file.
Definition TPDF.cxx:1642
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Definition TPDF.cxx:2131
Int_t fType
Workstation type used to know if the PDF is open.
Definition TPDF.h:40
void SetColor(Int_t color=1)
Set color with its color index.
Definition TPDF.cxx:1905
Double_t YtoPDF(Double_t y)
Convert Y from world coordinate to PDF.
Definition TPDF.cxx:2398
void Open(const char *filename, Int_t type=-111) override
Open a PDF file.
Definition TPDF.cxx:1666
void Close(Option_t *opt="") override
Close a PDF file.
Definition TPDF.cxx:196
TPDF()
Default PDF constructor.
Definition TPDF.cxx:105
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimetres.
Definition TPDF.cxx:1875
void LineTo(Double_t x, Double_t y)
Draw a line to a new position.
Definition TPDF.cxx:1418
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPDF::fgLineCap.
Definition TPDF.cxx:2084
Double_t XtoPDF(Double_t x)
Convert X from world coordinate to PDF.
Definition TPDF.cxx:2389
void WriteReal(Float_t r, Bool_t space=kTRUE) override
Write a Real number to the file.
Definition TPDF.cxx:2457
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPDF::fgLineJoin.
Definition TPDF.cxx:2060
Double_t CMtoPDF(Double_t u)
Definition TPDF.h:66
void CellArrayEnd() override
End the Cell Array painting.
Definition TPDF.cxx:188
Int_t fObjPosSize
Real size of fObjPos.
Definition TPDF.h:46
void NewPage() override
Start a new PDF page.
Definition TPDF.cxx:1464
static Bool_t fgObjectIsOpen
Indicates if an object is open.
Definition TPDF.h:55
Float_t fAlpha
Per cent of transparency.
Definition TPDF.h:36
Float_t fLineScale
Line width scale factor.
Definition TPDF.h:44
void SetFillColor(Color_t cindex=1) override
Set color index for fill areas.
Definition TPDF.cxx:1978
Float_t fGreen
Per cent of green.
Definition TPDF.h:34
Int_t fPageOrientation
Page orientation (Portrait, Landscape)
Definition TPDF.h:42
void On()
Activate an already open PDF file.
Definition TPDF.cxx:1650
Int_t fStartStream
Definition TPDF.h:43
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
Definition TPDF.cxx:350
void SetLineColor(Color_t cindex=1) override
Set color index for lines.
Definition TPDF.cxx:2038
void FontEncode()
Font encoding.
Definition TPDF.cxx:1386
Bool_t fCompress
True when fBuffer must be compressed.
Definition TPDF.h:50
static Int_t fgLineCap
Appearance of line caps.
Definition TPDF.h:54
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Draw a PolyLine.
Definition TPDF.cxx:1208
Float_t fYsize
Page size along Y.
Definition TPDF.h:39
Double_t UtoPDF(Double_t u)
Convert U from NDC coordinate to PDF.
Definition TPDF.cxx:2371
void SetAlpha(Float_t alpha=1.)
Set the alpha channel value.
Definition TPDF.cxx:1885
Float_t fRed
Per cent of red.
Definition TPDF.h:33
Int_t fPageFormat
Page format (A4, Letter etc ...)
Definition TPDF.h:41
Bool_t fRange
True when a range has been defined.
Definition TPDF.h:51
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
Draw markers at the n WC points xw, yw.
Definition TPDF.cxx:580
Float_t fBlue
Per cent of blue.
Definition TPDF.h:35
std::vector< float > fAlphas
List of alpha values used.
Definition TPDF.h:37
void MoveTo(Double_t x, Double_t y)
Move to a new position.
Definition TPDF.cxx:1428
void SetLineScale(Float_t scale=1)
Definition TPDF.h:99
Int_t fNbObj
Number of objects.
Definition TPDF.h:47
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) override
Draw a Frame around a box.
Definition TPDF.cxx:416
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
Definition TPDF.cxx:180
~TPDF() override
Default PDF destructor.
Definition TPDF.cxx:161
void EndObject()
Close the current opened object.
Definition TPDF.cxx:1374
void PrintStr(const char *string="") override
Output the string str in the output buffer.
Definition TPDF.cxx:1834
Int_t fNbPage
Number of pages.
Definition TPDF.h:48
void SetFillPatterns(Int_t ipat, Int_t color)
Set the fill patterns (1 to 25) for fill areas.
Definition TPDF.cxx:1986
void SetTextColor(Color_t cindex=1) override
Set color index for text.
Definition TPDF.cxx:2139
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
Definition TPDF.cxx:534
Float_t fXsize
Page size along X.
Definition TPDF.h:38
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
Begin the Cell Array painting.
Definition TPDF.cxx:171
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
Definition TPDF.cxx:456
void SetLineWidth(Width_t linewidth=1) override
Change the line width.
Definition TPDF.cxx:2118
Double_t VtoPDF(Double_t v)
Convert V from NDC coordinate to PDF.
Definition TPDF.cxx:2380
Bool_t fPageNotEmpty
True if the current page is not empty.
Definition TPDF.h:49
void NewObject(Int_t n)
Create a new object in the PDF file.
Definition TPDF.cxx:1438
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
Definition TPDF.cxx:480
void Text(Double_t x, Double_t y, const char *string) override
Draw text.
Definition TPDF.cxx:2151
void PatternEncode()
Patterns encoding.
Definition TPDF.cxx:2473
Int_t * fObjPos
Objects position.
Definition TPDF.h:45
void WriteCompressedBuffer()
Write the buffer in a compressed way.
Definition TPDF.cxx:2407
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Definition TPDF.cxx:2351
static Int_t fgLineJoin
Appearance of joining lines.
Definition TPDF.h:53
void PrintFast(Int_t nch, const char *string="") override
Fast version of Print.
Definition TPDF.cxx:1856
2-D graphics point (world coordinates).
Definition TPoints.h:19
static char * ReAllocChar(char *vp, size_t size, size_t oldsize)
Reallocate (i.e.
Definition TStorage.cxx:227
Basic string class.
Definition TString.h:138
Int_t GetJoinLinePS() const
Returns the line join method used for PostScript, PDF and SVG output. See TPostScript::SetLineJoin fo...
Definition TStyle.h:289
Int_t GetColorModelPS() const
Definition TStyle.h:198
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition TStyle.cxx:1167
Int_t GetCapLinePS() const
Returns the line cap method used for PostScript, PDF and SVG output. See TPostScript::SetLineCap for ...
Definition TStyle.h:290
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
Definition TStyle.cxx:1184
Float_t GetLineScalePS() const
Definition TStyle.h:291
Base class for several text objects.
Definition TText.h:22
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
Definition TText.cxx:590
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:619
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition TVirtualPS.h:30
Int_t fSizBuffer
Definition TVirtualPS.h:39
Int_t fLenBuffer
Definition TVirtualPS.h:38
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
virtual void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
std::ofstream * fStream
Definition TVirtualPS.h:41
char * fBuffer
Definition TVirtualPS.h:42
Int_t fNByte
Definition TVirtualPS.h:37
TCanvas * kerning()
Definition kerning.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:251
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:691
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:673
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Definition TMath.h:732
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:199
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
constexpr Double_t Pi()
Definition TMath.h:40
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
TMarker m
Definition textangle.C:8