229#pragma optimize("",off)
250#include "../../../graf2d/mathtext/inc/fontembed.h"
357 Warning(
"Open",
"postscript file already open");
382 ww *=
gPad->GetWNDC();
383 wh *=
gPad->GetHNDC();
388 yrange = xrange*ratio;
389 if (yrange >
fXsize) { yrange =
fXsize; xrange = yrange/ratio;}
393 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
402 printf(
"ERROR in TPostScript::Open: Cannot open file:%s\n",
fFileName.
Data());
410 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
472 Error(
"Text",
"Cannot open temporary file: %s\n", tmpname.
Data());
484 FILE *sg = fopen(tmpname.
Data(),
"r");
486 Error(
"Text",
"Cannot open file: %s\n", tmpname.
Data());
490 while (fgets(
line,255,sg)) {
491 if (strstr(
line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
517 Error(
"On",
"no postscript file open");
587 PrintStr(
" NBBD NBB eq {exit} if");
593 PrintStr(
" /IX IX 1 add def} def");
603 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
614 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
618 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
619 PrintStr(
" /YY YY HT sub def clear} def");
678 PrintStr(
"/mp {newpath /y exch def /x exch def} def@");
679 PrintStr(
"/side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def@");
680 PrintStr(
"/mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def@");
681 PrintStr(
"/mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def@");
682 PrintStr(
"/mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def@");
686 PrintStr(
"/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
687 PrintStr(
"/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
688 PrintStr(
"/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
689 PrintStr(
"/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
690 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
691 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
692 PrintStr(
" 0 w3 neg d w3 neg 0 d cl s } def@");
693 PrintStr(
"/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
694 PrintStr(
" 4 {side} repeat cl fill gr} def@");
695 PrintStr(
"/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
696 PrintStr(
" 4 {side} repeat cl s gr} def@");
697 PrintStr(
"/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
698 PrintStr(
" x w2 sub y w2 add m w w neg d x w2 sub y w2");
700 PrintStr(
"/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
701 PrintStr(
"/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
702 PrintStr(
"/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
703 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
704 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
705 PrintStr(
" 0 w3 neg d w3 neg 0 d cl f } def@");
706 PrintStr(
"/m35 {mp x y w2 add m w2 neg w2 neg d w2 w2 neg d w2 w2 d w2 neg w2 d");
707 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
708 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@");
709 PrintStr(
"/m37 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
710 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@");
711 PrintStr(
"/m38 {mp x w4 sub y w2 add m w4 neg w4 neg d 0 w2 neg d w4 w4 neg d");
712 PrintStr(
" w2 0 d w4 w4 d 0 w2 d w4 neg w4 d w2 neg 0 d");
713 PrintStr(
" x y w2 sub m 0 w d x w2 sub y m w 0 d cl s} def@");
714 PrintStr(
"/m39 {mp x y m w4 neg w2 d w4 neg w2 neg d w2 0 d ");
715 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@");
716 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");
717 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@");
718 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");
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 f} def@");
720 PrintStr(
"/m42 {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 s} def@");
724 PrintStr(
"/m43 {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 f} def@");
728 PrintStr(
"/m44 {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 s} def@");
732 PrintStr(
"/m45 {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 f} def@");
736 PrintStr(
"/m46 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d ");
737 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
738 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@");
739 PrintStr(
"/m47 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d");
740 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 w4 neg d w4 w4 d");
741 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@");
742 PrintStr(
"/m48 {mp x y w4 add m w4 neg w4 d w4 neg w4 neg d w4 w4 neg d ");
743 PrintStr(
" w4 neg w4 neg d w4 w4 neg d w4 w4 d w4 w4 neg d w4 w4 d");
744 PrintStr(
" w4 neg w4 d w4 w4 d w4 neg w4 d w4 neg w4 neg d ");
745 PrintStr(
" w4 w4 neg d w4 neg w4 neg d w4 neg w4 d w4 w4 d cl f} def@");
746 PrintStr(
"/m49 {mp x w2 sub w3 add y w2 sub w3 add m ");
747 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");
748 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@");
749 PrintStr(
"/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
750 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@");
766 if (fillis == 3 || fillis == 2) {
768 x[0] =
x1;
y[0] = y1;
769 x[1] =
x2;
y[1] = y1;
770 x[2] =
x2;
y[2] = y2;
771 x[3] =
x1;
y[3] = y2;
774 if (fillsi > 0 && fillsi < 26) {
775 x[0] =
x1;
y[0] = y1;
776 x[1] =
x2;
y[1] = y1;
777 x[2] =
x2;
y[2] = y2;
778 x[3] =
x1;
y[3] = y2;
821 static Int_t xps[7], yps[7];
822 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
827 Int_t bordPS = 4*border;
829 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
830 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
831 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
833 xps[5] = xps[0]; yps[5] = yps[4];
834 xps[6] = xps[0]; yps[6] = yps[0];
852 if( idx ) {
MovePS(idx,0); idx = 0; }
853 if( idy ) {
MovePS(0,idy); idy = 0; }
858 if( idy ) {
MovePS(0,idy); idy = 0; }
859 if( !idx ) { idx = ix;
continue;}
860 if( ix*idx > 0 ) idx += ix;
861 else {
MovePS(idx,0); idx = ix; }
865 if( idx ) {
MovePS(idx,0); idx = 0; }
866 if( !idy) { idy = iy;
continue;}
867 if( iy*idy > 0 ) idy += iy;
868 else {
MovePS(0,idy); idy = iy; }
879 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
880 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
881 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
883 xps[5] = xps[4]; yps[5] = yps[0];
884 xps[6] = xps[0]; yps[6] = yps[0];
902 if( idx ) {
MovePS(idx,0); idx = 0; }
903 if( idy ) {
MovePS(0,idy); idy = 0; }
908 if( idy ) {
MovePS(0,idy); idy = 0; }
909 if( !idx ) { idx = ix;
continue;}
910 if( ix*idx > 0 ) idx += ix;
911 else {
MovePS(idx,0); idx = ix; }
915 if( idx ) {
MovePS(idx,0); idx = 0; }
916 if( !idy) { idy = iy;
continue;}
917 if( iy*idy > 0 ) idy += iy;
918 else {
MovePS(0,idy); idy = iy; }
938 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
959 if(
n == 0)
goto END;
975 if( idx ) {
MovePS(idx,0); idx = 0; }
976 if( idy ) {
MovePS(0,idy); idy = 0; }
981 if( idy ) {
MovePS(0,idy); idy = 0; }
982 if( !idx ) { idx = ix;
continue;}
983 if( ix*idx > 0 ) idx += ix;
984 else {
MovePS(idx,0); idx = ix; }
988 if( idx ) {
MovePS(idx,0); idx = 0; }
989 if( !idy) { idy = iy;
continue;}
990 if( iy*idy > 0 ) idy += iy;
991 else {
MovePS(0,idy); idy = iy; }
1022 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
1043 if(
n == 0)
goto END;
1059 if( idx ) {
MovePS(idx,0); idx = 0; }
1060 if( idy ) {
MovePS(0,idy); idy = 0; }
1065 if( idy ) {
MovePS(0,idy); idy = 0; }
1066 if( !idx ) { idx = ix;
continue;}
1067 if( ix*idx > 0 ) idx += ix;
1068 else {
MovePS(idx,0); idx = ix; }
1072 if( idx ) {
MovePS(idx,0); idx = 0; }
1073 if( !idy) { idy = iy;
continue;}
1074 if( iy*idy > 0 ) idy += iy;
1075 else {
MovePS(0,idy); idy = iy; }
1099 Int_t i, np, markerstyle;
1101 static char chtemp[10];
1110 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1111 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1112 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1113 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1114 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1115 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1116 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1117 if (markerstyle >= 20 && markerstyle <= 49 )
snprintf(chtemp,10,
" m%d", markerstyle);
1118 if (markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1121 if (markerstyle == 1) {
1123 }
else if (markerstyle == 6) {
1125 }
else if (markerstyle == 7) {
1129 const Int_t kBASEMARKER = 8;
1130 Float_t sbase = symbolsize*kBASEMARKER;
1132 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1139 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1155 if (np == 100 || i ==
n-1) {
1172 Int_t i, np, markerstyle;
1174 static char chtemp[10];
1183 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1184 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1185 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1186 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1187 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1188 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1189 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1190 if (markerstyle >= 20 && markerstyle <= 49 )
snprintf(chtemp,10,
" m%d", markerstyle);
1191 if (markerstyle >= 50) strlcpy(chtemp,
" m20",10);
1194 if (markerstyle == 1) {
1196 }
else if (markerstyle == 6) {
1198 }
else if (markerstyle == 7) {
1202 const Int_t kBASEMARKER = 8;
1203 Float_t sbase = symbolsize*kBASEMARKER;
1205 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1212 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1228 if (np == 100 || i ==
n-1) {
1252 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1253 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1254 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1255 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1256 180, 90,135, 45,150, 30,120, 60,
1257 180, 90,135, 45,150, 30,120, 60};
1258 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1259 fais = fasi =
n = 0;
1279 if (fais == 3 || fais == 2) {
1280 if (fasi > 100 && fasi <125) {
1281 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1284 if (fasi > 0 && fasi < 26) {
1295 if(
n == 0)
goto END;
1303 ixdi =
XtoPS(xw[i]);
1304 iydi =
YtoPS(yw[i]);
1310 if( idx ) {
MovePS(idx,0); idx = 0; }
1311 if( idy ) {
MovePS(0,idy); idy = 0; }
1314 if( idy ) {
MovePS(0,idy); idy = 0;}
1315 if( !idx ) { idx = ix;}
1317 else {
MovePS(idx,0); idx = ix;}
1319 if( idx ) {
MovePS(idx,0); idx = 0;}
1320 if( !idy) { idy = iy;}
1322 else {
MovePS(0,idy); idy = iy;}
1329 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1332 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1333 if (fais == 3 || fais == 2) {
1334 if (fasi > 0 && fasi < 26) {
1363 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1364 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1365 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1366 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1367 180, 90,135, 45,150, 30,120, 60,
1368 180, 90,135, 45,150, 30,120, 60};
1369 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1370 fais = fasi =
n = 0;
1390 if (fais == 3 || fais == 2) {
1391 if (fasi > 100 && fasi <125) {
1392 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1395 if (fasi > 0 && fasi < 26) {
1406 if(
n == 0)
goto END;
1414 ixdi =
XtoPS(xw[i]);
1415 iydi =
YtoPS(yw[i]);
1421 if( idx ) {
MovePS(idx,0); idx = 0; }
1422 if( idy ) {
MovePS(0,idy); idy = 0; }
1425 if( idy ) {
MovePS(0,idy); idy = 0;}
1426 if( !idx ) { idx = ix;}
1428 else {
MovePS(idx,0); idx = ix;}
1430 if( idx ) {
MovePS(idx,0); idx = 0;}
1431 if( !idy) { idy = iy;}
1433 else {
MovePS(0,idy); idy = iy;}
1440 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1443 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1444 if (fais == 3 || fais == 2) {
1445 if (fasi > 0 && fasi < 26) {
1467 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1475 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1482 std::ifstream font_file(filename, std::ios::binary);
1486 font_file.seekg(0, std::ios::end);
1488 const size_t font_file_length = font_file.tellg();
1490 font_file.seekg(0, std::ios::beg);
1492 std::vector<unsigned char> font_data(font_file_length,
'\0');
1494 font_file.read(
reinterpret_cast<char *
>(&font_data[0]),
1497 std::string font_name;
1498 std::string postscript_string =
1499 mathtext::font_embed_postscript_t::font_embed_type_1(
1500 font_name, font_data);
1502 if (!postscript_string.empty()) {
1503 PrintRaw(postscript_string.size(), postscript_string.data());
1516 std::ifstream font_file(filename, std::ios::binary);
1520 font_file.seekg(0, std::ios::end);
1522 const size_t font_file_length = font_file.tellg();
1524 font_file.seekg(0, std::ios::beg);
1526 std::vector<unsigned char> font_data(font_file_length,
'\0');
1528 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1530 std::string font_name;
1531 std::string postscript_string =
1532 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1534 if (!postscript_string.empty()) {
1535 PrintRaw(postscript_string.size(), postscript_string.data());
1548 std::ifstream font_file(filename, std::ios::binary);
1552 font_file.seekg(0, std::ios::end);
1554 const size_t font_file_length = font_file.tellg();
1556 font_file.seekg(0, std::ios::beg);
1558 std::vector<unsigned char> font_data(font_file_length,
'\0');
1560 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1562 std::string font_name;
1563 std::string postscript_string =
1564 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1566 if (!postscript_string.empty()) {
1567 PrintRaw(postscript_string.size(), postscript_string.data());
1572 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1582 static const char *fonttable[32][2] = {
1583 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1584 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1585 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1586 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1587 {
"Root.TTFont.4",
"FreeSans.otf" },
1588 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1589 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1590 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1591 {
"Root.TTFont.8",
"FreeMono.otf" },
1592 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1593 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1594 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1595 {
"Root.TTFont.12",
"symbol.ttf" },
1596 {
"Root.TTFont.13",
"FreeSerif.otf" },
1597 {
"Root.TTFont.14",
"wingding.ttf" },
1598 {
"Root.TTFont.15",
"symbol.ttf" },
1599 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1600 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1601 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1602 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1603 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1604 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1605 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1606 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1607 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1608 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1609 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1610 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1611 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1612 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1613 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1614 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1617 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1623 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1624 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1626 fonttable[fontid][0], fonttable[fontid][1]);
1629 Error(
"TPostScript::FontEmbed",
1630 "font %d (filename `%s') not found in path",
1640 Error(
"TPostScript::FontEmbed",
1641 "failed to embed font %d (filename `%s')",
1648 PrintStr(
"%%IncludeResource: font Times-Roman@");
1649 PrintStr(
"%%IncludeResource: font Times-Italic@");
1650 PrintStr(
"%%IncludeResource: font Times-Bold@");
1651 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1652 PrintStr(
"%%IncludeResource: font Helvetica@");
1653 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1654 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1655 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1656 PrintStr(
"%%IncludeResource: font Courier@");
1657 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1658 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1659 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1660 PrintStr(
"%%IncludeResource: font Symbol@");
1661 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1673 PrintStr(
" dup length dict begin");
1680 PrintStr(
" dup /FontName get exch");
1683 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1684 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1685 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1686 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1687 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1688 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1689 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1690 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1691 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1692 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1693 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1734 rpxmin = rpymin =
width = heigth = 0;
1746 if( fMode <= 0 || fMode > 5) {
1747 Error(
"Initialize",
"invalid file type %d",
fMode);
1763 format = atype/1000;
1764 if( format == 0 ) format = 4;
1765 if( format == 99 ) format = 0;
1769 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1771 if(!pstitle[0] &&
fMode != 3) {;
1773 if ( format <= 99 ) {;
1779 if ( format == 100 )
PrintFast(8,
" Letter)");
1780 if ( format == 200 )
PrintFast(7,
" Legal)");
1781 if ( format == 300 )
PrintFast(8,
" Ledger)");
1787 if (!strchr(pstitle,
'\n')) {
1794 PrintFast(24,
"%%Creator: ROOT Version ");
1811 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1812 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1813 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1815 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1817 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1819 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1820 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1821 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1822 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 @");
1823 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1824 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1836 width = (8.5*2.54)-2.*rpxmin;
1837 heigth = (11.*2.54)-2.*rpymin;
1840 width = (8.5*2.54)-2.*rpxmin;
1841 heigth = (14.*2.54)-2.*rpymin;
1844 width = (11.*2.54)-2.*rpxmin;
1845 heigth = (17.*2.54)-2.*rpymin;
1848 width = 21.0-2.*rpxmin;
1849 heigth = 29.7-2.*rpymin;
1859 width = (11.*2.54)-2.*rpxmin;
1860 heigth = (8.5*2.54)-2.*rpymin;
1863 width = (14.*2.54)-2.*rpxmin;
1864 heigth = (8.5*2.54)-2.*rpymin;
1867 width = (17.*2.54)-2.*rpxmin;
1868 heigth = (11.*2.54)-2.*rpymin;
1871 width = 29.7-2.*rpxmin;
1872 heigth = 21-2.*rpymin;
1891 width = (8.5*2.54)-2.*rpxmin;
1892 heigth = (11.*2.54)-2.*rpymin;
1895 width = (8.5*2.54)-2.*rpxmin;
1896 heigth = (14.*2.54)-2.*rpymin;
1899 width = (11.*2.54)-2.*rpxmin;
1900 heigth = (17.*2.54)-2.*rpymin;
1903 width = (21.0-2*rpxmin);
1904 heigth = (29.7-2.*rpymin);
1914 width = (11.*2.54)-2.*rpxmin;
1915 heigth = (8.5*2.54)-2.*rpymin;
1918 width = (14.*2.54)-2.*rpxmin;
1919 heigth = (8.5*2.54)-2.*rpymin;
1922 width = (17.*2.54)-2.*rpxmin;
1923 heigth = (11.*2.54)-2.*rpymin;
1926 width = (29.7-2*rpxmin);
1927 heigth = (21-2.*rpymin);
1933 else if (format == 100) value = 8.5*2.54;
1934 else if (format == 200) value = 8.5*2.54;
1935 else if (format == 300) value = 11.*2.54;
1936 if (format >= 100) format = 4;
1948 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
2000 if (ix != 0 && iy != 0) {
2004 }
else if (ix != 0) {
2007 }
else if (iy != 0) {
2029 Double_t xlow=0, ylow=0, xup=1, yup=1;
2031 xlow =
gPad->GetAbsXlowNDC();
2032 xup = xlow +
gPad->GetAbsWNDC();
2033 ylow =
gPad->GetAbsYlowNDC();
2034 yup = ylow +
gPad->GetAbsHNDC();
2058 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2063 else { xps = xsize; yps = ysize; }
2065 if( xsize <= xps && ysize < yps) {
2066 if ( xps > yps ) xymax = xps;
2070 dxwn = ((xps/xymax)-xncm)/2;
2071 dywn = ((yps/xymax)-yncm)/2;
2073 if (xps/yps < 1) xwkwn = xps/yps;
2075 if (yps/xps < 1) ywkwn = yps/xps;
2078 if (xsize < ysize) {
2079 xncm = ywkwn*xsize/ysize;
2081 dxwn = (xwkwn-xncm)/2;
2086 yncm = xwkwn*ysize/xsize;
2087 dywn = (ywkwn-yncm)/2;
2091 yncm = xwkwn*ysize/xsize;
2093 dywn = (ywkwn-yncm)/2;
2097 xncm = ywkwn*xsize/ysize;
2098 dxwn = (xwkwn-xncm)/2;
2163 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2168 PrintStr(
" /PaintProc { begin gsave");
2169 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2170 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2171 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2176 PrintStr(
" /PaintProc { begin gsave");
2177 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2178 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2179 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2184 PrintStr(
" /PaintProc { begin gsave");
2185 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2186 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2187 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2190 PrintStr(
" /BBox [ 0 0 100 100 ]");
2191 PrintStr(
" /XStep 100 /YStep 100");
2192 PrintStr(
" /PaintProc { begin gsave");
2194 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2197 PrintStr(
" /BBox [ 0 0 100 100 ]");
2198 PrintStr(
" /XStep 100 /YStep 100");
2199 PrintStr(
" /PaintProc { begin gsave");
2201 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2204 PrintStr(
" /BBox [ 0 0 100 100 ]");
2205 PrintStr(
" /XStep 100 /YStep 100");
2206 PrintStr(
" /PaintProc { begin gsave");
2208 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2211 PrintStr(
" /BBox [ 0 0 100 100 ]");
2212 PrintStr(
" /XStep 100 /YStep 100");
2213 PrintStr(
" /PaintProc { begin gsave");
2215 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2218 PrintStr(
" /BBox [ 0 0 101 101 ]");
2219 PrintStr(
" /XStep 100 /YStep 100");
2220 PrintStr(
" /PaintProc { begin gsave");
2221 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2222 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2223 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2224 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2225 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2226 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2229 PrintStr(
" /BBox [ 0 0 100 100 ]");
2230 PrintStr(
" /XStep 100 /YStep 100");
2231 PrintStr(
" /PaintProc { begin gsave");
2232 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2233 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2234 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2235 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2238 PrintStr(
" /BBox [ 0 0 100 100 ]");
2239 PrintStr(
" /XStep 100 /YStep 100");
2240 PrintStr(
" /PaintProc { begin gsave");
2241 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2242 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2244 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2247 PrintStr(
" /BBox [ 0 0 100 100 ]");
2248 PrintStr(
" /XStep 100 /YStep 100");
2249 PrintStr(
" /PaintProc { begin gsave");
2250 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2251 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2252 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2253 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2254 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2255 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2256 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2257 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2258 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2259 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2260 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2263 PrintStr(
" /BBox [ 0 0 100 100 ]");
2264 PrintStr(
" /XStep 100 /YStep 100");
2265 PrintStr(
" /PaintProc { begin gsave");
2266 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2267 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2268 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2269 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2270 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2271 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2272 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2273 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2274 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2277 PrintStr(
" /BBox [ 0 0 100 100 ]");
2278 PrintStr(
" /XStep 100 /YStep 100");
2279 PrintStr(
" /PaintProc { begin gsave");
2280 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2281 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2284 PrintStr(
" /BBox [ 0 0 100 100 ]");
2286 PrintStr(
" /PaintProc { begin gsave");
2287 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2288 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2289 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2290 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2291 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2296 PrintStr(
" /PaintProc { begin gsave");
2297 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2298 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2299 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2300 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2301 PrintStr(
" 50 30 m 45 30 5 0 360");
2302 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2303 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2304 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2305 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2308 PrintStr(
" /BBox [ 0 0 100 100 ]");
2309 PrintStr(
" /XStep 100 /YStep 100");
2310 PrintStr(
" /PaintProc { begin gsave");
2311 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2312 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2313 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2316 PrintStr(
" /BBox [ 0 0 100 100 ]");
2317 PrintStr(
" /XStep 100 /YStep 100");
2318 PrintStr(
" /PaintProc { begin gsave");
2319 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2320 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2323 PrintStr(
" /BBox [ 0 0 100 100 ]");
2324 PrintStr(
" /XStep 100 /YStep 100");
2325 PrintStr(
" /PaintProc { begin gsave");
2326 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2327 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2330 PrintStr(
" /BBox [ 0 0 100 100 ]");
2331 PrintStr(
" /XStep 100 /YStep 100");
2332 PrintStr(
" /PaintProc { begin gsave");
2333 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2334 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2335 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2336 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2337 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2338 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2341 PrintStr(
" /BBox [ 0 0 100 100 ]");
2342 PrintStr(
" /XStep 100 /YStep 100");
2343 PrintStr(
" /PaintProc { begin gsave");
2344 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2345 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2346 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2349 PrintStr(
" /BBox [ 0 0 101 101 ]");
2350 PrintStr(
" /XStep 100 /YStep 100");
2351 PrintStr(
" /PaintProc { begin gsave");
2352 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2353 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2354 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2355 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2356 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2359 PrintStr(
" /BBox [ 0 0 101 101 ]");
2360 PrintStr(
" /XStep 100 /YStep 100");
2361 PrintStr(
" /PaintProc { begin gsave");
2362 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2363 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2364 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2365 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2366 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2369 PrintStr(
" /BBox [ 0 0 100 100 ]");
2370 PrintStr(
" /XStep 100 /YStep 100");
2371 PrintStr(
" /PaintProc { begin gsave");
2372 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2373 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2374 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2375 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2378 PrintStr(
" /BBox [ 0 0 100 100 ]");
2379 PrintStr(
" /XStep 100 /YStep 100");
2380 PrintStr(
" /PaintProc { begin gsave");
2381 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2382 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2383 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2384 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2385 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2386 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2387 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2388 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2389 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2390 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2391 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2392 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2393 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2396 PrintStr(
" /BBox [ 0 0 101 101 ]");
2397 PrintStr(
" /XStep 100 /YStep 100");
2398 PrintStr(
" /PaintProc { begin gsave");
2399 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2400 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2401 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2403 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2411 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2412 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2414 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2415 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2435 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2436 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2437 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2502 Int_t nch = strlen(st);
2534 if (color < 0) color = 0;
2593 static const char *psfont[31][2] = {
2594 {
"Root.PSFont.1",
"/Times-Italic" },
2595 {
"Root.PSFont.2",
"/Times-Bold" },
2596 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2597 {
"Root.PSFont.4",
"/Helvetica" },
2598 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2599 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2600 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2601 {
"Root.PSFont.8",
"/Courier" },
2602 {
"Root.PSFont.9",
"/Courier-Oblique" },
2603 {
"Root.PSFont.10",
"/Courier-Bold" },
2604 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2605 {
"Root.PSFont.12",
"/Symbol" },
2606 {
"Root.PSFont.13",
"/Times-Roman" },
2607 {
"Root.PSFont.14",
"/ZapfDingbats" },
2608 {
"Root.PSFont.15",
"/Symbol" },
2609 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2610 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2611 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2612 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2613 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2614 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2615 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2616 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2617 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2618 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2619 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2620 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2621 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2622 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2623 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2624 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2642 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2646 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2648 Double_t fontsize = 4*(72*(ftsize)/2.54);
2649 if( fontsize <= 0)
return;
2655 if( font > 31 || font < 1) font = 1;
2662 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2664 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2668 }
else if (txalv == 2) {
2682 saveAttText.TAttText::operator=(*this);
2683 const Int_t len=strlen(chars);
2684 Int_t *charWidthsCumul = 0;
2690 t.TAttText::Modify();
2695 charWidthsCumul =
new Int_t[len];
2696 for (
Int_t i = len - 1;i >= 0;i--) {
2704 saveAttText.TAttText::Modify();
2736 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2737 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2748 for (
Int_t i = len-1; i >= 1; i--) {
2751 delete [] charWidthsCumul;
2763 for (
Int_t i=0; i<len;i++) {
2764 if (chars[i]!=
'\n') {
2765 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2768 }
else if ((chars[i]==
'-') && (font != 12)) {
2783 if (font != 15)
PrintStr(
" show NC");
2798 static const char *psfont[31][2] = {
2799 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2800 {
"Root.PSFont.2",
"/FreeSerifBold" },
2801 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2802 {
"Root.PSFont.4",
"/FreeSans" },
2803 {
"Root.PSFont.5",
"/FreeSansOblique" },
2804 {
"Root.PSFont.6",
"/FreeSansBold" },
2805 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2806 {
"Root.PSFont.8",
"/FreeMono" },
2807 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2808 {
"Root.PSFont.10",
"/FreeMonoBold" },
2809 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2810 {
"Root.PSFont.12",
"/SymbolMT" },
2811 {
"Root.PSFont.13",
"/FreeSerif" },
2812 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2813 {
"Root.PSFont.15",
"/SymbolMT" },
2814 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2815 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2816 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2817 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2818 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2819 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2820 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2821 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2822 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2823 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2824 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2825 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2826 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2827 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2828 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2829 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2832 Int_t len = wcslen(chars);
2850 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2854 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2856 Double_t fontsize = 4*(72*(ftsize)/2.54);
2857 if( fontsize <= 0)
return;
2863 if( font > 29 || font < 1) font = 1;
2870 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2872 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2876 }
else if (txalv == 2) {
2911 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2912 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2919 for(
Int_t i = 0; i < len; i++) {
2923 const wchar_t *lower = std::lower_bound(
2927 *lower == chars[i]) {
2929 const unsigned long index =
2933 else if((
unsigned int)chars[i] < 0xffff) {
2936 (
unsigned int)chars[i]));
2941 (
unsigned int)chars[i]));
2982 return Int_t(0.5 + 288*
cm/2.54);
2991 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)