229#pragma optimize("",off)
251#include "../../../graf2d/mathtext/inc/fontembed.h"
358 Warning(
"Open",
"postscript file already open");
384 ww *=
gPad->GetWNDC();
385 wh *=
gPad->GetHNDC();
390 yrange = xrange*ratio;
391 if (yrange >
fXsize) { yrange =
fXsize; xrange = yrange/ratio;}
395 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
404 printf(
"ERROR in TPostScript::Open: Cannot open file:%s\n",
fFileName.
Data());
412 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
474 Error(
"Text",
"Cannot open temporary file: %s\n", tmpname.
Data());
486 FILE *sg = fopen(tmpname.
Data(),
"r");
488 Error(
"Text",
"Cannot open file: %s\n", tmpname.
Data());
492 while (fgets(
line,255,sg)) {
493 if (strstr(
line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
519 Error(
"On",
"no postscript file open");
589 PrintStr(
" NBBD NBB eq {exit} if");
595 PrintStr(
" /IX IX 1 add def} def");
605 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
616 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
620 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
621 PrintStr(
" /YY YY HT sub def clear} def");
680 PrintStr(
"/mp {newpath /y exch def /x exch def} def@");
681 PrintStr(
"/side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def@");
682 PrintStr(
"/mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def@");
683 PrintStr(
"/mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def@");
684 PrintStr(
"/mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def@");
688 PrintStr(
"/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
689 PrintStr(
"/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
690 PrintStr(
"/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
691 PrintStr(
"/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
692 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
693 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
694 PrintStr(
" 0 w3 neg d w3 neg 0 d cl s } def@");
695 PrintStr(
"/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
696 PrintStr(
" 4 {side} repeat cl fill gr} def@");
697 PrintStr(
"/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
698 PrintStr(
" 4 {side} repeat cl s gr} def@");
699 PrintStr(
"/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
700 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");
701 PrintStr(
" sub m w 1.44 div w 1.44 div d s} def@");
702 PrintStr(
"/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
703 PrintStr(
"/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
704 PrintStr(
"/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
705 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
706 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
707 PrintStr(
" 0 w3 neg d w3 neg 0 d cl f } def@");
708 PrintStr(
"/m35 {mp x y w2 add m w2 neg w2 neg d w2 w2 neg d w2 w2 d w2 neg w2 d");
709 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
710 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@");
711 PrintStr(
"/m37 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
712 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@");
713 PrintStr(
"/m38 {mp x w4 sub y w2 add m w4 neg w4 neg d 0 w2 neg d w4 w4 neg d");
714 PrintStr(
" w2 0 d w4 w4 d 0 w2 d w4 neg w4 d w2 neg 0 d");
715 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d cl s} def@");
716 PrintStr(
"/m39 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
717 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@");
718 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");
719 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@");
720 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");
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 f} def@");
722 PrintStr(
"/m42 {mp x y w2 add m w8 neg w2 -3 4 div mul d w2 -3 4 div mul w8 neg d");
723 PrintStr(
" w2 3 4 div mul w8 neg d w8 w2 -3 4 div mul d");
724 PrintStr(
" w8 w2 3 4 div mul d w2 3 4 div mul w8 d");
725 PrintStr(
" w2 -3 4 div mul w8 d w8 neg w2 3 4 div mul d cl s} def@");
726 PrintStr(
"/m43 {mp x y w2 add m w8 neg w2 -3 4 div mul d w2 -3 4 div mul w8 neg d");
727 PrintStr(
" w2 3 4 div mul w8 neg d w8 w2 -3 4 div mul d");
728 PrintStr(
" w8 w2 3 4 div mul d w2 3 4 div mul w8 d");
729 PrintStr(
" w2 -3 4 div mul w8 d w8 neg w2 3 4 div mul d cl f} def@");
730 PrintStr(
"/m44 {mp x y m w6 neg w2 d w2 2 3 div mul 0 d w6 neg w2 neg d");
731 PrintStr(
" w2 w6 d 0 w2 -2 3 div mul d w2 neg w6 d");
732 PrintStr(
" w6 w2 neg d w2 -2 3 div mul 0 d w6 w2 d");
733 PrintStr(
" w2 neg w6 neg d 0 w2 2 3 div mul d w2 w6 neg d cl s} def@");
734 PrintStr(
"/m45 {mp x y m w6 neg w2 d w2 2 3 div mul 0 d w6 neg w2 neg d");
735 PrintStr(
" w2 w6 d 0 w2 -2 3 div mul d w2 neg w6 d");
736 PrintStr(
" w6 w2 neg d w2 -2 3 div mul 0 d w6 w2 d");
737 PrintStr(
" w2 neg w6 neg d 0 w2 2 3 div mul d w2 w6 neg d cl f} def@");
738 PrintStr(
"/m46 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d ");
739 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
740 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@");
741 PrintStr(
"/m47 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d");
742 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
743 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@");
744 PrintStr(
"/m48 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d w4 w4 neg d ");
745 PrintStr(
" w4 neg w4 neg d w4 w4 neg d w4 w4 d w4 w4 neg d w4 w4 d");
746 PrintStr(
" w4 neg w4 d w4 w4 d w4 neg w4 d w4 neg w4 neg d ");
747 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 neg w4 d w4 w4 d cl f} def@");
748 PrintStr(
"/m49 {mp x w2 sub w3 add y w2 sub w3 add m ");
749 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");
750 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@");
751 PrintStr(
"/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
752 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@");
768 if (fillis == 3 || fillis == 2) {
770 x[0] =
x1;
y[0] = y1;
771 x[1] =
x2;
y[1] = y1;
772 x[2] =
x2;
y[2] = y2;
773 x[3] =
x1;
y[3] = y2;
776 if (fillsi > 0 && fillsi < 26) {
777 x[0] =
x1;
y[0] = y1;
778 x[1] =
x2;
y[1] = y1;
779 x[2] =
x2;
y[2] = y2;
780 x[3] =
x1;
y[3] = y2;
823 static Int_t xps[7], yps[7];
824 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
829 Int_t bordPS = 4*border;
831 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
832 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
833 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
835 xps[5] = xps[0]; yps[5] = yps[4];
836 xps[6] = xps[0]; yps[6] = yps[0];
854 if( idx ) {
MovePS(idx,0); idx = 0; }
855 if( idy ) {
MovePS(0,idy); idy = 0; }
860 if( idy ) {
MovePS(0,idy); idy = 0; }
861 if( !idx ) { idx = ix;
continue;}
862 if( ix*idx > 0 ) idx += ix;
863 else {
MovePS(idx,0); idx = ix; }
867 if( idx ) {
MovePS(idx,0); idx = 0; }
868 if( !idy) { idy = iy;
continue;}
869 if( iy*idy > 0 ) idy += iy;
870 else {
MovePS(0,idy); idy = iy; }
881 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
882 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
883 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
885 xps[5] = xps[4]; yps[5] = yps[0];
886 xps[6] = xps[0]; yps[6] = yps[0];
904 if( idx ) {
MovePS(idx,0); idx = 0; }
905 if( idy ) {
MovePS(0,idy); idy = 0; }
910 if( idy ) {
MovePS(0,idy); idy = 0; }
911 if( !idx ) { idx = ix;
continue;}
912 if( ix*idx > 0 ) idx += ix;
913 else {
MovePS(idx,0); idx = ix; }
917 if( idx ) {
MovePS(idx,0); idx = 0; }
918 if( !idy) { idy = iy;
continue;}
919 if( iy*idy > 0 ) idy += iy;
920 else {
MovePS(0,idy); idy = iy; }
940 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
961 if(
n == 0)
goto END;
977 if( idx ) {
MovePS(idx,0); idx = 0; }
978 if( idy ) {
MovePS(0,idy); idy = 0; }
983 if( idy ) {
MovePS(0,idy); idy = 0; }
984 if( !idx ) { idx = ix;
continue;}
985 if( ix*idx > 0 ) idx += ix;
986 else {
MovePS(idx,0); idx = ix; }
990 if( idx ) {
MovePS(idx,0); idx = 0; }
991 if( !idy) { idy = iy;
continue;}
992 if( iy*idy > 0 ) idy += iy;
993 else {
MovePS(0,idy); idy = iy; }
1024 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
1045 if(
n == 0)
goto END;
1061 if( idx ) {
MovePS(idx,0); idx = 0; }
1062 if( idy ) {
MovePS(0,idy); idy = 0; }
1067 if( idy ) {
MovePS(0,idy); idy = 0; }
1068 if( !idx ) { idx = ix;
continue;}
1069 if( ix*idx > 0 ) idx += ix;
1070 else {
MovePS(idx,0); idx = ix; }
1074 if( idx ) {
MovePS(idx,0); idx = 0; }
1075 if( !idy) { idy = iy;
continue;}
1076 if( iy*idy > 0 ) idy += iy;
1077 else {
MovePS(0,idy); idy = iy; }
1101 Int_t i, np, markerstyle;
1103 static char chtemp[10];
1113 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1114 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1115 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1116 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1117 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1118 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1119 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1120 if (markerstyle >= 20 && markerstyle <= 49 )
snprintf(chtemp,10,
" m%d", markerstyle);
1121 if (markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1124 if (markerstyle == 1 || (markerstyle >= 9 && markerstyle <= 19)) {
1126 }
else if (markerstyle == 6) {
1128 }
else if (markerstyle == 7) {
1132 const Int_t kBASEMARKER = 8;
1133 Float_t sbase = symbolsize*kBASEMARKER;
1135 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1142 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1158 if (np == 100 || i ==
n-1) {
1175 Int_t i, np, markerstyle;
1177 static char chtemp[10];
1187 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1188 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1189 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1190 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1191 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1192 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1193 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1194 if (markerstyle >= 20 && markerstyle <= 49 )
snprintf(chtemp,10,
" m%d", markerstyle);
1195 if (markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1198 if (markerstyle == 1 || (markerstyle >= 9 && markerstyle <= 19)) {
1200 }
else if (markerstyle == 6) {
1202 }
else if (markerstyle == 7) {
1206 const Int_t kBASEMARKER = 8;
1207 Float_t sbase = symbolsize*kBASEMARKER;
1209 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1216 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1232 if (np == 100 || i ==
n-1) {
1256 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1257 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1258 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1259 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1260 180, 90,135, 45,150, 30,120, 60,
1261 180, 90,135, 45,150, 30,120, 60};
1262 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1263 fais = fasi =
n = 0;
1283 if (fais == 3 || fais == 2) {
1284 if (fasi > 100 && fasi <125) {
1285 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1288 if (fasi > 0 && fasi < 26) {
1299 if(
n == 0)
goto END;
1307 ixdi =
XtoPS(xw[i]);
1308 iydi =
YtoPS(yw[i]);
1314 if( idx ) {
MovePS(idx,0); idx = 0; }
1315 if( idy ) {
MovePS(0,idy); idy = 0; }
1318 if( idy ) {
MovePS(0,idy); idy = 0;}
1319 if( !idx ) { idx = ix;}
1321 else {
MovePS(idx,0); idx = ix;}
1323 if( idx ) {
MovePS(idx,0); idx = 0;}
1324 if( !idy) { idy = iy;}
1326 else {
MovePS(0,idy); idy = iy;}
1333 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1336 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1337 if (fais == 3 || fais == 2) {
1338 if (fasi > 0 && fasi < 26) {
1367 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1368 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1369 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1370 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1371 180, 90,135, 45,150, 30,120, 60,
1372 180, 90,135, 45,150, 30,120, 60};
1373 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1374 fais = fasi =
n = 0;
1394 if (fais == 3 || fais == 2) {
1395 if (fasi > 100 && fasi <125) {
1396 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1399 if (fasi > 0 && fasi < 26) {
1410 if(
n == 0)
goto END;
1418 ixdi =
XtoPS(xw[i]);
1419 iydi =
YtoPS(yw[i]);
1425 if( idx ) {
MovePS(idx,0); idx = 0; }
1426 if( idy ) {
MovePS(0,idy); idy = 0; }
1429 if( idy ) {
MovePS(0,idy); idy = 0;}
1430 if( !idx ) { idx = ix;}
1432 else {
MovePS(idx,0); idx = ix;}
1434 if( idx ) {
MovePS(idx,0); idx = 0;}
1435 if( !idy) { idy = iy;}
1437 else {
MovePS(0,idy); idy = iy;}
1444 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1447 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1448 if (fais == 3 || fais == 2) {
1449 if (fasi > 0 && fasi < 26) {
1471 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1479 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1486 std::ifstream font_file(filename, std::ios::binary);
1490 font_file.seekg(0, std::ios::end);
1492 const size_t font_file_length = font_file.tellg();
1494 font_file.seekg(0, std::ios::beg);
1496 std::vector<unsigned char> font_data(font_file_length,
'\0');
1498 font_file.read(
reinterpret_cast<char *
>(&font_data[0]),
1501 std::string font_name;
1502 std::string postscript_string =
1503 mathtext::font_embed_postscript_t::font_embed_type_1(
1504 font_name, font_data);
1506 if (!postscript_string.empty()) {
1507 PrintRaw(postscript_string.size(), postscript_string.data());
1520 std::ifstream font_file(filename, std::ios::binary);
1524 font_file.seekg(0, std::ios::end);
1526 const size_t font_file_length = font_file.tellg();
1528 font_file.seekg(0, std::ios::beg);
1530 std::vector<unsigned char> font_data(font_file_length,
'\0');
1532 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1534 std::string font_name;
1535 std::string postscript_string =
1536 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1538 if (!postscript_string.empty()) {
1539 PrintRaw(postscript_string.size(), postscript_string.data());
1552 std::ifstream font_file(filename, std::ios::binary);
1556 font_file.seekg(0, std::ios::end);
1558 const size_t font_file_length = font_file.tellg();
1560 font_file.seekg(0, std::ios::beg);
1562 std::vector<unsigned char> font_data(font_file_length,
'\0');
1564 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1566 std::string font_name;
1567 std::string postscript_string =
1568 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1570 if (!postscript_string.empty()) {
1571 PrintRaw(postscript_string.size(), postscript_string.data());
1576 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1586 static const char *fonttable[32][2] = {
1587 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1588 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1589 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1590 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1591 {
"Root.TTFont.4",
"FreeSans.otf" },
1592 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1593 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1594 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1595 {
"Root.TTFont.8",
"FreeMono.otf" },
1596 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1597 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1598 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1599 {
"Root.TTFont.12",
"symbol.ttf" },
1600 {
"Root.TTFont.13",
"FreeSerif.otf" },
1601 {
"Root.TTFont.14",
"wingding.ttf" },
1602 {
"Root.TTFont.15",
"symbol.ttf" },
1603 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1604 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1605 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1606 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1607 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1608 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1609 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1610 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1611 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1612 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1613 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1614 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1615 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1616 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1617 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1618 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1621 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1627 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1628 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1630 fonttable[fontid][0], fonttable[fontid][1]);
1633 Error(
"TPostScript::FontEmbed",
1634 "font %d (filename `%s') not found in path",
1644 Error(
"TPostScript::FontEmbed",
1645 "failed to embed font %d (filename `%s')",
1652 PrintStr(
"%%IncludeResource: font Times-Roman@");
1653 PrintStr(
"%%IncludeResource: font Times-Italic@");
1654 PrintStr(
"%%IncludeResource: font Times-Bold@");
1655 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1656 PrintStr(
"%%IncludeResource: font Helvetica@");
1657 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1658 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1659 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1660 PrintStr(
"%%IncludeResource: font Courier@");
1661 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1662 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1663 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1664 PrintStr(
"%%IncludeResource: font Symbol@");
1665 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1677 PrintStr(
" dup length dict begin");
1684 PrintStr(
" dup /FontName get exch");
1687 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1688 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1689 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1690 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1691 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1692 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1693 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1694 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1695 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1696 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1697 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1738 rpxmin = rpymin =
width = heigth = 0;
1750 if( fMode <= 0 || fMode > 5) {
1751 Error(
"Initialize",
"invalid file type %d",
fMode);
1767 format = atype/1000;
1768 if( format == 0 ) format = 4;
1769 if( format == 99 ) format = 0;
1773 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1775 if(!pstitle[0] &&
fMode != 3) {;
1777 if ( format <= 99 ) {;
1783 if ( format == 100 )
PrintFast(8,
" Letter)");
1784 if ( format == 200 )
PrintFast(7,
" Legal)");
1785 if ( format == 300 )
PrintFast(8,
" Ledger)");
1791 if (!strchr(pstitle,
'\n')) {
1798 PrintFast(24,
"%%Creator: ROOT Version ");
1815 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1816 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1817 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1819 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1821 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1823 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1824 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1825 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1826 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 @");
1827 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1828 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1840 width = (8.5*2.54)-2.*rpxmin;
1841 heigth = (11.*2.54)-2.*rpymin;
1844 width = (8.5*2.54)-2.*rpxmin;
1845 heigth = (14.*2.54)-2.*rpymin;
1848 width = (11.*2.54)-2.*rpxmin;
1849 heigth = (17.*2.54)-2.*rpymin;
1852 width = 21.0-2.*rpxmin;
1853 heigth = 29.7-2.*rpymin;
1863 width = (11.*2.54)-2.*rpxmin;
1864 heigth = (8.5*2.54)-2.*rpymin;
1867 width = (14.*2.54)-2.*rpxmin;
1868 heigth = (8.5*2.54)-2.*rpymin;
1871 width = (17.*2.54)-2.*rpxmin;
1872 heigth = (11.*2.54)-2.*rpymin;
1875 width = 29.7-2.*rpxmin;
1876 heigth = 21-2.*rpymin;
1895 width = (8.5*2.54)-2.*rpxmin;
1896 heigth = (11.*2.54)-2.*rpymin;
1899 width = (8.5*2.54)-2.*rpxmin;
1900 heigth = (14.*2.54)-2.*rpymin;
1903 width = (11.*2.54)-2.*rpxmin;
1904 heigth = (17.*2.54)-2.*rpymin;
1907 width = (21.0-2*rpxmin);
1908 heigth = (29.7-2.*rpymin);
1918 width = (11.*2.54)-2.*rpxmin;
1919 heigth = (8.5*2.54)-2.*rpymin;
1922 width = (14.*2.54)-2.*rpxmin;
1923 heigth = (8.5*2.54)-2.*rpymin;
1926 width = (17.*2.54)-2.*rpxmin;
1927 heigth = (11.*2.54)-2.*rpymin;
1930 width = (29.7-2*rpxmin);
1931 heigth = (21-2.*rpymin);
1937 else if (format == 100) value = 8.5*2.54;
1938 else if (format == 200) value = 8.5*2.54;
1939 else if (format == 300) value = 11.*2.54;
1940 if (format >= 100) format = 4;
1952 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
2004 if (ix != 0 && iy != 0) {
2008 }
else if (ix != 0) {
2011 }
else if (iy != 0) {
2033 Double_t xlow=0, ylow=0, xup=1, yup=1;
2035 xlow =
gPad->GetAbsXlowNDC();
2036 xup = xlow +
gPad->GetAbsWNDC();
2037 ylow =
gPad->GetAbsYlowNDC();
2038 yup = ylow +
gPad->GetAbsHNDC();
2062 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2067 else { xps = xsize; yps = ysize; }
2069 if( xsize <= xps && ysize < yps) {
2070 if ( xps > yps ) xymax = xps;
2074 dxwn = ((xps/xymax)-xncm)/2;
2075 dywn = ((yps/xymax)-yncm)/2;
2077 if (xps/yps < 1) xwkwn = xps/yps;
2079 if (yps/xps < 1) ywkwn = yps/xps;
2082 if (xsize < ysize) {
2083 xncm = ywkwn*xsize/ysize;
2085 dxwn = (xwkwn-xncm)/2;
2090 yncm = xwkwn*ysize/xsize;
2091 dywn = (ywkwn-yncm)/2;
2095 yncm = xwkwn*ysize/xsize;
2097 dywn = (ywkwn-yncm)/2;
2101 xncm = ywkwn*xsize/ysize;
2102 dxwn = (xwkwn-xncm)/2;
2167 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2172 PrintStr(
" /PaintProc { begin gsave");
2173 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2174 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2175 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2180 PrintStr(
" /PaintProc { begin gsave");
2181 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2182 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2183 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2188 PrintStr(
" /PaintProc { begin gsave");
2189 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2190 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2191 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2194 PrintStr(
" /BBox [ 0 0 100 100 ]");
2195 PrintStr(
" /XStep 100 /YStep 100");
2196 PrintStr(
" /PaintProc { begin gsave");
2198 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2201 PrintStr(
" /BBox [ 0 0 100 100 ]");
2202 PrintStr(
" /XStep 100 /YStep 100");
2203 PrintStr(
" /PaintProc { begin gsave");
2205 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2208 PrintStr(
" /BBox [ 0 0 100 100 ]");
2209 PrintStr(
" /XStep 100 /YStep 100");
2210 PrintStr(
" /PaintProc { begin gsave");
2212 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2215 PrintStr(
" /BBox [ 0 0 100 100 ]");
2216 PrintStr(
" /XStep 100 /YStep 100");
2217 PrintStr(
" /PaintProc { begin gsave");
2219 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2222 PrintStr(
" /BBox [ 0 0 101 101 ]");
2223 PrintStr(
" /XStep 100 /YStep 100");
2224 PrintStr(
" /PaintProc { begin gsave");
2225 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2226 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2227 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2228 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2229 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2230 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2233 PrintStr(
" /BBox [ 0 0 100 100 ]");
2234 PrintStr(
" /XStep 100 /YStep 100");
2235 PrintStr(
" /PaintProc { begin gsave");
2236 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2237 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2238 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2239 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2242 PrintStr(
" /BBox [ 0 0 100 100 ]");
2243 PrintStr(
" /XStep 100 /YStep 100");
2244 PrintStr(
" /PaintProc { begin gsave");
2245 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2246 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2248 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2251 PrintStr(
" /BBox [ 0 0 100 100 ]");
2252 PrintStr(
" /XStep 100 /YStep 100");
2253 PrintStr(
" /PaintProc { begin gsave");
2254 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2255 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2256 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2257 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2258 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2259 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2260 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2261 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2262 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2263 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2264 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2267 PrintStr(
" /BBox [ 0 0 100 100 ]");
2268 PrintStr(
" /XStep 100 /YStep 100");
2269 PrintStr(
" /PaintProc { begin gsave");
2270 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2271 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2272 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2273 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2274 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2275 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2276 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2277 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2278 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2281 PrintStr(
" /BBox [ 0 0 100 100 ]");
2282 PrintStr(
" /XStep 100 /YStep 100");
2283 PrintStr(
" /PaintProc { begin gsave");
2284 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2285 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2288 PrintStr(
" /BBox [ 0 0 100 100 ]");
2290 PrintStr(
" /PaintProc { begin gsave");
2291 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2292 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2293 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2294 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2295 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2300 PrintStr(
" /PaintProc { begin gsave");
2301 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2302 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2303 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2304 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2305 PrintStr(
" 50 30 m 45 30 5 0 360");
2306 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2307 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2308 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2309 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2312 PrintStr(
" /BBox [ 0 0 100 100 ]");
2313 PrintStr(
" /XStep 100 /YStep 100");
2314 PrintStr(
" /PaintProc { begin gsave");
2315 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2316 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2317 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2320 PrintStr(
" /BBox [ 0 0 100 100 ]");
2321 PrintStr(
" /XStep 100 /YStep 100");
2322 PrintStr(
" /PaintProc { begin gsave");
2323 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2324 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2327 PrintStr(
" /BBox [ 0 0 100 100 ]");
2328 PrintStr(
" /XStep 100 /YStep 100");
2329 PrintStr(
" /PaintProc { begin gsave");
2330 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2331 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2334 PrintStr(
" /BBox [ 0 0 100 100 ]");
2335 PrintStr(
" /XStep 100 /YStep 100");
2336 PrintStr(
" /PaintProc { begin gsave");
2337 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2338 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2339 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2340 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2341 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2342 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2345 PrintStr(
" /BBox [ 0 0 100 100 ]");
2346 PrintStr(
" /XStep 100 /YStep 100");
2347 PrintStr(
" /PaintProc { begin gsave");
2348 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2349 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2350 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2353 PrintStr(
" /BBox [ 0 0 101 101 ]");
2354 PrintStr(
" /XStep 100 /YStep 100");
2355 PrintStr(
" /PaintProc { begin gsave");
2356 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2357 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2358 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2359 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2360 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2363 PrintStr(
" /BBox [ 0 0 101 101 ]");
2364 PrintStr(
" /XStep 100 /YStep 100");
2365 PrintStr(
" /PaintProc { begin gsave");
2366 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2367 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2368 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2369 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2370 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2373 PrintStr(
" /BBox [ 0 0 100 100 ]");
2374 PrintStr(
" /XStep 100 /YStep 100");
2375 PrintStr(
" /PaintProc { begin gsave");
2376 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2377 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2378 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2379 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2382 PrintStr(
" /BBox [ 0 0 100 100 ]");
2383 PrintStr(
" /XStep 100 /YStep 100");
2384 PrintStr(
" /PaintProc { begin gsave");
2385 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2386 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2387 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2388 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2389 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2390 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2391 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2392 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2393 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2394 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2395 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2396 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2397 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2400 PrintStr(
" /BBox [ 0 0 101 101 ]");
2401 PrintStr(
" /XStep 100 /YStep 100");
2402 PrintStr(
" /PaintProc { begin gsave");
2403 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2404 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2405 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2407 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2415 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2416 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2418 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2419 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2439 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2440 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2441 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2530 Int_t nch = strlen(st);
2562 if (color < 0) color = 0;
2621 static const char *psfont[31][2] = {
2622 {
"Root.PSFont.1",
"/Times-Italic" },
2623 {
"Root.PSFont.2",
"/Times-Bold" },
2624 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2625 {
"Root.PSFont.4",
"/Helvetica" },
2626 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2627 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2628 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2629 {
"Root.PSFont.8",
"/Courier" },
2630 {
"Root.PSFont.9",
"/Courier-Oblique" },
2631 {
"Root.PSFont.10",
"/Courier-Bold" },
2632 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2633 {
"Root.PSFont.12",
"/Symbol" },
2634 {
"Root.PSFont.13",
"/Times-Roman" },
2635 {
"Root.PSFont.14",
"/ZapfDingbats" },
2636 {
"Root.PSFont.15",
"/Symbol" },
2637 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2638 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2639 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2640 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2641 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2642 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2643 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2644 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2645 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2646 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2647 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2648 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2649 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2650 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2651 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2652 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2670 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2674 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2676 Double_t fontsize = 4*(72*(ftsize)/2.54);
2677 if( fontsize <= 0)
return;
2683 if( font > 31 || font < 1) font = 1;
2690 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2692 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2696 }
else if (txalv == 2) {
2710 saveAttText.TAttText::operator=(*this);
2711 const Int_t len=strlen(chars);
2712 Int_t *charWidthsCumul = 0;
2718 t.TAttText::Modify();
2723 charWidthsCumul =
new Int_t[len];
2724 for (
Int_t i = len - 1;i >= 0;i--) {
2732 saveAttText.TAttText::Modify();
2764 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2765 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2776 for (
Int_t i = len-1; i >= 1; i--) {
2779 delete [] charWidthsCumul;
2791 for (
Int_t i=0; i<len;i++) {
2792 if (chars[i]!=
'\n') {
2793 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2796 }
else if ((chars[i]==
'-') && (font != 12)) {
2811 if (font != 15)
PrintStr(
" show NC");
2826 static const char *psfont[31][2] = {
2827 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2828 {
"Root.PSFont.2",
"/FreeSerifBold" },
2829 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2830 {
"Root.PSFont.4",
"/FreeSans" },
2831 {
"Root.PSFont.5",
"/FreeSansOblique" },
2832 {
"Root.PSFont.6",
"/FreeSansBold" },
2833 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2834 {
"Root.PSFont.8",
"/FreeMono" },
2835 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2836 {
"Root.PSFont.10",
"/FreeMonoBold" },
2837 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2838 {
"Root.PSFont.12",
"/SymbolMT" },
2839 {
"Root.PSFont.13",
"/FreeSerif" },
2840 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2841 {
"Root.PSFont.15",
"/SymbolMT" },
2842 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2843 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2844 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2845 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2846 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2847 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2848 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2849 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2850 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2851 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2852 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2853 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2854 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2855 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2856 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2857 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2860 Int_t len = wcslen(chars);
2878 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2882 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2884 Double_t fontsize = 4*(72*(ftsize)/2.54);
2885 if( fontsize <= 0)
return;
2891 if( font > 29 || font < 1) font = 1;
2898 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2900 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2904 }
else if (txalv == 2) {
2939 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2940 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2947 for(
Int_t i = 0; i < len; i++) {
2951 const wchar_t *lower = std::lower_bound(
2955 *lower == chars[i]) {
2957 const unsigned long index =
2961 else if((
unsigned int)chars[i] < 0xffff) {
2964 (
unsigned int)chars[i]));
2969 (
unsigned int)chars[i]));
3010 return Int_t(0.5 + 288*
cm/2.54);
3019 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]
static const double x2[5]
static const double x1[5]
include TDocParser_001 C image html pict1_TDocParser_001 png width
static Bool_t MustEmbed[32]
char * Form(const char *fmt,...)
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.
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.
virtual const char * GetName() const
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.
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
Int_t fIYzone
Current zone along Y.
void Close(Option_t *opt="")
Close a PostScript file.
Int_t fType
PostScript workstation type.
TPostScript()
Default PostScript constructor.
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
static Int_t fgLineCap
Appearance of line caps.
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 SetFillColor(Color_t cindex=1)
Set color index for fill areas.
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 SetLineColor(Color_t cindex=1)
Set color index for lines.
void SetLineWidth(Width_t linewidth=1)
Change the line width.
Bool_t fClipStatus
Clipping Indicator.
Float_t fLineScale
Line width scale factor.
void Text(Double_t x, Double_t y, const char *string)
Write a string of characters.
Float_t fMarkerSizeCur
current transformed value of marker size
Bool_t fZone
Zone indicator.
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
Int_t fLastCellRed
Last red value.
void SetTextColor(Color_t cindex=1)
Set color index for text.
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 MovePS(Int_t x, Int_t y)
Move to a new position.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points x, y.
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 CellArrayEnd()
End the Cell Array painting.
Int_t fClip
Clipping mode.
TString fFileName
PS file name.
Int_t fNYzone
Number of zones along Y.
bool FontEmbedType1(const char *filename)
void SetLineStyle(Style_t linestyle=1)
Change the line style.
Float_t fGreen
Per cent of green.
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPostScript::fgLineCap.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
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 NewPage()
Move to a new PostScript page.
Int_t fSave
Number of gsave for restore.
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
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 DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light)
Draw a Frame around a box.
Float_t fX2v
X top right corner of paper.
void Open(const char *filename, Int_t type=-111)
Open a PostScript file.
void FontEmbed()
Embed font in PS file.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Draw a Cell Array.
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
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.
static constexpr double cm
Short_t Max(Short_t a, Short_t b)
Double_t Floor(Double_t x)
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Short_t Min(Short_t a, Short_t b)