225#pragma optimize("",off)
246#include "../../../graf2d/mathtext/inc/fontembed.h"
353 Warning(
"Open",
"postscript file already open");
378 ww *=
gPad->GetWNDC();
379 wh *=
gPad->GetHNDC();
384 yrange = xrange*ratio;
385 if (yrange >
fXsize) { yrange =
fXsize; xrange = yrange/ratio;}
389 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
398 printf(
"ERROR in TPostScript::Open: Cannot open file:%s\n",
fFileName.
Data());
406 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
468 Error(
"Text",
"Cannot open temporary file: %s\n", tmpname.
Data());
480 FILE *sg = fopen(tmpname.
Data(),
"r");
482 Error(
"Text",
"Cannot open file: %s\n", tmpname.
Data());
486 while (fgets(
line,255,sg)) {
487 if (strstr(
line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
513 Error(
"On",
"no postscript file open");
583 PrintStr(
" NBBD NBB eq {exit} if");
589 PrintStr(
" /IX IX 1 add def} def");
599 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
610 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
614 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
615 PrintStr(
" /YY YY HT sub def clear} def");
674 PrintStr(
"/mp {newpath /y exch def /x exch def} def@");
675 PrintStr(
"/side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def@");
676 PrintStr(
"/mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def@");
677 PrintStr(
"/mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def@");
678 PrintStr(
"/mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def@");
682 PrintStr(
"/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
683 PrintStr(
"/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
684 PrintStr(
"/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
685 PrintStr(
"/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
686 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
687 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
688 PrintStr(
" 0 w3 neg d w3 neg 0 d cl s } def@");
689 PrintStr(
"/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
690 PrintStr(
" 4 {side} repeat cl fill gr} def@");
691 PrintStr(
"/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
692 PrintStr(
" 4 {side} repeat cl s gr} def@");
693 PrintStr(
"/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
694 PrintStr(
" x w2 sub y w2 add m w w neg d x w2 sub y w2");
696 PrintStr(
"/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
697 PrintStr(
"/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
698 PrintStr(
"/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
699 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
700 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
701 PrintStr(
" 0 w3 neg d w3 neg 0 d cl f } def@");
702 PrintStr(
"/m35 {mp x y w2 add m w2 neg w2 neg d w2 w2 neg d w2 w2 d w2 neg w2 d");
703 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
704 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@");
705 PrintStr(
"/m37 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
706 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@");
707 PrintStr(
"/m38 {mp x w4 sub y w2 add m w4 neg w4 neg d 0 w2 neg d w4 w4 neg d");
708 PrintStr(
" w2 0 d w4 w4 d 0 w2 d w4 neg w4 d w2 neg 0 d");
709 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d cl s} def@");
710 PrintStr(
"/m39 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
711 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@");
712 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");
713 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@");
714 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");
715 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@");
716 PrintStr(
"/m42 {mp x y w2 add m w8 neg w2 -3 4 div mul d w2 -3 4 div mul w8 neg d");
717 PrintStr(
" w2 3 4 div mul w8 neg d w8 w2 -3 4 div mul d");
718 PrintStr(
" w8 w2 3 4 div mul d w2 3 4 div mul w8 d");
719 PrintStr(
" w2 -3 4 div mul w8 d w8 neg w2 3 4 div mul d cl s} def@");
720 PrintStr(
"/m43 {mp x y w2 add m w8 neg w2 -3 4 div mul d w2 -3 4 div mul w8 neg d");
721 PrintStr(
" w2 3 4 div mul w8 neg d w8 w2 -3 4 div mul d");
722 PrintStr(
" w8 w2 3 4 div mul d w2 3 4 div mul w8 d");
723 PrintStr(
" w2 -3 4 div mul w8 d w8 neg w2 3 4 div mul d cl f} def@");
724 PrintStr(
"/m44 {mp x y m w6 neg w2 d w2 2 3 div mul 0 d w6 neg w2 neg d");
725 PrintStr(
" w2 w6 d 0 w2 -2 3 div mul d w2 neg w6 d");
726 PrintStr(
" w6 w2 neg d w2 -2 3 div mul 0 d w6 w2 d");
727 PrintStr(
" w2 neg w6 neg d 0 w2 2 3 div mul d w2 w6 neg d cl s} def@");
728 PrintStr(
"/m45 {mp x y m w6 neg w2 d w2 2 3 div mul 0 d w6 neg w2 neg d");
729 PrintStr(
" w2 w6 d 0 w2 -2 3 div mul d w2 neg w6 d");
730 PrintStr(
" w6 w2 neg d w2 -2 3 div mul 0 d w6 w2 d");
731 PrintStr(
" w2 neg w6 neg d 0 w2 2 3 div mul d w2 w6 neg d cl f} def@");
732 PrintStr(
"/m46 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d ");
733 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
734 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@");
735 PrintStr(
"/m47 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d");
736 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
737 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@");
738 PrintStr(
"/m48 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d w4 w4 neg d ");
739 PrintStr(
" w4 neg w4 neg d w4 w4 neg d w4 w4 d w4 w4 neg d w4 w4 d");
740 PrintStr(
" w4 neg w4 d w4 w4 d w4 neg w4 d w4 neg w4 neg d ");
741 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 neg w4 d w4 w4 d cl f} def@");
742 PrintStr(
"/m49 {mp x w2 sub w3 add y w2 sub w3 add m ");
743 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");
744 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@");
745 PrintStr(
"/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
746 PrintStr(
"/m5 {mp x w2 sub y w2 sub m w w d x w2 sub y w2 add m w w neg d s} def@");
762 if (fillis == 3 || fillis == 2) {
764 x[0] =
x1;
y[0] = y1;
765 x[1] =
x2;
y[1] = y1;
766 x[2] =
x2;
y[2] = y2;
767 x[3] =
x1;
y[3] = y2;
770 if (fillsi > 0 && fillsi < 26) {
771 x[0] =
x1;
y[0] = y1;
772 x[1] =
x2;
y[1] = y1;
773 x[2] =
x2;
y[2] = y2;
774 x[3] =
x1;
y[3] = y2;
817 static Int_t xps[7], yps[7];
818 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
823 Int_t bordPS = 4*border;
825 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
826 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
827 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
829 xps[5] = xps[0]; yps[5] = yps[4];
830 xps[6] = xps[0]; yps[6] = yps[0];
848 if( idx ) {
MovePS(idx,0); idx = 0; }
849 if( idy ) {
MovePS(0,idy); idy = 0; }
854 if( idy ) {
MovePS(0,idy); idy = 0; }
855 if( !idx ) { idx = ix;
continue;}
856 if( ix*idx > 0 ) idx += ix;
857 else {
MovePS(idx,0); idx = ix; }
861 if( idx ) {
MovePS(idx,0); idx = 0; }
862 if( !idy) { idy = iy;
continue;}
863 if( iy*idy > 0 ) idy += iy;
864 else {
MovePS(0,idy); idy = iy; }
875 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
876 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
877 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
879 xps[5] = xps[4]; yps[5] = yps[0];
880 xps[6] = xps[0]; yps[6] = yps[0];
898 if( idx ) {
MovePS(idx,0); idx = 0; }
899 if( idy ) {
MovePS(0,idy); idy = 0; }
904 if( idy ) {
MovePS(0,idy); idy = 0; }
905 if( !idx ) { idx = ix;
continue;}
906 if( ix*idx > 0 ) idx += ix;
907 else {
MovePS(idx,0); idx = ix; }
911 if( idx ) {
MovePS(idx,0); idx = 0; }
912 if( !idy) { idy = iy;
continue;}
913 if( iy*idy > 0 ) idy += iy;
914 else {
MovePS(0,idy); idy = iy; }
934 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
955 if(
n == 0)
goto END;
971 if( idx ) {
MovePS(idx,0); idx = 0; }
972 if( idy ) {
MovePS(0,idy); idy = 0; }
977 if( idy ) {
MovePS(0,idy); idy = 0; }
978 if( !idx ) { idx = ix;
continue;}
979 if( ix*idx > 0 ) idx += ix;
980 else {
MovePS(idx,0); idx = ix; }
984 if( idx ) {
MovePS(idx,0); idx = 0; }
985 if( !idy) { idy = iy;
continue;}
986 if( iy*idy > 0 ) idy += iy;
987 else {
MovePS(0,idy); idy = iy; }
1018 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
1039 if(
n == 0)
goto END;
1055 if( idx ) {
MovePS(idx,0); idx = 0; }
1056 if( idy ) {
MovePS(0,idy); idy = 0; }
1061 if( idy ) {
MovePS(0,idy); idy = 0; }
1062 if( !idx ) { idx = ix;
continue;}
1063 if( ix*idx > 0 ) idx += ix;
1064 else {
MovePS(idx,0); idx = ix; }
1068 if( idx ) {
MovePS(idx,0); idx = 0; }
1069 if( !idy) { idy = iy;
continue;}
1070 if( iy*idy > 0 ) idy += iy;
1071 else {
MovePS(0,idy); idy = iy; }
1095 Int_t i, np, markerstyle;
1097 static char chtemp[10];
1106 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1107 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1108 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1109 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1110 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1111 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1112 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1113 if (markerstyle >= 20 && markerstyle <= 49 )
snprintf(chtemp,10,
" m%d", markerstyle);
1114 if (markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1117 if (markerstyle == 1) {
1119 }
else if (markerstyle == 6) {
1121 }
else if (markerstyle == 7) {
1125 const Int_t kBASEMARKER = 8;
1126 Float_t sbase = symbolsize*kBASEMARKER;
1128 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1135 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1151 if (np == 100 || i ==
n-1) {
1168 Int_t i, np, markerstyle;
1170 static char chtemp[10];
1179 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1180 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1181 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1182 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1183 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1184 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1185 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1186 if (markerstyle >= 20 && markerstyle <= 49 )
snprintf(chtemp,10,
" m%d", markerstyle);
1187 if (markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1190 if (markerstyle == 1) {
1192 }
else if (markerstyle == 6) {
1194 }
else if (markerstyle == 7) {
1198 const Int_t kBASEMARKER = 8;
1199 Float_t sbase = symbolsize*kBASEMARKER;
1201 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1208 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1224 if (np == 100 || i ==
n-1) {
1248 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1249 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1250 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1251 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1252 180, 90,135, 45,150, 30,120, 60,
1253 180, 90,135, 45,150, 30,120, 60};
1254 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1255 fais = fasi =
n = 0;
1275 if (fais == 3 || fais == 2) {
1276 if (fasi > 100 && fasi <125) {
1277 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1280 if (fasi > 0 && fasi < 26) {
1291 if(
n == 0)
goto END;
1299 ixdi =
XtoPS(xw[i]);
1300 iydi =
YtoPS(yw[i]);
1306 if( idx ) {
MovePS(idx,0); idx = 0; }
1307 if( idy ) {
MovePS(0,idy); idy = 0; }
1310 if( idy ) {
MovePS(0,idy); idy = 0;}
1311 if( !idx ) { idx = ix;}
1313 else {
MovePS(idx,0); idx = ix;}
1315 if( idx ) {
MovePS(idx,0); idx = 0;}
1316 if( !idy) { idy = iy;}
1318 else {
MovePS(0,idy); idy = iy;}
1325 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1328 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1329 if (fais == 3 || fais == 2) {
1330 if (fasi > 0 && fasi < 26) {
1359 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1360 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1361 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1362 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1363 180, 90,135, 45,150, 30,120, 60,
1364 180, 90,135, 45,150, 30,120, 60};
1365 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1366 fais = fasi =
n = 0;
1386 if (fais == 3 || fais == 2) {
1387 if (fasi > 100 && fasi <125) {
1388 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1391 if (fasi > 0 && fasi < 26) {
1402 if(
n == 0)
goto END;
1410 ixdi =
XtoPS(xw[i]);
1411 iydi =
YtoPS(yw[i]);
1417 if( idx ) {
MovePS(idx,0); idx = 0; }
1418 if( idy ) {
MovePS(0,idy); idy = 0; }
1421 if( idy ) {
MovePS(0,idy); idy = 0;}
1422 if( !idx ) { idx = ix;}
1424 else {
MovePS(idx,0); idx = ix;}
1426 if( idx ) {
MovePS(idx,0); idx = 0;}
1427 if( !idy) { idy = iy;}
1429 else {
MovePS(0,idy); idy = iy;}
1436 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1439 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1440 if (fais == 3 || fais == 2) {
1441 if (fasi > 0 && fasi < 26) {
1463 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1471 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1478 std::ifstream font_file(filename, std::ios::binary);
1482 font_file.seekg(0, std::ios::end);
1484 const size_t font_file_length = font_file.tellg();
1486 font_file.seekg(0, std::ios::beg);
1488 std::vector<unsigned char> font_data(font_file_length,
'\0');
1490 font_file.read(
reinterpret_cast<char *
>(&font_data[0]),
1493 std::string font_name;
1494 std::string postscript_string =
1495 mathtext::font_embed_postscript_t::font_embed_type_1(
1496 font_name, font_data);
1498 if (!postscript_string.empty()) {
1499 PrintRaw(postscript_string.size(), postscript_string.data());
1512 std::ifstream font_file(filename, std::ios::binary);
1516 font_file.seekg(0, std::ios::end);
1518 const size_t font_file_length = font_file.tellg();
1520 font_file.seekg(0, std::ios::beg);
1522 std::vector<unsigned char> font_data(font_file_length,
'\0');
1524 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1526 std::string font_name;
1527 std::string postscript_string =
1528 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1530 if (!postscript_string.empty()) {
1531 PrintRaw(postscript_string.size(), postscript_string.data());
1544 std::ifstream font_file(filename, std::ios::binary);
1548 font_file.seekg(0, std::ios::end);
1550 const size_t font_file_length = font_file.tellg();
1552 font_file.seekg(0, std::ios::beg);
1554 std::vector<unsigned char> font_data(font_file_length,
'\0');
1556 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1558 std::string font_name;
1559 std::string postscript_string =
1560 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1562 if (!postscript_string.empty()) {
1563 PrintRaw(postscript_string.size(), postscript_string.data());
1568 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1578 static const char *fonttable[32][2] = {
1579 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1580 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1581 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1582 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1583 {
"Root.TTFont.4",
"FreeSans.otf" },
1584 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1585 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1586 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1587 {
"Root.TTFont.8",
"FreeMono.otf" },
1588 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1589 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1590 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1591 {
"Root.TTFont.12",
"symbol.ttf" },
1592 {
"Root.TTFont.13",
"FreeSerif.otf" },
1593 {
"Root.TTFont.14",
"wingding.ttf" },
1594 {
"Root.TTFont.15",
"symbol.ttf" },
1595 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1596 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1597 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1598 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1599 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1600 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1601 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1602 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1603 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1604 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1605 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1606 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1607 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1608 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1609 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1610 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1613 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1619 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1620 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1622 fonttable[fontid][0], fonttable[fontid][1]);
1625 Error(
"TPostScript::FontEmbed",
1626 "font %d (filename `%s') not found in path",
1636 Error(
"TPostScript::FontEmbed",
1637 "failed to embed font %d (filename `%s')",
1644 PrintStr(
"%%IncludeResource: font Times-Roman@");
1645 PrintStr(
"%%IncludeResource: font Times-Italic@");
1646 PrintStr(
"%%IncludeResource: font Times-Bold@");
1647 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1648 PrintStr(
"%%IncludeResource: font Helvetica@");
1649 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1650 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1651 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1652 PrintStr(
"%%IncludeResource: font Courier@");
1653 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1654 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1655 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1656 PrintStr(
"%%IncludeResource: font Symbol@");
1657 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1669 PrintStr(
" dup length dict begin");
1676 PrintStr(
" dup /FontName get exch");
1679 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1680 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1681 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1682 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1683 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1684 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1685 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1686 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1687 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1688 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1689 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1730 rpxmin = rpymin =
width = heigth = 0;
1742 if( fMode <= 0 || fMode > 5) {
1743 Error(
"Initialize",
"invalid file type %d",
fMode);
1759 format = atype/1000;
1760 if( format == 0 ) format = 4;
1761 if( format == 99 ) format = 0;
1765 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1767 if(!pstitle[0] &&
fMode != 3) {;
1769 if ( format <= 99 ) {;
1775 if ( format == 100 )
PrintFast(8,
" Letter)");
1776 if ( format == 200 )
PrintFast(7,
" Legal)");
1777 if ( format == 300 )
PrintFast(8,
" Ledger)");
1783 if (!strchr(pstitle,
'\n')) {
1790 PrintFast(24,
"%%Creator: ROOT Version ");
1807 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1808 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1809 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1811 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1813 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1815 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1816 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1817 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1818 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 @");
1819 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1820 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1832 width = (8.5*2.54)-2.*rpxmin;
1833 heigth = (11.*2.54)-2.*rpymin;
1836 width = (8.5*2.54)-2.*rpxmin;
1837 heigth = (14.*2.54)-2.*rpymin;
1840 width = (11.*2.54)-2.*rpxmin;
1841 heigth = (17.*2.54)-2.*rpymin;
1844 width = 21.0-2.*rpxmin;
1845 heigth = 29.7-2.*rpymin;
1855 width = (11.*2.54)-2.*rpxmin;
1856 heigth = (8.5*2.54)-2.*rpymin;
1859 width = (14.*2.54)-2.*rpxmin;
1860 heigth = (8.5*2.54)-2.*rpymin;
1863 width = (17.*2.54)-2.*rpxmin;
1864 heigth = (11.*2.54)-2.*rpymin;
1867 width = 29.7-2.*rpxmin;
1868 heigth = 21-2.*rpymin;
1887 width = (8.5*2.54)-2.*rpxmin;
1888 heigth = (11.*2.54)-2.*rpymin;
1891 width = (8.5*2.54)-2.*rpxmin;
1892 heigth = (14.*2.54)-2.*rpymin;
1895 width = (11.*2.54)-2.*rpxmin;
1896 heigth = (17.*2.54)-2.*rpymin;
1899 width = (21.0-2*rpxmin);
1900 heigth = (29.7-2.*rpymin);
1910 width = (11.*2.54)-2.*rpxmin;
1911 heigth = (8.5*2.54)-2.*rpymin;
1914 width = (14.*2.54)-2.*rpxmin;
1915 heigth = (8.5*2.54)-2.*rpymin;
1918 width = (17.*2.54)-2.*rpxmin;
1919 heigth = (11.*2.54)-2.*rpymin;
1922 width = (29.7-2*rpxmin);
1923 heigth = (21-2.*rpymin);
1929 else if (format == 100) value = 8.5*2.54;
1930 else if (format == 200) value = 8.5*2.54;
1931 else if (format == 300) value = 11.*2.54;
1932 if (format >= 100) format = 4;
1944 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
1996 if (ix != 0 && iy != 0) {
2000 }
else if (ix != 0) {
2003 }
else if (iy != 0) {
2025 Double_t xlow=0, ylow=0, xup=1, yup=1;
2027 xlow =
gPad->GetAbsXlowNDC();
2028 xup = xlow +
gPad->GetAbsWNDC();
2029 ylow =
gPad->GetAbsYlowNDC();
2030 yup = ylow +
gPad->GetAbsHNDC();
2054 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2059 else { xps = xsize; yps = ysize; }
2061 if( xsize <= xps && ysize < yps) {
2062 if ( xps > yps ) xymax = xps;
2066 dxwn = ((xps/xymax)-xncm)/2;
2067 dywn = ((yps/xymax)-yncm)/2;
2069 if (xps/yps < 1) xwkwn = xps/yps;
2071 if (yps/xps < 1) ywkwn = yps/xps;
2074 if (xsize < ysize) {
2075 xncm = ywkwn*xsize/ysize;
2077 dxwn = (xwkwn-xncm)/2;
2082 yncm = xwkwn*ysize/xsize;
2083 dywn = (ywkwn-yncm)/2;
2087 yncm = xwkwn*ysize/xsize;
2089 dywn = (ywkwn-yncm)/2;
2093 xncm = ywkwn*xsize/ysize;
2094 dxwn = (xwkwn-xncm)/2;
2159 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2164 PrintStr(
" /PaintProc { begin gsave");
2165 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2166 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2167 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2172 PrintStr(
" /PaintProc { begin gsave");
2173 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2174 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2175 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2180 PrintStr(
" /PaintProc { begin gsave");
2181 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2182 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2183 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2186 PrintStr(
" /BBox [ 0 0 100 100 ]");
2187 PrintStr(
" /XStep 100 /YStep 100");
2188 PrintStr(
" /PaintProc { begin gsave");
2190 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2193 PrintStr(
" /BBox [ 0 0 100 100 ]");
2194 PrintStr(
" /XStep 100 /YStep 100");
2195 PrintStr(
" /PaintProc { begin gsave");
2197 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2200 PrintStr(
" /BBox [ 0 0 100 100 ]");
2201 PrintStr(
" /XStep 100 /YStep 100");
2202 PrintStr(
" /PaintProc { begin gsave");
2204 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2207 PrintStr(
" /BBox [ 0 0 100 100 ]");
2208 PrintStr(
" /XStep 100 /YStep 100");
2209 PrintStr(
" /PaintProc { begin gsave");
2211 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2214 PrintStr(
" /BBox [ 0 0 101 101 ]");
2215 PrintStr(
" /XStep 100 /YStep 100");
2216 PrintStr(
" /PaintProc { begin gsave");
2217 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2218 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2219 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2220 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2221 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2222 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2225 PrintStr(
" /BBox [ 0 0 100 100 ]");
2226 PrintStr(
" /XStep 100 /YStep 100");
2227 PrintStr(
" /PaintProc { begin gsave");
2228 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2229 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2230 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2231 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2234 PrintStr(
" /BBox [ 0 0 100 100 ]");
2235 PrintStr(
" /XStep 100 /YStep 100");
2236 PrintStr(
" /PaintProc { begin gsave");
2237 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2238 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2240 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2243 PrintStr(
" /BBox [ 0 0 100 100 ]");
2244 PrintStr(
" /XStep 100 /YStep 100");
2245 PrintStr(
" /PaintProc { begin gsave");
2246 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2247 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2248 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2249 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2250 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2251 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2252 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2253 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2254 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2255 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2256 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2259 PrintStr(
" /BBox [ 0 0 100 100 ]");
2260 PrintStr(
" /XStep 100 /YStep 100");
2261 PrintStr(
" /PaintProc { begin gsave");
2262 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2263 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2264 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2265 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2266 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2267 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2268 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2269 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2270 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2273 PrintStr(
" /BBox [ 0 0 100 100 ]");
2274 PrintStr(
" /XStep 100 /YStep 100");
2275 PrintStr(
" /PaintProc { begin gsave");
2276 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2277 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2280 PrintStr(
" /BBox [ 0 0 100 100 ]");
2282 PrintStr(
" /PaintProc { begin gsave");
2283 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2284 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2285 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2286 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2287 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2292 PrintStr(
" /PaintProc { begin gsave");
2293 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2294 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2295 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2296 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2297 PrintStr(
" 50 30 m 45 30 5 0 360");
2298 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2299 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2300 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2301 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2304 PrintStr(
" /BBox [ 0 0 100 100 ]");
2305 PrintStr(
" /XStep 100 /YStep 100");
2306 PrintStr(
" /PaintProc { begin gsave");
2307 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2308 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2309 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2312 PrintStr(
" /BBox [ 0 0 100 100 ]");
2313 PrintStr(
" /XStep 100 /YStep 100");
2314 PrintStr(
" /PaintProc { begin gsave");
2315 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2316 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2319 PrintStr(
" /BBox [ 0 0 100 100 ]");
2320 PrintStr(
" /XStep 100 /YStep 100");
2321 PrintStr(
" /PaintProc { begin gsave");
2322 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2323 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2326 PrintStr(
" /BBox [ 0 0 100 100 ]");
2327 PrintStr(
" /XStep 100 /YStep 100");
2328 PrintStr(
" /PaintProc { begin gsave");
2329 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2330 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2331 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2332 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2333 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2334 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2337 PrintStr(
" /BBox [ 0 0 100 100 ]");
2338 PrintStr(
" /XStep 100 /YStep 100");
2339 PrintStr(
" /PaintProc { begin gsave");
2340 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2341 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2342 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2345 PrintStr(
" /BBox [ 0 0 101 101 ]");
2346 PrintStr(
" /XStep 100 /YStep 100");
2347 PrintStr(
" /PaintProc { begin gsave");
2348 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2349 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2350 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2351 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2352 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2355 PrintStr(
" /BBox [ 0 0 101 101 ]");
2356 PrintStr(
" /XStep 100 /YStep 100");
2357 PrintStr(
" /PaintProc { begin gsave");
2358 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2359 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2360 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2361 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2362 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2365 PrintStr(
" /BBox [ 0 0 100 100 ]");
2366 PrintStr(
" /XStep 100 /YStep 100");
2367 PrintStr(
" /PaintProc { begin gsave");
2368 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2369 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2370 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2371 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2374 PrintStr(
" /BBox [ 0 0 100 100 ]");
2375 PrintStr(
" /XStep 100 /YStep 100");
2376 PrintStr(
" /PaintProc { begin gsave");
2377 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2378 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2379 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2380 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2381 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2382 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2383 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2384 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2385 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2386 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2387 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2388 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2389 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2392 PrintStr(
" /BBox [ 0 0 101 101 ]");
2393 PrintStr(
" /XStep 100 /YStep 100");
2394 PrintStr(
" /PaintProc { begin gsave");
2395 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2396 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2397 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2399 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2407 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2408 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2410 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2411 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2431 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2432 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2433 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2498 Int_t nch = strlen(st);
2530 if (color < 0) color = 0;
2589 static const char *psfont[31][2] = {
2590 {
"Root.PSFont.1",
"/Times-Italic" },
2591 {
"Root.PSFont.2",
"/Times-Bold" },
2592 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2593 {
"Root.PSFont.4",
"/Helvetica" },
2594 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2595 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2596 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2597 {
"Root.PSFont.8",
"/Courier" },
2598 {
"Root.PSFont.9",
"/Courier-Oblique" },
2599 {
"Root.PSFont.10",
"/Courier-Bold" },
2600 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2601 {
"Root.PSFont.12",
"/Symbol" },
2602 {
"Root.PSFont.13",
"/Times-Roman" },
2603 {
"Root.PSFont.14",
"/ZapfDingbats" },
2604 {
"Root.PSFont.15",
"/Symbol" },
2605 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2606 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2607 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2608 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2609 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2610 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2611 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2612 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2613 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2614 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2615 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2616 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2617 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2618 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2619 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2620 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2638 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2642 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2644 Double_t fontsize = 4*(72*(ftsize)/2.54);
2645 if( fontsize <= 0)
return;
2651 if( font > 31 || font < 1) font = 1;
2658 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2660 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2664 }
else if (txalv == 2) {
2678 saveAttText.TAttText::operator=(*this);
2679 const Int_t len=strlen(chars);
2680 Int_t *charWidthsCumul = 0;
2686 t.TAttText::Modify();
2691 charWidthsCumul =
new Int_t[len];
2692 for (
Int_t i = len - 1;i >= 0;i--) {
2700 saveAttText.TAttText::Modify();
2732 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2733 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2744 for (
Int_t i = len-1; i >= 1; i--) {
2747 delete [] charWidthsCumul;
2759 for (
Int_t i=0; i<len;i++) {
2760 if (chars[i]!=
'\n') {
2761 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2764 }
else if ((chars[i]==
'-') && (font != 12)) {
2779 if (font != 15)
PrintStr(
" show NC");
2794 static const char *psfont[31][2] = {
2795 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2796 {
"Root.PSFont.2",
"/FreeSerifBold" },
2797 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2798 {
"Root.PSFont.4",
"/FreeSans" },
2799 {
"Root.PSFont.5",
"/FreeSansOblique" },
2800 {
"Root.PSFont.6",
"/FreeSansBold" },
2801 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2802 {
"Root.PSFont.8",
"/FreeMono" },
2803 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2804 {
"Root.PSFont.10",
"/FreeMonoBold" },
2805 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2806 {
"Root.PSFont.12",
"/SymbolMT" },
2807 {
"Root.PSFont.13",
"/FreeSerif" },
2808 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2809 {
"Root.PSFont.15",
"/SymbolMT" },
2810 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2811 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2812 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2813 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2814 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2815 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2816 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2817 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2818 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2819 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2820 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2821 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2822 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2823 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2824 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2825 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2828 Int_t len = wcslen(chars);
2846 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2850 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2852 Double_t fontsize = 4*(72*(ftsize)/2.54);
2853 if( fontsize <= 0)
return;
2859 if( font > 29 || font < 1) font = 1;
2866 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2868 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2872 }
else if (txalv == 2) {
2907 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2908 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2915 for(
Int_t i = 0; i < len; i++) {
2919 const wchar_t *lower = std::lower_bound(
2923 *lower == chars[i]) {
2925 const unsigned long index =
2929 else if((
unsigned int)chars[i] < 0xffff) {
2932 (
unsigned int)chars[i]));
2937 (
unsigned int)chars[i]));
2978 return Int_t(0.5 + 288*
cm/2.54);
2987 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.
Size_t fMarkerSize
Marker size.
Style_t fMarkerStyle
Marker style.
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.
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 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 fLineJoin
Appearance of joining lines.
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
Int_t GetColorModelPS() const
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
const char * GetTitlePS() const
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
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Short_t Min(Short_t a, Short_t b)