225 #pragma optimize("",off)
246 #include "../../../graf2d/mathtext/inc/fontembed.h"
288 fNBSameColorCell = 0;
322 for (i=0; i<32; i++) fPatterns[i] = 0;
353 Warning(
"Open",
"postscript file already open");
377 ww *=
gPad->GetWNDC();
378 wh *=
gPad->GetHNDC();
383 yrange = xrange*ratio;
384 if (yrange >
fXsize) { yrange =
fXsize; xrange = yrange/ratio;}
388 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
405 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
467 Error(
"Text",
"Cannot open temporary file: %s\n", tmpname.
Data());
479 FILE *sg = fopen(tmpname.
Data(),
"r");
481 Error(
"Text",
"Cannot open file: %s\n", tmpname.
Data());
485 while (fgets(line,255,sg)) {
486 if (strstr(line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
487 fStream->write(line,strlen(line));
512 Error(
"On",
"no postscript file open");
582 PrintStr(
" NBBD NBB eq {exit} if");
588 PrintStr(
" /IX IX 1 add def} def");
598 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
609 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
613 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
614 PrintStr(
" /YY YY HT sub def clear} def");
673 PrintStr(
"/mp {newpath /y exch def /x exch def} def@");
674 PrintStr(
"/side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def@");
675 PrintStr(
"/mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def@");
676 PrintStr(
"/mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def@");
677 PrintStr(
"/mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def@");
678 PrintStr(
"/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
679 PrintStr(
"/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
680 PrintStr(
"/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
681 PrintStr(
"/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
682 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
683 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
684 PrintStr(
" 0 w3 neg d w3 neg 0 d cl s } def@");
685 PrintStr(
"/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
686 PrintStr(
" 4 {side} repeat cl fill gr} def@");
687 PrintStr(
"/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
688 PrintStr(
" 4 {side} repeat cl s gr} def@");
689 PrintStr(
"/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
690 PrintStr(
" x w2 sub y w2 add m w w neg d x w2 sub y w2");
692 PrintStr(
"/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
693 PrintStr(
"/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
694 PrintStr(
"/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
695 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
696 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
697 PrintStr(
" 0 w3 neg d w3 neg 0 d cl f } def@");
698 PrintStr(
"/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
699 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@");
715 if (fillis == 3 || fillis == 2) {
717 x[0] =
x1; y[0] = y1;
718 x[1] =
x2; y[1] = y1;
719 x[2] =
x2; y[2] = y2;
720 x[3] =
x1; y[3] = y2;
723 if (fillsi > 0 && fillsi < 26) {
724 x[0] =
x1; y[0] = y1;
725 x[1] =
x2; y[1] = y1;
726 x[2] =
x2; y[2] = y2;
727 x[3] =
x1; y[3] = y2;
770 static Int_t xps[7], yps[7];
771 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
776 Int_t bordPS = 4*border;
778 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
779 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
780 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
782 xps[5] = xps[0]; yps[5] = yps[4];
783 xps[6] = xps[0]; yps[6] = yps[0];
801 if( idx ) {
MovePS(idx,0); idx = 0; }
802 if( idy ) {
MovePS(0,idy); idy = 0; }
807 if( idy ) {
MovePS(0,idy); idy = 0; }
808 if( !idx ) { idx = ix;
continue;}
809 if( ix*idx > 0 ) idx += ix;
810 else {
MovePS(idx,0); idx = ix; }
814 if( idx ) {
MovePS(idx,0); idx = 0; }
815 if( !idy) { idy = iy;
continue;}
816 if( iy*idy > 0 ) idy += iy;
817 else {
MovePS(0,idy); idy = iy; }
828 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
829 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
830 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
832 xps[5] = xps[4]; yps[5] = yps[0];
833 xps[6] = xps[0]; yps[6] = yps[0];
851 if( idx ) {
MovePS(idx,0); idx = 0; }
852 if( idy ) {
MovePS(0,idy); idy = 0; }
857 if( idy ) {
MovePS(0,idy); idy = 0; }
858 if( !idx ) { idx = ix;
continue;}
859 if( ix*idx > 0 ) idx += ix;
860 else {
MovePS(idx,0); idx = ix; }
864 if( idx ) {
MovePS(idx,0); idx = 0; }
865 if( !idy) { idy = iy;
continue;}
866 if( iy*idy > 0 ) idy += iy;
867 else {
MovePS(0,idy); idy = iy; }
887 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
903 ixd0 =
XtoPS(xy[0].GetX());
904 iyd0 =
YtoPS(xy[0].GetY());
908 if( n == 0)
goto END;
917 ixdi =
XtoPS(xy[i].GetX());
918 iydi =
YtoPS(xy[i].GetY());
924 if( idx ) {
MovePS(idx,0); idx = 0; }
925 if( idy ) {
MovePS(0,idy); idy = 0; }
930 if( idy ) {
MovePS(0,idy); idy = 0; }
931 if( !idx ) { idx = ix;
continue;}
932 if( ix*idx > 0 ) idx += ix;
933 else {
MovePS(idx,0); idx = ix; }
937 if( idx ) {
MovePS(idx,0); idx = 0; }
938 if( !idy) { idy = iy;
continue;}
939 if( iy*idy > 0 ) idy += iy;
940 else {
MovePS(0,idy); idy = iy; }
947 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY())
PrintFast(3,
" cl");
971 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
987 ixd0 =
UtoPS(xy[0].GetX());
988 iyd0 =
VtoPS(xy[0].GetY());
992 if( n == 0)
goto END;
1001 ixdi =
UtoPS(xy[i].GetX());
1002 iydi =
VtoPS(xy[i].GetY());
1008 if( idx ) {
MovePS(idx,0); idx = 0; }
1009 if( idy ) {
MovePS(0,idy); idy = 0; }
1014 if( idy ) {
MovePS(0,idy); idy = 0; }
1015 if( !idx ) { idx = ix;
continue;}
1016 if( ix*idx > 0 ) idx += ix;
1017 else {
MovePS(idx,0); idx = ix; }
1021 if( idx ) {
MovePS(idx,0); idx = 0; }
1022 if( !idy) { idy = iy;
continue;}
1023 if( iy*idy > 0 ) idy += iy;
1024 else {
MovePS(0,idy); idy = iy; }
1031 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY())
PrintFast(3,
" cl");
1048 Int_t i, np, markerstyle;
1050 static char chtemp[10];
1059 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1060 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1061 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1062 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1063 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1064 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1065 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1066 if (markerstyle >= 20 && markerstyle <= 34 ) snprintf(chtemp,10,
" m%d", markerstyle);
1067 if (markerstyle >= 35) strlcpy(chtemp,
" m20",10);
1070 if (markerstyle == 1) {
1072 }
else if (markerstyle == 6) {
1074 }
else if (markerstyle == 7) {
1078 const Int_t kBASEMARKER = 8;
1079 Float_t sbase = symbolsize*kBASEMARKER;
1081 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1088 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1104 if (np == 100 || i == n-1) {
1121 Int_t i, np, markerstyle;
1123 static char chtemp[10];
1132 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1133 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1134 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1135 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1136 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1137 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1138 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1139 if (markerstyle >= 20 && markerstyle <= 34 ) snprintf(chtemp,10,
" m%d", markerstyle);
1140 if (markerstyle >= 35) strlcpy(chtemp,
" m20",10);
1143 if (markerstyle == 1) {
1145 }
else if (markerstyle == 6) {
1147 }
else if (markerstyle == 7) {
1151 const Int_t kBASEMARKER = 8;
1152 Float_t sbase = symbolsize*kBASEMARKER;
1154 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1161 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1177 if (np == 100 || i == n-1) {
1201 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1202 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1203 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1204 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1205 180, 90,135, 45,150, 30,120, 60,
1206 180, 90,135, 45,150, 30,120, 60};
1207 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1208 fais = fasi = n = 0;
1228 if (fais == 3 || fais == 2) {
1229 if (fasi > 100 && fasi <125) {
1230 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1233 if (fasi > 0 && fasi < 26) {
1244 if( n == 0)
goto END;
1252 ixdi =
XtoPS(xw[i]);
1253 iydi =
YtoPS(yw[i]);
1259 if( idx ) {
MovePS(idx,0); idx = 0; }
1260 if( idy ) {
MovePS(0,idy); idy = 0; }
1263 if( idy ) {
MovePS(0,idy); idy = 0;}
1264 if( !idx ) { idx = ix;}
1266 else {
MovePS(idx,0); idx = ix;}
1268 if( idx ) {
MovePS(idx,0); idx = 0;}
1269 if( !idy) { idy = iy;}
1271 else {
MovePS(0,idy); idy = iy;}
1278 if (xw[0] == xw[n-1] && yw[0] == yw[n-1])
PrintFast(3,
" cl");
1281 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1282 if (fais == 3 || fais == 2) {
1283 if (fasi > 0 && fasi < 26) {
1312 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1313 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1314 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1315 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1316 180, 90,135, 45,150, 30,120, 60,
1317 180, 90,135, 45,150, 30,120, 60};
1318 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1319 fais = fasi = n = 0;
1339 if (fais == 3 || fais == 2) {
1340 if (fasi > 100 && fasi <125) {
1341 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1344 if (fasi > 0 && fasi < 26) {
1355 if( n == 0)
goto END;
1363 ixdi =
XtoPS(xw[i]);
1364 iydi =
YtoPS(yw[i]);
1370 if( idx ) {
MovePS(idx,0); idx = 0; }
1371 if( idy ) {
MovePS(0,idy); idy = 0; }
1374 if( idy ) {
MovePS(0,idy); idy = 0;}
1375 if( !idx ) { idx = ix;}
1377 else {
MovePS(idx,0); idx = ix;}
1379 if( idx ) {
MovePS(idx,0); idx = 0;}
1380 if( !idy) { idy = iy;}
1382 else {
MovePS(0,idy); idy = iy;}
1389 if (xw[0] == xw[n-1] && yw[0] == yw[n-1])
PrintFast(3,
" cl");
1392 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1393 if (fais == 3 || fais == 2) {
1394 if (fasi > 0 && fasi < 26) {
1416 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1424 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1431 std::ifstream font_file(filename, std::ios::binary);
1435 font_file.seekg(0, std::ios::end);
1437 const size_t font_file_length = font_file.tellg();
1439 font_file.seekg(0, std::ios::beg);
1441 std::vector<unsigned char> font_data(font_file_length,
'\0');
1443 font_file.read(reinterpret_cast<char *>(&font_data[0]),
1446 std::string font_name;
1447 std::string postscript_string =
1448 mathtext::font_embed_postscript_t::font_embed_type_1(
1449 font_name, font_data);
1451 if (!postscript_string.empty()) {
1452 PrintRaw(postscript_string.size(), postscript_string.data());
1465 std::ifstream font_file(filename, std::ios::binary);
1469 font_file.seekg(0, std::ios::end);
1471 const size_t font_file_length = font_file.tellg();
1473 font_file.seekg(0, std::ios::beg);
1475 std::vector<unsigned char> font_data(font_file_length,
'\0');
1477 font_file.read(reinterpret_cast<char *>(&font_data[0]), font_file_length);
1479 std::string font_name;
1480 std::string postscript_string =
1481 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1483 if (!postscript_string.empty()) {
1484 PrintRaw(postscript_string.size(), postscript_string.data());
1497 std::ifstream font_file(filename, std::ios::binary);
1501 font_file.seekg(0, std::ios::end);
1503 const size_t font_file_length = font_file.tellg();
1505 font_file.seekg(0, std::ios::beg);
1507 std::vector<unsigned char> font_data(font_file_length,
'\0');
1509 font_file.read(reinterpret_cast<char *>(&font_data[0]), font_file_length);
1511 std::string font_name;
1512 std::string postscript_string =
1513 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1515 if (!postscript_string.empty()) {
1516 PrintRaw(postscript_string.size(), postscript_string.data());
1521 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1531 static const char *fonttable[32][2] = {
1532 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1533 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1534 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1535 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1536 {
"Root.TTFont.4",
"FreeSans.otf" },
1537 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1538 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1539 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1540 {
"Root.TTFont.8",
"FreeMono.otf" },
1541 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1542 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1543 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1544 {
"Root.TTFont.12",
"symbol.ttf" },
1545 {
"Root.TTFont.13",
"FreeSerif.otf" },
1546 {
"Root.TTFont.14",
"wingding.ttf" },
1547 {
"Root.TTFont.15",
"symbol.ttf" },
1548 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1549 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1550 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1551 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1552 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1553 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1554 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1555 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1556 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1557 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1558 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1559 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1560 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1561 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1562 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1563 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1566 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1577 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1578 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1580 fonttable[fontid][0], fonttable[fontid][1]);
1583 Error(
"TPostScript::FontEmbed",
1584 "font %d (filename `%s') not found in path",
1594 Error(
"TPostScript::FontEmbed",
1595 "failed to embed font %d (filename `%s')",
1602 PrintStr(
"%%IncludeResource: font Times-Roman@");
1603 PrintStr(
"%%IncludeResource: font Times-Italic@");
1604 PrintStr(
"%%IncludeResource: font Times-Bold@");
1605 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1606 PrintStr(
"%%IncludeResource: font Helvetica@");
1607 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1608 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1609 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1610 PrintStr(
"%%IncludeResource: font Courier@");
1611 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1612 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1613 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1614 PrintStr(
"%%IncludeResource: font Symbol@");
1615 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1627 PrintStr(
" dup length dict begin");
1634 PrintStr(
" dup /FontName get exch");
1637 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1638 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1639 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1640 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1641 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1642 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1643 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1644 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1645 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1646 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1647 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1687 Double_t rpxmin, rpymin, width, heigth;
1688 rpxmin = rpymin = width = heigth = 0;
1700 if( fMode <= 0 || fMode > 5) {
1701 Error(
"Initialize",
"invalid file type %d",
fMode);
1717 format = atype/1000;
1718 if( format == 0 ) format = 4;
1719 if( format == 99 ) format = 0;
1723 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1725 if(!pstitle[0] &&
fMode != 3) {;
1727 if ( format <= 99 ) {;
1733 if ( format == 100 )
PrintFast(8,
" Letter)");
1734 if ( format == 200 )
PrintFast(7,
" Legal)");
1735 if ( format == 300 )
PrintFast(8,
" Ledger)");
1741 if (!strchr(pstitle,
'\n')) {
1748 PrintFast(24,
"%%Creator: ROOT Version ");
1765 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1766 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1767 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1769 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1771 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1773 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1774 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1775 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1776 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 @");
1777 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1778 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1790 width = (8.5*2.54)-2.*rpxmin;
1791 heigth = (11.*2.54)-2.*rpymin;
1794 width = (8.5*2.54)-2.*rpxmin;
1795 heigth = (14.*2.54)-2.*rpymin;
1798 width = (11.*2.54)-2.*rpxmin;
1799 heigth = (17.*2.54)-2.*rpymin;
1802 width = 21.0-2.*rpxmin;
1803 heigth = 29.7-2.*rpymin;
1813 width = (11.*2.54)-2.*rpxmin;
1814 heigth = (8.5*2.54)-2.*rpymin;
1816 width = (14.*2.54)-2.*rpxmin;
1817 heigth = (8.5*2.54)-2.*rpymin;
1819 width = (17.*2.54)-2.*rpxmin;
1820 heigth = (11.*2.54)-2.*rpymin;
1822 width = 29.7-2.*rpxmin;
1823 heigth = 21-2.*rpymin;
1842 width = (8.5*2.54)-2.*rpxmin;
1843 heigth = (11.*2.54)-2.*rpymin;
1845 width = (8.5*2.54)-2.*rpxmin;
1846 heigth = (14.*2.54)-2.*rpymin;
1848 width = (11.*2.54)-2.*rpxmin;
1849 heigth = (17.*2.54)-2.*rpymin;
1851 width = (21.0-2*rpxmin);
1852 heigth = (29.7-2.*rpymin);
1862 width = (11.*2.54)-2.*rpxmin;
1863 heigth = (8.5*2.54)-2.*rpymin;
1865 width = (14.*2.54)-2.*rpxmin;
1866 heigth = (8.5*2.54)-2.*rpymin;
1868 width = (17.*2.54)-2.*rpxmin;
1869 heigth = (11.*2.54)-2.*rpymin;
1871 width = (29.7-2*rpxmin);
1872 heigth = (21-2.*rpymin);
1878 else if (format == 100) value = 8.5*2.54;
1879 else if (format == 200) value = 8.5*2.54;
1880 else if (format == 300) value = 11.*2.54;
1881 if (format >= 100) format = 4;
1893 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
1945 if (ix != 0 && iy != 0) {
1949 }
else if (ix != 0) {
1952 }
else if (iy != 0) {
1974 Double_t xlow=0, ylow=0, xup=1, yup=1;
1976 xlow =
gPad->GetAbsXlowNDC();
1977 xup = xlow +
gPad->GetAbsWNDC();
1978 ylow =
gPad->GetAbsYlowNDC();
1979 yup = ylow +
gPad->GetAbsHNDC();
2003 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2008 else { xps = xsize; yps = ysize; }
2010 if( xsize <= xps && ysize < yps) {
2011 if ( xps > yps ) xymax = xps;
2015 dxwn = ((xps/xymax)-xncm)/2;
2016 dywn = ((yps/xymax)-yncm)/2;
2018 if (xps/yps < 1) xwkwn = xps/yps;
2020 if (yps/xps < 1) ywkwn = yps/xps;
2023 if (xsize < ysize) {
2024 xncm = ywkwn*xsize/ysize;
2026 dxwn = (xwkwn-xncm)/2;
2031 yncm = xwkwn*ysize/xsize;
2032 dywn = (ywkwn-yncm)/2;
2036 yncm = xwkwn*ysize/xsize;
2038 dywn = (ywkwn-yncm)/2;
2042 xncm = ywkwn*xsize/ysize;
2043 dxwn = (xwkwn-xncm)/2;
2094 snprintf(cpat,5,
" P%2.2d", ipat);
2108 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2113 PrintStr(
" /PaintProc { begin gsave");
2114 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2115 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2116 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2121 PrintStr(
" /PaintProc { begin gsave");
2122 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2123 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2124 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2129 PrintStr(
" /PaintProc { begin gsave");
2130 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2131 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2132 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2135 PrintStr(
" /BBox [ 0 0 100 100 ]");
2136 PrintStr(
" /XStep 100 /YStep 100");
2137 PrintStr(
" /PaintProc { begin gsave");
2139 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2142 PrintStr(
" /BBox [ 0 0 100 100 ]");
2143 PrintStr(
" /XStep 100 /YStep 100");
2144 PrintStr(
" /PaintProc { begin gsave");
2146 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2149 PrintStr(
" /BBox [ 0 0 100 100 ]");
2150 PrintStr(
" /XStep 100 /YStep 100");
2151 PrintStr(
" /PaintProc { begin gsave");
2153 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2156 PrintStr(
" /BBox [ 0 0 100 100 ]");
2157 PrintStr(
" /XStep 100 /YStep 100");
2158 PrintStr(
" /PaintProc { begin gsave");
2160 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2163 PrintStr(
" /BBox [ 0 0 101 101 ]");
2164 PrintStr(
" /XStep 100 /YStep 100");
2165 PrintStr(
" /PaintProc { begin gsave");
2166 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2167 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2168 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2169 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2170 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2171 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2174 PrintStr(
" /BBox [ 0 0 100 100 ]");
2175 PrintStr(
" /XStep 100 /YStep 100");
2176 PrintStr(
" /PaintProc { begin gsave");
2177 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2178 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2179 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2180 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2183 PrintStr(
" /BBox [ 0 0 100 100 ]");
2184 PrintStr(
" /XStep 100 /YStep 100");
2185 PrintStr(
" /PaintProc { begin gsave");
2186 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2187 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2189 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2192 PrintStr(
" /BBox [ 0 0 100 100 ]");
2193 PrintStr(
" /XStep 100 /YStep 100");
2194 PrintStr(
" /PaintProc { begin gsave");
2195 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2196 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2197 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2198 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2199 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2200 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2201 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2202 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2203 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2204 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2205 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2208 PrintStr(
" /BBox [ 0 0 100 100 ]");
2209 PrintStr(
" /XStep 100 /YStep 100");
2210 PrintStr(
" /PaintProc { begin gsave");
2211 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2212 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2213 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2214 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2215 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2216 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2217 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2218 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2219 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2222 PrintStr(
" /BBox [ 0 0 100 100 ]");
2223 PrintStr(
" /XStep 100 /YStep 100");
2224 PrintStr(
" /PaintProc { begin gsave");
2225 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2226 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2229 PrintStr(
" /BBox [ 0 0 100 100 ]");
2231 PrintStr(
" /PaintProc { begin gsave");
2232 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2233 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2234 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2235 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2236 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2241 PrintStr(
" /PaintProc { begin gsave");
2242 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2243 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2244 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2245 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2246 PrintStr(
" 50 30 m 45 30 5 0 360");
2247 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2248 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2249 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2250 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2253 PrintStr(
" /BBox [ 0 0 100 100 ]");
2254 PrintStr(
" /XStep 100 /YStep 100");
2255 PrintStr(
" /PaintProc { begin gsave");
2256 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2257 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2258 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2261 PrintStr(
" /BBox [ 0 0 100 100 ]");
2262 PrintStr(
" /XStep 100 /YStep 100");
2263 PrintStr(
" /PaintProc { begin gsave");
2264 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2265 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2268 PrintStr(
" /BBox [ 0 0 100 100 ]");
2269 PrintStr(
" /XStep 100 /YStep 100");
2270 PrintStr(
" /PaintProc { begin gsave");
2271 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2272 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2275 PrintStr(
" /BBox [ 0 0 100 100 ]");
2276 PrintStr(
" /XStep 100 /YStep 100");
2277 PrintStr(
" /PaintProc { begin gsave");
2278 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2279 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2280 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2281 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2282 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2283 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2286 PrintStr(
" /BBox [ 0 0 100 100 ]");
2287 PrintStr(
" /XStep 100 /YStep 100");
2288 PrintStr(
" /PaintProc { begin gsave");
2289 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2290 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2291 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2294 PrintStr(
" /BBox [ 0 0 101 101 ]");
2295 PrintStr(
" /XStep 100 /YStep 100");
2296 PrintStr(
" /PaintProc { begin gsave");
2297 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2298 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2299 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2300 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2301 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2304 PrintStr(
" /BBox [ 0 0 101 101 ]");
2305 PrintStr(
" /XStep 100 /YStep 100");
2306 PrintStr(
" /PaintProc { begin gsave");
2307 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2308 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2309 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2310 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2311 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2314 PrintStr(
" /BBox [ 0 0 100 100 ]");
2315 PrintStr(
" /XStep 100 /YStep 100");
2316 PrintStr(
" /PaintProc { begin gsave");
2317 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2318 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2319 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
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(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2327 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2328 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2329 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2330 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2331 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2332 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2333 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2334 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2335 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2336 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2337 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2338 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2341 PrintStr(
" /BBox [ 0 0 101 101 ]");
2342 PrintStr(
" /XStep 100 /YStep 100");
2343 PrintStr(
" /PaintProc { begin gsave");
2344 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2345 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2346 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2348 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2356 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2357 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2359 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2360 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2380 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2381 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2382 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2445 Int_t nch = strlen(st);
2477 if (color < 0) color = 0;
2536 static const char *psfont[31][2] = {
2537 {
"Root.PSFont.1",
"/Times-Italic" },
2538 {
"Root.PSFont.2",
"/Times-Bold" },
2539 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2540 {
"Root.PSFont.4",
"/Helvetica" },
2541 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2542 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2543 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2544 {
"Root.PSFont.8",
"/Courrier" },
2545 {
"Root.PSFont.9",
"/Courrier-Oblique" },
2546 {
"Root.PSFont.10",
"/Courrier-Bold" },
2547 {
"Root.PSFont.11",
"/Courrier-BoldOblique" },
2548 {
"Root.PSFont.12",
"/Symbol" },
2549 {
"Root.PSFont.13",
"/Times-Roman" },
2550 {
"Root.PSFont.14",
"/ZapfDingbats" },
2551 {
"Root.PSFont.15",
"/Symbol" },
2552 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2553 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2554 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2555 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2556 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2557 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2558 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2559 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2560 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2561 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2562 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2563 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2564 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2565 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2566 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2567 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2585 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2589 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2591 Double_t fontsize = 4*(72*(ftsize)/2.54);
2592 if( fontsize <= 0)
return;
2598 if( font > 31 || font < 1) font = 1;
2605 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2607 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2610 x += 0.8*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2611 }
else if (txalv == 2) {
2613 x += 0.4*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2625 saveAttText.TAttText::operator=(*this);
2626 const Int_t len=strlen(chars);
2627 Int_t *charWidthsCumul = 0;
2633 t.TAttText::Modify();
2634 if (w0-w != 0) kerning =
kTRUE;
2638 charWidthsCumul =
new Int_t[len];
2639 for (
Int_t i = len - 1;i >= 0;i--) {
2647 saveAttText.TAttText::Modify();
2679 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2680 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2691 for (
Int_t i = len-1; i >= 1; i--) {
2694 delete [] charWidthsCumul;
2706 for (
Int_t i=0; i<len;i++) {
2707 if (chars[i]!=
'\n') {
2708 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2709 snprintf(str,8,
"\\%c",chars[i]);
2711 }
else if ((chars[i]==
'-') && (font != 12)) {
2714 snprintf(str,8,
"%c",chars[i]);
2726 if (font != 15)
PrintStr(
" show NC");
2741 static const char *psfont[31][2] = {
2742 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2743 {
"Root.PSFont.2",
"/FreeSerifBold" },
2744 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2745 {
"Root.PSFont.4",
"/FreeSans" },
2746 {
"Root.PSFont.5",
"/FreeSansOblique" },
2747 {
"Root.PSFont.6",
"/FreeSansBold" },
2748 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2749 {
"Root.PSFont.8",
"/FreeMono" },
2750 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2751 {
"Root.PSFont.10",
"/FreeMonoBold" },
2752 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2753 {
"Root.PSFont.12",
"/SymbolMT" },
2754 {
"Root.PSFont.13",
"/FreeSerif" },
2755 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2756 {
"Root.PSFont.15",
"/SymbolMT" },
2757 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2758 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2759 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2760 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2761 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2762 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2763 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2764 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2765 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2766 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2767 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2768 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2769 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2770 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2771 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2772 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2775 Int_t len = wcslen(chars);
2793 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2797 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2799 Double_t fontsize = 4*(72*(ftsize)/2.54);
2800 if( fontsize <= 0)
return;
2806 if( font > 29 || font < 1) font = 1;
2813 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2815 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2818 x += 0.8*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2819 }
else if (txalv == 2) {
2821 x += 0.4*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2854 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2855 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2862 for(
Int_t i = 0; i < len; i++) {
2866 const wchar_t *
lower = std::lower_bound(
2870 *lower == chars[i]) {
2872 const unsigned long index =
2876 else if((
unsigned int)chars[i] < 0xffff) {
2879 (
unsigned int)chars[i]));
2884 (
unsigned int)chars[i]));
2925 return Int_t(0.5 + 288*cm/2.54);
2934 return Int_t(0.5 + 288*cm/2.54);
virtual ~TPostScript()
Default PostScript destructor.
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
static Bool_t MustEmbed[32]
const char * GetHeaderPS() const
void Text(Double_t x, Double_t y, const char *string)
Write a string of characters.
virtual int GetPid()
Get process id.
void On()
Activate an already open PostScript file.
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
void DefineMarkers()
Define the markers.
R__EXTERN TStyle * gStyle
void CellArrayFill(Int_t r, Int_t g, Int_t b)
Paint the Cell Array.
const char * fImplicitCREsc
static const char * filename()
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
Float_t GetLineScalePS() const
Short_t Min(Short_t a, Short_t b)
static const unsigned long nadobe_glyph
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw a Box.
void FontEmbed()
Embed font in PS file.
bool FontEmbedType42(const char *filename)
static std::string format(double x, double y, int digits, int width)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
virtual int Rename(const char *from, const char *to)
Rename a file.
void SetLineStyle(Style_t linestyle=1)
Change the line style.
const char * Data() const
virtual void SetTextFont(Font_t tfont=62)
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
static const double x2[5]
void SetLineWidth(Width_t linewidth=1)
Change the line width.
void Open(const char *filename, Int_t type=-111)
Open a PostScript file.
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
bool FontEmbedType2(const char *filename)
static Vc_ALWAYS_INLINE Vector< T > abs(const Vector< T > &x)
Base class for several text objects.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t GetColorModelPS() const
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.
void CellArrayEnd()
End the Cell Array painting.
void MovePS(Int_t x, Int_t y)
Move to a new position.
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
R__EXTERN TSystem * gSystem
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
Draw markers at the n WC points x, y.
virtual Color_t GetFillColor() const
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
char * Form(const char *fmt,...)
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
void SetMarkerColor(Color_t cindex=1)
Set color index for markers.
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
virtual const char * GetName() const
Returns name of object.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void FontEncode()
Font Re-encoding.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
Draw a Cell Array.
2-D graphics point (world coordinates).
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
virtual void PrintRaw(Int_t len, const char *str)
Print a raw.
static const double x1[5]
void Off()
Deactivate an already open PostScript file.
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
virtual void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
bool FontEmbedType1(const char *filename)
The color creation and management class.
void Zone()
Initialize the PostScript page in zones.
void SetColor(Int_t color=1)
Set the current color.
static const char * adobe_glyph_name[nadobe_glyph]
void SetLineScale(Float_t scale=3)
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
void Close(Option_t *opt="")
Close a PostScript file.
void SetFillColor(Color_t cindex=1)
Set color index for fill areas.
void Initialize()
PostScript Initialisation.
ClassImp(TPostScript) TPostScript
Default PostScript constructor.
R__EXTERN TVirtualPS * gVirtualPS
void NewPage()
Move to a new PostScript page.
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.
Double_t Sqrt(Double_t x)
virtual void SetTextSize(Float_t tsize=1)
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
const char * AsString() const
Return the date & time as a string (ctime() format).
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
const char * GetTitlePS() const
void SetTextColor(Color_t cindex=1)
Set color index for text.
void SetLineColor(Color_t cindex=1)
Set color index for lines.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
static const wchar_t adobe_glyph_ucs[nadobe_glyph]
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.