229#pragma optimize("",off)
253#include "../../../graf2d/mathtext/inc/fontembed.h"
360 Warning(
"Open",
"postscript file already open");
386 ww *=
gPad->GetWNDC();
387 wh *=
gPad->GetHNDC();
392 yrange = xrange*ratio;
393 if (yrange >
fXsize) { yrange =
fXsize; xrange = yrange/ratio;}
397 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
406 printf(
"ERROR in TPostScript::Open: Cannot open file:%s\n",
fFileName.
Data());
414 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
476 Error(
"Text",
"Cannot open temporary file: %s\n", tmpname.
Data());
488 FILE *sg = fopen(tmpname.
Data(),
"r");
490 Error(
"Text",
"Cannot open file: %s\n", tmpname.
Data());
494 while (fgets(
line,255,sg)) {
495 if (strstr(
line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
521 Error(
"On",
"no postscript file open");
591 PrintStr(
" NBBD NBB eq {exit} if");
597 PrintStr(
" /IX IX 1 add def} def");
607 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
618 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
622 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
623 PrintStr(
" /YY YY HT sub def clear} def");
682 PrintStr(
"/mp {newpath /y exch def /x exch def} def@");
683 PrintStr(
"/side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def@");
684 PrintStr(
"/mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def@");
685 PrintStr(
"/mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def@");
686 PrintStr(
"/mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def@");
690 PrintStr(
"/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
691 PrintStr(
"/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
692 PrintStr(
"/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
693 PrintStr(
"/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
694 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
695 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
696 PrintStr(
" 0 w3 neg d w3 neg 0 d cl s } def@");
697 PrintStr(
"/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
698 PrintStr(
" 4 {side} repeat cl fill gr} def@");
699 PrintStr(
"/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
700 PrintStr(
" 4 {side} repeat cl s gr} def@");
701 PrintStr(
"/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
702 PrintStr(
" x w2 .707 mul sub y w2 .707 mul add m w 1.44 div w 1.44 div neg d x w2 .707 mul sub y w2 .707 mul");
703 PrintStr(
" sub m w 1.44 div w 1.44 div d s} def@");
704 PrintStr(
"/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
705 PrintStr(
"/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
706 PrintStr(
"/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
707 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
708 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
709 PrintStr(
" 0 w3 neg d w3 neg 0 d cl f } def@");
710 PrintStr(
"/m35 {mp x y w2 add m w2 neg w2 neg d w2 w2 neg d w2 w2 d w2 neg w2 d");
711 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
712 PrintStr(
"/m36 {mb x w2 sub y w2 add m w w neg d x w2 sub y w2 sub m w w d s} def@");
713 PrintStr(
"/m37 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
714 PrintStr(
" w4 neg w2 neg d w2 0 d w4 neg w2 d w2 0 d w4 neg w2 d w4 neg w2 neg d cl s} def@");
715 PrintStr(
"/m38 {mp x w4 sub y w2 add m w4 neg w4 neg d 0 w2 neg d w4 w4 neg d");
716 PrintStr(
" w2 0 d w4 w4 d 0 w2 d w4 neg w4 d w2 neg 0 d");
717 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d cl s} def@");
718 PrintStr(
"/m39 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
719 PrintStr(
" w4 neg w2 neg d w2 0 d w4 neg w2 d w2 0 d w4 neg w2 d w4 neg w2 neg d cl f} def@");
720 PrintStr(
"/m40 {mp x y m w4 w2 d w4 w4 neg d w2 neg w4 neg d w2 w4 neg d w4 neg w4 neg d");
721 PrintStr(
" w4 neg w2 d w4 neg w2 neg d w4 neg w4 d w2 w4 d w2 neg w4 d w4 w4 d w4 w2 neg d cl s} def@");
722 PrintStr(
"/m41 {mp x y m w4 w2 d w4 w4 neg d w2 neg w4 neg d w2 w4 neg d w4 neg w4 neg d");
723 PrintStr(
" w4 neg w2 d w4 neg w2 neg d w4 neg w4 d w2 w4 d w2 neg w4 d w4 w4 d w4 w2 neg d cl f} def@");
724 PrintStr(
"/m42 {mp x y w2 add m w8 neg w2 -3 4 div mul d w2 -3 4 div mul w8 neg d");
725 PrintStr(
" w2 3 4 div mul w8 neg d w8 w2 -3 4 div mul d");
726 PrintStr(
" w8 w2 3 4 div mul d w2 3 4 div mul w8 d");
727 PrintStr(
" w2 -3 4 div mul w8 d w8 neg w2 3 4 div mul d cl s} def@");
728 PrintStr(
"/m43 {mp x y w2 add m w8 neg w2 -3 4 div mul d w2 -3 4 div mul w8 neg d");
729 PrintStr(
" w2 3 4 div mul w8 neg d w8 w2 -3 4 div mul d");
730 PrintStr(
" w8 w2 3 4 div mul d w2 3 4 div mul w8 d");
731 PrintStr(
" w2 -3 4 div mul w8 d w8 neg w2 3 4 div mul d cl f} def@");
732 PrintStr(
"/m44 {mp x y m w6 neg w2 d w2 2 3 div mul 0 d w6 neg w2 neg d");
733 PrintStr(
" w2 w6 d 0 w2 -2 3 div mul d w2 neg w6 d");
734 PrintStr(
" w6 w2 neg d w2 -2 3 div mul 0 d w6 w2 d");
735 PrintStr(
" w2 neg w6 neg d 0 w2 2 3 div mul d w2 w6 neg d cl s} def@");
736 PrintStr(
"/m45 {mp x y m w6 neg w2 d w2 2 3 div mul 0 d w6 neg w2 neg d");
737 PrintStr(
" w2 w6 d 0 w2 -2 3 div mul d w2 neg w6 d");
738 PrintStr(
" w6 w2 neg d w2 -2 3 div mul 0 d w6 w2 d");
739 PrintStr(
" w2 neg w6 neg d 0 w2 2 3 div mul d w2 w6 neg d cl f} def@");
740 PrintStr(
"/m46 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d ");
741 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
742 PrintStr(
" w4 w4 neg d w4 w4 d w4 neg w4 d w4 w4 d w4 neg w4 d w4 neg w4 neg d cl s} def@");
743 PrintStr(
"/m47 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d");
744 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
745 PrintStr(
" w4 w4 neg d w4 w4 d w4 neg w4 d w4 w4 d w4 neg w4 d w4 neg w4 neg d cl f} def@");
746 PrintStr(
"/m48 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d w4 w4 neg d ");
747 PrintStr(
" w4 neg w4 neg d w4 w4 neg d w4 w4 d w4 w4 neg d w4 w4 d");
748 PrintStr(
" w4 neg w4 d w4 w4 d w4 neg w4 d w4 neg w4 neg d ");
749 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 neg w4 d w4 w4 d cl f} def@");
750 PrintStr(
"/m49 {mp x w2 sub w3 add y w2 sub w3 add m ");
751 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
752 PrintStr(
" 0 w3 neg d w3 neg 0 d 0 w3 neg d w3 0 d 0 w3 d w3 0 d 0 w3 neg d w3 neg 0 d cl f } def@");
753 PrintStr(
"/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
754 PrintStr(
"/m5 {mp x w2 .707 mul sub y w2 .707 mul sub m w 1.44 div w 1.44 div d x w2 .707 mul sub y w2 .707 mul add m w 1.44 div w 1.44 div neg d s} def@");
770 if (fillis == 3 || fillis == 2) {
778 if (fillsi > 0 && fillsi < 26) {
825 static Int_t xps[7], yps[7];
826 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
831 Int_t bordPS = 4*border;
833 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
834 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
835 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
837 xps[5] = xps[0]; yps[5] = yps[4];
838 xps[6] = xps[0]; yps[6] = yps[0];
856 if( idx ) {
MovePS(idx,0); idx = 0; }
857 if( idy ) {
MovePS(0,idy); idy = 0; }
862 if( idy ) {
MovePS(0,idy); idy = 0; }
863 if( !idx ) { idx = ix;
continue;}
864 if( ix*idx > 0 ) idx += ix;
865 else {
MovePS(idx,0); idx = ix; }
869 if( idx ) {
MovePS(idx,0); idx = 0; }
870 if( !idy) { idy = iy;
continue;}
871 if( iy*idy > 0 ) idy += iy;
872 else {
MovePS(0,idy); idy = iy; }
883 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
884 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
885 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
887 xps[5] = xps[4]; yps[5] = yps[0];
888 xps[6] = xps[0]; yps[6] = yps[0];
906 if( idx ) {
MovePS(idx,0); idx = 0; }
907 if( idy ) {
MovePS(0,idy); idy = 0; }
912 if( idy ) {
MovePS(0,idy); idy = 0; }
913 if( !idx ) { idx = ix;
continue;}
914 if( ix*idx > 0 ) idx += ix;
915 else {
MovePS(idx,0); idx = ix; }
919 if( idx ) {
MovePS(idx,0); idx = 0; }
920 if( !idy) { idy = iy;
continue;}
921 if( iy*idy > 0 ) idy += iy;
922 else {
MovePS(0,idy); idy = iy; }
942 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
963 if(
n == 0)
goto END;
979 if( idx ) {
MovePS(idx,0); idx = 0; }
980 if( idy ) {
MovePS(0,idy); idy = 0; }
985 if( idy ) {
MovePS(0,idy); idy = 0; }
986 if( !idx ) { idx = ix;
continue;}
987 if( ix*idx > 0 ) idx += ix;
988 else {
MovePS(idx,0); idx = ix; }
992 if( idx ) {
MovePS(idx,0); idx = 0; }
993 if( !idy) { idy = iy;
continue;}
994 if( iy*idy > 0 ) idy += iy;
995 else {
MovePS(0,idy); idy = iy; }
1026 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
1047 if(
n == 0)
goto END;
1063 if( idx ) {
MovePS(idx,0); idx = 0; }
1064 if( idy ) {
MovePS(0,idy); idy = 0; }
1069 if( idy ) {
MovePS(0,idy); idy = 0; }
1070 if( !idx ) { idx = ix;
continue;}
1071 if( ix*idx > 0 ) idx += ix;
1072 else {
MovePS(idx,0); idx = ix; }
1076 if( idx ) {
MovePS(idx,0); idx = 0; }
1077 if( !idy) { idy = iy;
continue;}
1078 if( iy*idy > 0 ) idy += iy;
1079 else {
MovePS(0,idy); idy = iy; }
1105 static char chtemp[10];
1123 if (
markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1134 const Int_t kBASEMARKER = 8;
1135 Float_t sbase = symbolsize*kBASEMARKER;
1137 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1144 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1160 if (
np == 100 || i ==
n-1) {
1179 static char chtemp[10];
1197 if (
markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1208 const Int_t kBASEMARKER = 8;
1209 Float_t sbase = symbolsize*kBASEMARKER;
1211 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1218 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1234 if (
np == 100 || i ==
n-1) {
1258 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1259 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1260 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1261 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1262 180, 90,135, 45,150, 30,120, 60,
1263 180, 90,135, 45,150, 30,120, 60};
1264 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1265 fais = fasi =
n = 0;
1285 if (fais == 3 || fais == 2) {
1286 if (fasi > 100 && fasi <125) {
1287 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1290 if (fasi > 0 && fasi < 26) {
1301 if(
n == 0)
goto END;
1309 ixdi =
XtoPS(xw[i]);
1310 iydi =
YtoPS(yw[i]);
1316 if( idx ) {
MovePS(idx,0); idx = 0; }
1317 if( idy ) {
MovePS(0,idy); idy = 0; }
1320 if( idy ) {
MovePS(0,idy); idy = 0;}
1321 if( !idx ) { idx = ix;}
1323 else {
MovePS(idx,0); idx = ix;}
1325 if( idx ) {
MovePS(idx,0); idx = 0;}
1326 if( !idy) { idy = iy;}
1328 else {
MovePS(0,idy); idy = iy;}
1335 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1338 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1339 if (fais == 3 || fais == 2) {
1340 if (fasi > 0 && fasi < 26) {
1369 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1370 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1371 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1372 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1373 180, 90,135, 45,150, 30,120, 60,
1374 180, 90,135, 45,150, 30,120, 60};
1375 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1376 fais = fasi =
n = 0;
1396 if (fais == 3 || fais == 2) {
1397 if (fasi > 100 && fasi <125) {
1398 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1401 if (fasi > 0 && fasi < 26) {
1412 if(
n == 0)
goto END;
1420 ixdi =
XtoPS(xw[i]);
1421 iydi =
YtoPS(yw[i]);
1427 if( idx ) {
MovePS(idx,0); idx = 0; }
1428 if( idy ) {
MovePS(0,idy); idy = 0; }
1431 if( idy ) {
MovePS(0,idy); idy = 0;}
1432 if( !idx ) { idx = ix;}
1434 else {
MovePS(idx,0); idx = ix;}
1436 if( idx ) {
MovePS(idx,0); idx = 0;}
1437 if( !idy) { idy = iy;}
1439 else {
MovePS(0,idy); idy = iy;}
1446 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1449 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1450 if (fais == 3 || fais == 2) {
1451 if (fasi > 0 && fasi < 26) {
1473 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1481 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1488 std::ifstream font_file(
filename, std::ios::binary);
1492 font_file.seekg(0, std::ios::end);
1494 const size_t font_file_length = font_file.tellg();
1496 font_file.seekg(0, std::ios::beg);
1498 std::vector<unsigned char> font_data(font_file_length,
'\0');
1500 font_file.read(
reinterpret_cast<char *
>(&font_data[0]),
1503 std::string font_name;
1504 std::string postscript_string =
1505 mathtext::font_embed_postscript_t::font_embed_type_1(
1506 font_name, font_data);
1508 if (!postscript_string.empty()) {
1509 PrintRaw(postscript_string.size(), postscript_string.data());
1522 std::ifstream font_file(
filename, std::ios::binary);
1526 font_file.seekg(0, std::ios::end);
1528 const size_t font_file_length = font_file.tellg();
1530 font_file.seekg(0, std::ios::beg);
1532 std::vector<unsigned char> font_data(font_file_length,
'\0');
1534 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1536 std::string font_name;
1537 std::string postscript_string =
1538 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1540 if (!postscript_string.empty()) {
1541 PrintRaw(postscript_string.size(), postscript_string.data());
1554 std::ifstream font_file(
filename, std::ios::binary);
1558 font_file.seekg(0, std::ios::end);
1560 const size_t font_file_length = font_file.tellg();
1562 font_file.seekg(0, std::ios::beg);
1564 std::vector<unsigned char> font_data(font_file_length,
'\0');
1566 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1568 std::string font_name;
1569 std::string postscript_string =
1570 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1572 if (!postscript_string.empty()) {
1573 PrintRaw(postscript_string.size(), postscript_string.data());
1578 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1588 static const char *fonttable[32][2] = {
1589 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1590 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1591 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1592 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1593 {
"Root.TTFont.4",
"FreeSans.otf" },
1594 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1595 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1596 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1597 {
"Root.TTFont.8",
"FreeMono.otf" },
1598 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1599 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1600 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1601 {
"Root.TTFont.12",
"symbol.ttf" },
1602 {
"Root.TTFont.13",
"FreeSerif.otf" },
1603 {
"Root.TTFont.14",
"wingding.ttf" },
1604 {
"Root.TTFont.15",
"symbol.ttf" },
1605 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1606 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1607 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1608 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1609 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1610 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1611 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1612 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1613 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1614 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1615 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1616 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1617 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1618 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1619 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1620 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1623 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1629 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1630 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1632 fonttable[fontid][0], fonttable[fontid][1]);
1635 Error(
"TPostScript::FontEmbed",
1636 "font %d (filename `%s') not found in path",
1646 Error(
"TPostScript::FontEmbed",
1647 "failed to embed font %d (filename `%s')",
1654 PrintStr(
"%%IncludeResource: font Times-Roman@");
1655 PrintStr(
"%%IncludeResource: font Times-Italic@");
1656 PrintStr(
"%%IncludeResource: font Times-Bold@");
1657 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1658 PrintStr(
"%%IncludeResource: font Helvetica@");
1659 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1660 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1661 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1662 PrintStr(
"%%IncludeResource: font Courier@");
1663 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1664 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1665 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1666 PrintStr(
"%%IncludeResource: font Symbol@");
1667 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1679 PrintStr(
" dup length dict begin");
1686 PrintStr(
" dup /FontName get exch");
1689 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1690 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1691 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1692 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1693 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1694 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1695 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1696 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1697 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1698 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1699 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1740 rpxmin = rpymin =
width = heigth = 0;
1752 if( fMode <= 0 || fMode > 5) {
1753 Error(
"Initialize",
"invalid file type %d",
fMode);
1775 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1777 if(!pstitle[0] &&
fMode != 3) {;
1793 if (!strchr(pstitle,
'\n')) {
1800 PrintFast(24,
"%%Creator: ROOT Version ");
1817 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1818 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1819 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1821 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1823 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1825 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1826 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1827 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1828 PrintStr(
"/bl {box s} def /bf {gsave box gsave f grestore 1 lw [] 0 sd s grestore} def /Y { 0 exch d} def /X { 0 d} def @");
1829 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1830 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1842 width = (8.5*2.54)-2.*rpxmin;
1843 heigth = (11.*2.54)-2.*rpymin;
1846 width = (8.5*2.54)-2.*rpxmin;
1847 heigth = (14.*2.54)-2.*rpymin;
1850 width = (11.*2.54)-2.*rpxmin;
1851 heigth = (17.*2.54)-2.*rpymin;
1854 width = 21.0-2.*rpxmin;
1855 heigth = 29.7-2.*rpymin;
1865 width = (11.*2.54)-2.*rpxmin;
1866 heigth = (8.5*2.54)-2.*rpymin;
1869 width = (14.*2.54)-2.*rpxmin;
1870 heigth = (8.5*2.54)-2.*rpymin;
1873 width = (17.*2.54)-2.*rpxmin;
1874 heigth = (11.*2.54)-2.*rpymin;
1877 width = 29.7-2.*rpxmin;
1878 heigth = 21-2.*rpymin;
1897 width = (8.5*2.54)-2.*rpxmin;
1898 heigth = (11.*2.54)-2.*rpymin;
1901 width = (8.5*2.54)-2.*rpxmin;
1902 heigth = (14.*2.54)-2.*rpymin;
1905 width = (11.*2.54)-2.*rpxmin;
1906 heigth = (17.*2.54)-2.*rpymin;
1909 width = (21.0-2*rpxmin);
1910 heigth = (29.7-2.*rpymin);
1920 width = (11.*2.54)-2.*rpxmin;
1921 heigth = (8.5*2.54)-2.*rpymin;
1924 width = (14.*2.54)-2.*rpxmin;
1925 heigth = (8.5*2.54)-2.*rpymin;
1928 width = (17.*2.54)-2.*rpxmin;
1929 heigth = (11.*2.54)-2.*rpymin;
1932 width = (29.7-2*rpxmin);
1933 heigth = (21-2.*rpymin);
1954 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
2006 if (ix != 0 && iy != 0) {
2010 }
else if (ix != 0) {
2013 }
else if (iy != 0) {
2035 Double_t xlow=0, ylow=0, xup=1, yup=1;
2037 xlow =
gPad->GetAbsXlowNDC();
2038 xup = xlow +
gPad->GetAbsWNDC();
2039 ylow =
gPad->GetAbsYlowNDC();
2040 yup = ylow +
gPad->GetAbsHNDC();
2064 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2069 else { xps = xsize; yps = ysize; }
2071 if( xsize <= xps && ysize < yps) {
2072 if ( xps > yps ) xymax = xps;
2076 dxwn = ((xps/xymax)-xncm)/2;
2077 dywn = ((yps/xymax)-yncm)/2;
2079 if (xps/yps < 1) xwkwn = xps/yps;
2081 if (yps/xps < 1) ywkwn = yps/xps;
2084 if (xsize < ysize) {
2085 xncm = ywkwn*xsize/ysize;
2087 dxwn = (xwkwn-xncm)/2;
2092 yncm = xwkwn*ysize/xsize;
2093 dywn = (ywkwn-yncm)/2;
2097 yncm = xwkwn*ysize/xsize;
2099 dywn = (ywkwn-yncm)/2;
2103 xncm = ywkwn*xsize/ysize;
2104 dxwn = (xwkwn-xncm)/2;
2169 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2174 PrintStr(
" /PaintProc { begin gsave");
2175 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2176 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2177 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2182 PrintStr(
" /PaintProc { begin gsave");
2183 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2184 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2185 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2190 PrintStr(
" /PaintProc { begin gsave");
2191 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2192 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2193 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2196 PrintStr(
" /BBox [ 0 0 100 100 ]");
2197 PrintStr(
" /XStep 100 /YStep 100");
2198 PrintStr(
" /PaintProc { begin gsave");
2200 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2203 PrintStr(
" /BBox [ 0 0 100 100 ]");
2204 PrintStr(
" /XStep 100 /YStep 100");
2205 PrintStr(
" /PaintProc { begin gsave");
2207 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2210 PrintStr(
" /BBox [ 0 0 100 100 ]");
2211 PrintStr(
" /XStep 100 /YStep 100");
2212 PrintStr(
" /PaintProc { begin gsave");
2214 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2217 PrintStr(
" /BBox [ 0 0 100 100 ]");
2218 PrintStr(
" /XStep 100 /YStep 100");
2219 PrintStr(
" /PaintProc { begin gsave");
2221 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2224 PrintStr(
" /BBox [ 0 0 101 101 ]");
2225 PrintStr(
" /XStep 100 /YStep 100");
2226 PrintStr(
" /PaintProc { begin gsave");
2227 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2228 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2229 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2230 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2231 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2232 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2235 PrintStr(
" /BBox [ 0 0 100 100 ]");
2236 PrintStr(
" /XStep 100 /YStep 100");
2237 PrintStr(
" /PaintProc { begin gsave");
2238 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2239 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2240 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2241 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2244 PrintStr(
" /BBox [ 0 0 100 100 ]");
2245 PrintStr(
" /XStep 100 /YStep 100");
2246 PrintStr(
" /PaintProc { begin gsave");
2247 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2248 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2250 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2253 PrintStr(
" /BBox [ 0 0 100 100 ]");
2254 PrintStr(
" /XStep 100 /YStep 100");
2255 PrintStr(
" /PaintProc { begin gsave");
2256 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2257 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2258 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2259 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2260 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2261 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2262 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2263 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2264 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2265 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2266 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2269 PrintStr(
" /BBox [ 0 0 100 100 ]");
2270 PrintStr(
" /XStep 100 /YStep 100");
2271 PrintStr(
" /PaintProc { begin gsave");
2272 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2273 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2274 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2275 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2276 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2277 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2278 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2279 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2280 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2283 PrintStr(
" /BBox [ 0 0 100 100 ]");
2284 PrintStr(
" /XStep 100 /YStep 100");
2285 PrintStr(
" /PaintProc { begin gsave");
2286 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2287 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2290 PrintStr(
" /BBox [ 0 0 100 100 ]");
2292 PrintStr(
" /PaintProc { begin gsave");
2293 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2294 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2295 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2296 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2297 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2302 PrintStr(
" /PaintProc { begin gsave");
2303 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2304 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2305 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2306 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2307 PrintStr(
" 50 30 m 45 30 5 0 360");
2308 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2309 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2310 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2311 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2314 PrintStr(
" /BBox [ 0 0 100 100 ]");
2315 PrintStr(
" /XStep 100 /YStep 100");
2316 PrintStr(
" /PaintProc { begin gsave");
2317 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2318 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2319 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2322 PrintStr(
" /BBox [ 0 0 100 100 ]");
2323 PrintStr(
" /XStep 100 /YStep 100");
2324 PrintStr(
" /PaintProc { begin gsave");
2325 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2326 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2329 PrintStr(
" /BBox [ 0 0 100 100 ]");
2330 PrintStr(
" /XStep 100 /YStep 100");
2331 PrintStr(
" /PaintProc { begin gsave");
2332 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2333 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2336 PrintStr(
" /BBox [ 0 0 100 100 ]");
2337 PrintStr(
" /XStep 100 /YStep 100");
2338 PrintStr(
" /PaintProc { begin gsave");
2339 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2340 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2341 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2342 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2343 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2344 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2347 PrintStr(
" /BBox [ 0 0 100 100 ]");
2348 PrintStr(
" /XStep 100 /YStep 100");
2349 PrintStr(
" /PaintProc { begin gsave");
2350 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2351 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2352 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2355 PrintStr(
" /BBox [ 0 0 101 101 ]");
2356 PrintStr(
" /XStep 100 /YStep 100");
2357 PrintStr(
" /PaintProc { begin gsave");
2358 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2359 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2360 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2361 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2362 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2365 PrintStr(
" /BBox [ 0 0 101 101 ]");
2366 PrintStr(
" /XStep 100 /YStep 100");
2367 PrintStr(
" /PaintProc { begin gsave");
2368 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2369 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2370 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2371 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2372 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2375 PrintStr(
" /BBox [ 0 0 100 100 ]");
2376 PrintStr(
" /XStep 100 /YStep 100");
2377 PrintStr(
" /PaintProc { begin gsave");
2378 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2379 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2380 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2381 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2384 PrintStr(
" /BBox [ 0 0 100 100 ]");
2385 PrintStr(
" /XStep 100 /YStep 100");
2386 PrintStr(
" /PaintProc { begin gsave");
2387 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2388 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2389 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2390 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2391 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2392 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2393 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2394 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2395 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2396 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2397 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2398 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2399 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2402 PrintStr(
" /BBox [ 0 0 101 101 ]");
2403 PrintStr(
" /XStep 100 /YStep 100");
2404 PrintStr(
" /PaintProc { begin gsave");
2405 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2406 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2407 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2409 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2417 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2418 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2420 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2421 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2441 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2442 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2443 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2532 Int_t nch = strlen(st);
2564 if (color < 0) color = 0;
2623 static const char *psfont[31][2] = {
2624 {
"Root.PSFont.1",
"/Times-Italic" },
2625 {
"Root.PSFont.2",
"/Times-Bold" },
2626 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2627 {
"Root.PSFont.4",
"/Helvetica" },
2628 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2629 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2630 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2631 {
"Root.PSFont.8",
"/Courier" },
2632 {
"Root.PSFont.9",
"/Courier-Oblique" },
2633 {
"Root.PSFont.10",
"/Courier-Bold" },
2634 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2635 {
"Root.PSFont.12",
"/Symbol" },
2636 {
"Root.PSFont.13",
"/Times-Roman" },
2637 {
"Root.PSFont.14",
"/ZapfDingbats" },
2638 {
"Root.PSFont.15",
"/Symbol" },
2639 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2640 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2641 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2642 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2643 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2644 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2645 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2646 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2647 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2648 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2649 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2650 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2651 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2652 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2653 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2654 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2672 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2676 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2678 Double_t fontsize = 4*(72*(ftsize)/2.54);
2679 if( fontsize <= 0)
return;
2685 if( font > 31 || font < 1) font = 1;
2692 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2694 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2698 }
else if (txalv == 2) {
2712 saveAttText.TAttText::operator=(*this);
2714 Int_t *charWidthsCumul =
nullptr;
2720 t.TAttText::Modify();
2726 for (
Int_t i =
len - 1;i >= 0;i--) {
2734 saveAttText.TAttText::Modify();
2766 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2767 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2778 for (
Int_t i =
len-1; i >= 1; i--) {
2781 delete [] charWidthsCumul;
2794 if (chars[i]!=
'\n') {
2795 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2798 }
else if ((chars[i]==
'-') && (font != 12)) {
2813 if (font != 15)
PrintStr(
" show NC");
2828 static const char *psfont[31][2] = {
2829 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2830 {
"Root.PSFont.2",
"/FreeSerifBold" },
2831 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2832 {
"Root.PSFont.4",
"/FreeSans" },
2833 {
"Root.PSFont.5",
"/FreeSansOblique" },
2834 {
"Root.PSFont.6",
"/FreeSansBold" },
2835 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2836 {
"Root.PSFont.8",
"/FreeMono" },
2837 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2838 {
"Root.PSFont.10",
"/FreeMonoBold" },
2839 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2840 {
"Root.PSFont.12",
"/SymbolMT" },
2841 {
"Root.PSFont.13",
"/FreeSerif" },
2842 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2843 {
"Root.PSFont.15",
"/SymbolMT" },
2844 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2845 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2846 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2847 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2848 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2849 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2850 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2851 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2852 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2853 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2854 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2855 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2856 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2857 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2858 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2859 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2880 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2884 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2886 Double_t fontsize = 4*(72*(ftsize)/2.54);
2887 if( fontsize <= 0)
return;
2893 if( font > 29 || font < 1) font = 1;
2900 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2902 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2906 }
else if (txalv == 2) {
2941 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2942 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2953 const wchar_t *lower = std::lower_bound(
2957 *lower == chars[i]) {
2959 const unsigned long index =
2963 else if((
unsigned int)chars[i] < 0xffff) {
2966 (
unsigned int)chars[i]));
2971 (
unsigned int)chars[i]));
3012 return Int_t(0.5 + 288*cm/2.54);
3021 return Int_t(0.5 + 288*cm/2.54);
static const wchar_t adobe_glyph_ucs[nadobe_glyph]
static const unsigned long nadobe_glyph
static const char * adobe_glyph_name[nadobe_glyph]
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 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 filename
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 np
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 index
Option_t Option_t markerstyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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 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 format
Option_t Option_t TPoint TPoint const char y1
static Bool_t MustEmbed[32]
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualPS * gVirtualPS
virtual Color_t GetFillColor() const
Return the fill area color.
Style_t fFillStyle
Fill area style.
Color_t fFillColor
Fill area color.
Width_t fLineWidth
Line width.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
Color_t fMarkerColor
Marker color.
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.
Style_t fMarkerStyle
Marker style.
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.
Float_t fTextAngle
Text angle.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Font_t fTextFont
Text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Short_t fTextAlign
Text alignment.
Float_t fTextSize
Text size.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
2-D graphics point (world coordinates).
void DefineMarkers()
Define the markers.
Float_t fXsize
Page size along X.
Int_t fIYzone
Current zone along Y.
Int_t fType
PostScript workstation type.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
Draw markers at the n WC points x, y.
TPostScript()
Default PostScript constructor.
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
void CellArrayEnd() override
End the Cell Array painting.
static Int_t fgLineCap
Appearance of line caps.
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Int_t fNBSameColorCell
Number of boxes with the same color.
void SetColor(Int_t color=1)
Set the current color.
Int_t fMode
PostScript mode.
Int_t fIXzone
Current zone along X.
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
void FontEncode()
Font Re-encoding.
Int_t fLastCellBlue
Last blue value.
Int_t fNbCellW
Number of boxes per line.
Float_t fX1v
X bottom left corner of paper.
Float_t fRed
Per cent of red.
Int_t fCurrentColor
current Postscript color index
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Draw a PolyLine.
Bool_t fClipStatus
Clipping Indicator.
Float_t fLineScale
Line width scale factor.
Float_t fMarkerSizeCur
current transformed value of marker size
Bool_t fZone
Zone indicator.
void Open(const char *filename, Int_t type=-111) override
Open a PostScript file.
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
Int_t fLastCellRed
Last red value.
void SetLineWidth(Width_t linewidth=1) override
Change the line width.
void Off()
Deactivate an already open PostScript file.
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
Bool_t fRange
True when a range has been defined.
Float_t fBlue
Per cent of blue.
void Text(Double_t x, Double_t y, const char *string) override
Write a string of characters.
void MovePS(Int_t x, Int_t y)
Move to a new position.
void Initialize()
PostScript Initialisation.
bool FontEmbedType2(const char *filename)
Int_t fNbCellLine
Number of boxes in the current line.
Float_t fMaxsize
Largest dimension of X and Y.
void SetFillColor(Color_t cindex=1) override
Set color index for fill areas.
Int_t fClip
Clipping mode.
TString fFileName
PS file name.
Int_t fNYzone
Number of zones along Y.
bool FontEmbedType1(const char *filename)
Float_t fGreen
Per cent of green.
void SetLineColor(Color_t cindex=1) override
Set color index for lines.
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPostScript::fgLineCap.
void NewPage() override
Move to a new PostScript page.
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
Bool_t fFontEmbed
True is FontEmbed has been called.
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.
Int_t fSave
Number of gsave for restore.
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
void SetTextColor(Color_t cindex=1) override
Set color index for text.
void On()
Activate an already open PostScript file.
bool FontEmbedType42(const char *filename)
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Int_t fNXzone
Number of zones along X.
void SetLineScale(Float_t scale=3)
Bool_t fBoundingBox
True for Encapsulated PostScript.
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
virtual ~TPostScript()
Default PostScript destructor.
char fPatterns[32]
Indicate if pattern n is defined.
Int_t fNbinCT
Number of entries in the current Cell Array.
static Int_t fgLineJoin
Appearance of joining lines.
Float_t fY2v
Y top right corner of paper.
Int_t fLastCellGreen
Last green value.
Float_t fY1v
Y bottom left corner of paper.
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Bool_t fClear
True when page must be cleared.
Int_t fMaxLines
Maximum number of lines in a PS array.
void Zone()
Initialize the PostScript page in zones.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
Draw a Cell Array.
Float_t fX2v
X top right corner of paper.
void FontEmbed()
Embed font in PS file.
void Close(Option_t *opt="") override
Close a PostScript file.
Int_t fNpages
number of pages
Float_t fYsize
Page size along Y.
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
const char * Data() const
Int_t GetJoinLinePS() const
Returns the line join method used for PostScript, PDF and SVG output. See TPostScript::SetLineJoin fo...
Int_t GetColorModelPS() const
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
const char * GetTitlePS() const
Int_t GetCapLinePS() const
Returns the line cap method used for PostScript, PDF and SVG output. See TPostScript::SetLineCap for ...
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
const char * GetHeaderPS() const
Float_t GetLineScalePS() const
virtual int GetPid()
Get process id.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual int Unlink(const char *name)
Unlink, i.e.
Base class for several text objects.
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
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.
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
virtual void PrintRaw(Int_t len, const char *str)
Print a raw.
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.
const char * fImplicitCREsc
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.