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");
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)@");
488 fStream->write(line,strlen(line));
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@");
679 PrintStr(
"/m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def@");
680 PrintStr(
"/m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def@");
681 PrintStr(
"/m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def@");
682 PrintStr(
"/m28 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
683 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
684 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
685 PrintStr(
" 0 w3 neg d w3 neg 0 d cl s } def@");
686 PrintStr(
"/m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
687 PrintStr(
" 4 {side} repeat cl fill gr} def@");
688 PrintStr(
"/m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t");
689 PrintStr(
" 4 {side} repeat cl s gr} def@");
690 PrintStr(
"/m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d");
691 PrintStr(
" x w2 sub y w2 add m w w neg d x w2 sub y w2");
693 PrintStr(
"/m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def@");
694 PrintStr(
"/m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def@");
695 PrintStr(
"/m34 {mp x w2 sub y w2 sub w3 add m w3 0 d ");
696 PrintStr(
" 0 w3 neg d w3 0 d 0 w3 d w3 0 d ");
697 PrintStr(
" 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d");
698 PrintStr(
" 0 w3 neg d w3 neg 0 d cl f } def@");
699 PrintStr(
"/m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def@");
700 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@");
716 if (fillis == 3 || fillis == 2) {
718 x[0] =
x1; y[0] = y1;
719 x[1] =
x2; y[1] = y1;
720 x[2] =
x2; y[2] = y2;
721 x[3] =
x1; y[3] = y2;
724 if (fillsi > 0 && fillsi < 26) {
725 x[0] =
x1; y[0] = y1;
726 x[1] =
x2; y[1] = y1;
727 x[2] =
x2; y[2] = y2;
728 x[3] =
x1; y[3] = y2;
771 static Int_t xps[7], yps[7];
772 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
777 Int_t bordPS = 4*border;
779 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
780 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
781 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
783 xps[5] = xps[0]; yps[5] = yps[4];
784 xps[6] = xps[0]; yps[6] = yps[0];
802 if( idx ) {
MovePS(idx,0); idx = 0; }
803 if( idy ) {
MovePS(0,idy); idy = 0; }
808 if( idy ) {
MovePS(0,idy); idy = 0; }
809 if( !idx ) { idx = ix;
continue;}
810 if( ix*idx > 0 ) idx += ix;
811 else {
MovePS(idx,0); idx = ix; }
815 if( idx ) {
MovePS(idx,0); idx = 0; }
816 if( !idy) { idy = iy;
continue;}
817 if( iy*idy > 0 ) idy += iy;
818 else {
MovePS(0,idy); idy = iy; }
829 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
830 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
831 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
833 xps[5] = xps[4]; yps[5] = yps[0];
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; }
888 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
904 ixd0 =
XtoPS(xy[0].GetX());
905 iyd0 =
YtoPS(xy[0].GetY());
909 if( n == 0)
goto END;
918 ixdi =
XtoPS(xy[i].GetX());
919 iydi =
YtoPS(xy[i].GetY());
925 if( idx ) {
MovePS(idx,0); idx = 0; }
926 if( idy ) {
MovePS(0,idy); idy = 0; }
931 if( idy ) {
MovePS(0,idy); idy = 0; }
932 if( !idx ) { idx = ix;
continue;}
933 if( ix*idx > 0 ) idx += ix;
934 else {
MovePS(idx,0); idx = ix; }
938 if( idx ) {
MovePS(idx,0); idx = 0; }
939 if( !idy) { idy = iy;
continue;}
940 if( iy*idy > 0 ) idy += iy;
941 else {
MovePS(0,idy); idy = iy; }
948 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY())
PrintFast(3,
" cl");
972 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
988 ixd0 =
UtoPS(xy[0].GetX());
989 iyd0 =
VtoPS(xy[0].GetY());
993 if( n == 0)
goto END;
1002 ixdi =
UtoPS(xy[i].GetX());
1003 iydi =
VtoPS(xy[i].GetY());
1009 if( idx ) {
MovePS(idx,0); idx = 0; }
1010 if( idy ) {
MovePS(0,idy); idy = 0; }
1015 if( idy ) {
MovePS(0,idy); idy = 0; }
1016 if( !idx ) { idx = ix;
continue;}
1017 if( ix*idx > 0 ) idx += ix;
1018 else {
MovePS(idx,0); idx = ix; }
1022 if( idx ) {
MovePS(idx,0); idx = 0; }
1023 if( !idy) { idy = iy;
continue;}
1024 if( iy*idy > 0 ) idy += iy;
1025 else {
MovePS(0,idy); idy = iy; }
1032 if (xy[0].GetX() == xy[n-1].GetX() && xy[0].GetY() == xy[n-1].GetY())
PrintFast(3,
" cl");
1049 Int_t i, np, markerstyle;
1051 static char chtemp[10];
1060 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1061 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1062 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1063 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1064 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1065 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1066 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1067 if (markerstyle >= 20 && markerstyle <= 34 )
snprintf(chtemp,10,
" m%d", markerstyle);
1068 if (markerstyle >= 35) strlcpy(chtemp,
" m20",10);
1071 if (markerstyle == 1) {
1073 }
else if (markerstyle == 6) {
1075 }
else if (markerstyle == 7) {
1079 const Int_t kBASEMARKER = 8;
1080 Float_t sbase = symbolsize*kBASEMARKER;
1082 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1089 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1105 if (np == 100 || i == n-1) {
1122 Int_t i, np, markerstyle;
1124 static char chtemp[10];
1133 if (markerstyle <= 0) strlcpy(chtemp,
" m20",10);
1134 if (markerstyle == 1) strlcpy(chtemp,
" m20",10);
1135 if (markerstyle == 2) strlcpy(chtemp,
" m2",10);
1136 if (markerstyle == 3) strlcpy(chtemp,
" m31",10);
1137 if (markerstyle == 4) strlcpy(chtemp,
" m24",10);
1138 if (markerstyle == 5) strlcpy(chtemp,
" m5",10);
1139 if (markerstyle >= 6 && markerstyle <= 19) strlcpy(chtemp,
" m20",10);
1140 if (markerstyle >= 20 && markerstyle <= 34 )
snprintf(chtemp,10,
" m%d", markerstyle);
1141 if (markerstyle >= 35) strlcpy(chtemp,
" m20",10);
1144 if (markerstyle == 1) {
1146 }
else if (markerstyle == 6) {
1148 }
else if (markerstyle == 7) {
1152 const Int_t kBASEMARKER = 8;
1153 Float_t sbase = symbolsize*kBASEMARKER;
1155 markersize = this->
UtoPS(s2x) - this->
UtoPS(0);
1162 PrintFast(40,
" def /w2 {w 2 div} def /w3 {w 3 div} def");
1178 if (np == 100 || i == n-1) {
1202 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1203 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1204 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1205 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1206 180, 90,135, 45,150, 30,120, 60,
1207 180, 90,135, 45,150, 30,120, 60};
1208 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1209 fais = fasi = n = 0;
1229 if (fais == 3 || fais == 2) {
1230 if (fasi > 100 && fasi <125) {
1231 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1234 if (fasi > 0 && fasi < 26) {
1245 if( n == 0)
goto END;
1253 ixdi =
XtoPS(xw[i]);
1254 iydi =
YtoPS(yw[i]);
1260 if( idx ) {
MovePS(idx,0); idx = 0; }
1261 if( idy ) {
MovePS(0,idy); idy = 0; }
1264 if( idy ) {
MovePS(0,idy); idy = 0;}
1265 if( !idx ) { idx = ix;}
1267 else {
MovePS(idx,0); idx = ix;}
1269 if( idx ) {
MovePS(idx,0); idx = 0;}
1270 if( !idy) { idy = iy;}
1272 else {
MovePS(0,idy); idy = iy;}
1279 if (xw[0] == xw[n-1] && yw[0] == yw[n-1])
PrintFast(3,
" cl");
1282 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1283 if (fais == 3 || fais == 2) {
1284 if (fasi > 0 && fasi < 26) {
1313 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1314 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1315 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1316 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1317 180, 90,135, 45,150, 30,120, 60,
1318 180, 90,135, 45,150, 30,120, 60};
1319 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1320 fais = fasi = n = 0;
1340 if (fais == 3 || fais == 2) {
1341 if (fasi > 100 && fasi <125) {
1342 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101], n, xw, yw);
1345 if (fasi > 0 && fasi < 26) {
1356 if( n == 0)
goto END;
1364 ixdi =
XtoPS(xw[i]);
1365 iydi =
YtoPS(yw[i]);
1371 if( idx ) {
MovePS(idx,0); idx = 0; }
1372 if( idy ) {
MovePS(0,idy); idy = 0; }
1375 if( idy ) {
MovePS(0,idy); idy = 0;}
1376 if( !idx ) { idx = ix;}
1378 else {
MovePS(idx,0); idx = ix;}
1380 if( idx ) {
MovePS(idx,0); idx = 0;}
1381 if( !idy) { idy = iy;}
1383 else {
MovePS(0,idy); idy = iy;}
1390 if (xw[0] == xw[n-1] && yw[0] == yw[n-1])
PrintFast(3,
" cl");
1393 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1394 if (fais == 3 || fais == 2) {
1395 if (fasi > 0 && fasi < 26) {
1417 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1425 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1432 std::ifstream font_file(filename, std::ios::binary);
1436 font_file.seekg(0, std::ios::end);
1438 const size_t font_file_length = font_file.tellg();
1440 font_file.seekg(0, std::ios::beg);
1442 std::vector<unsigned char> font_data(font_file_length,
'\0');
1444 font_file.read(reinterpret_cast<char *>(&font_data[0]),
1447 std::string font_name;
1448 std::string postscript_string =
1449 mathtext::font_embed_postscript_t::font_embed_type_1(
1450 font_name, font_data);
1452 if (!postscript_string.empty()) {
1453 PrintRaw(postscript_string.size(), postscript_string.data());
1466 std::ifstream font_file(filename, std::ios::binary);
1470 font_file.seekg(0, std::ios::end);
1472 const size_t font_file_length = font_file.tellg();
1474 font_file.seekg(0, std::ios::beg);
1476 std::vector<unsigned char> font_data(font_file_length,
'\0');
1478 font_file.read(reinterpret_cast<char *>(&font_data[0]), font_file_length);
1480 std::string font_name;
1481 std::string postscript_string =
1482 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1484 if (!postscript_string.empty()) {
1485 PrintRaw(postscript_string.size(), postscript_string.data());
1498 std::ifstream font_file(filename, std::ios::binary);
1502 font_file.seekg(0, std::ios::end);
1504 const size_t font_file_length = font_file.tellg();
1506 font_file.seekg(0, std::ios::beg);
1508 std::vector<unsigned char> font_data(font_file_length,
'\0');
1510 font_file.read(reinterpret_cast<char *>(&font_data[0]), font_file_length);
1512 std::string font_name;
1513 std::string postscript_string =
1514 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1516 if (!postscript_string.empty()) {
1517 PrintRaw(postscript_string.size(), postscript_string.data());
1522 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1532 static const char *fonttable[32][2] = {
1533 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1534 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1535 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1536 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1537 {
"Root.TTFont.4",
"FreeSans.otf" },
1538 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1539 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1540 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1541 {
"Root.TTFont.8",
"FreeMono.otf" },
1542 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1543 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1544 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1545 {
"Root.TTFont.12",
"symbol.ttf" },
1546 {
"Root.TTFont.13",
"FreeSerif.otf" },
1547 {
"Root.TTFont.14",
"wingding.ttf" },
1548 {
"Root.TTFont.15",
"symbol.ttf" },
1549 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1550 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1551 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1552 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1553 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1554 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1555 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1556 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1557 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1558 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1559 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1560 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1561 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1562 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1563 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1564 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1567 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1578 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1579 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1581 fonttable[fontid][0], fonttable[fontid][1]);
1584 Error(
"TPostScript::FontEmbed",
1585 "font %d (filename `%s') not found in path",
1595 Error(
"TPostScript::FontEmbed",
1596 "failed to embed font %d (filename `%s')",
1603 PrintStr(
"%%IncludeResource: font Times-Roman@");
1604 PrintStr(
"%%IncludeResource: font Times-Italic@");
1605 PrintStr(
"%%IncludeResource: font Times-Bold@");
1606 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1607 PrintStr(
"%%IncludeResource: font Helvetica@");
1608 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1609 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1610 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1611 PrintStr(
"%%IncludeResource: font Courier@");
1612 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1613 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1614 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1615 PrintStr(
"%%IncludeResource: font Symbol@");
1616 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1628 PrintStr(
" dup length dict begin");
1635 PrintStr(
" dup /FontName get exch");
1638 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1639 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1640 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1641 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1642 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1643 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1644 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1645 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1646 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1647 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1648 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1688 Double_t rpxmin, rpymin, width, heigth;
1689 rpxmin = rpymin = width = heigth = 0;
1701 if( fMode <= 0 || fMode > 5) {
1702 Error(
"Initialize",
"invalid file type %d",
fMode);
1718 format = atype/1000;
1719 if( format == 0 ) format = 4;
1720 if( format == 99 ) format = 0;
1724 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1726 if(!pstitle[0] &&
fMode != 3) {;
1728 if ( format <= 99 ) {;
1734 if ( format == 100 )
PrintFast(8,
" Letter)");
1735 if ( format == 200 )
PrintFast(7,
" Legal)");
1736 if ( format == 300 )
PrintFast(8,
" Ledger)");
1742 if (!strchr(pstitle,
'\n')) {
1749 PrintFast(24,
"%%Creator: ROOT Version ");
1766 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1767 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1768 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1770 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1772 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1774 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1775 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1776 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1777 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 @");
1778 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1779 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1791 width = (8.5*2.54)-2.*rpxmin;
1792 heigth = (11.*2.54)-2.*rpymin;
1795 width = (8.5*2.54)-2.*rpxmin;
1796 heigth = (14.*2.54)-2.*rpymin;
1799 width = (11.*2.54)-2.*rpxmin;
1800 heigth = (17.*2.54)-2.*rpymin;
1803 width = 21.0-2.*rpxmin;
1804 heigth = 29.7-2.*rpymin;
1814 width = (11.*2.54)-2.*rpxmin;
1815 heigth = (8.5*2.54)-2.*rpymin;
1818 width = (14.*2.54)-2.*rpxmin;
1819 heigth = (8.5*2.54)-2.*rpymin;
1822 width = (17.*2.54)-2.*rpxmin;
1823 heigth = (11.*2.54)-2.*rpymin;
1826 width = 29.7-2.*rpxmin;
1827 heigth = 21-2.*rpymin;
1846 width = (8.5*2.54)-2.*rpxmin;
1847 heigth = (11.*2.54)-2.*rpymin;
1850 width = (8.5*2.54)-2.*rpxmin;
1851 heigth = (14.*2.54)-2.*rpymin;
1854 width = (11.*2.54)-2.*rpxmin;
1855 heigth = (17.*2.54)-2.*rpymin;
1858 width = (21.0-2*rpxmin);
1859 heigth = (29.7-2.*rpymin);
1869 width = (11.*2.54)-2.*rpxmin;
1870 heigth = (8.5*2.54)-2.*rpymin;
1873 width = (14.*2.54)-2.*rpxmin;
1874 heigth = (8.5*2.54)-2.*rpymin;
1877 width = (17.*2.54)-2.*rpxmin;
1878 heigth = (11.*2.54)-2.*rpymin;
1881 width = (29.7-2*rpxmin);
1882 heigth = (21-2.*rpymin);
1888 else if (format == 100) value = 8.5*2.54;
1889 else if (format == 200) value = 8.5*2.54;
1890 else if (format == 300) value = 11.*2.54;
1891 if (format >= 100) format = 4;
1903 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
1955 if (ix != 0 && iy != 0) {
1959 }
else if (ix != 0) {
1962 }
else if (iy != 0) {
1984 Double_t xlow=0, ylow=0, xup=1, yup=1;
1986 xlow =
gPad->GetAbsXlowNDC();
1987 xup = xlow +
gPad->GetAbsWNDC();
1988 ylow =
gPad->GetAbsYlowNDC();
1989 yup = ylow +
gPad->GetAbsHNDC();
2013 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2018 else { xps = xsize; yps = ysize; }
2020 if( xsize <= xps && ysize < yps) {
2021 if ( xps > yps ) xymax = xps;
2025 dxwn = ((xps/xymax)-xncm)/2;
2026 dywn = ((yps/xymax)-yncm)/2;
2028 if (xps/yps < 1) xwkwn = xps/yps;
2030 if (yps/xps < 1) ywkwn = yps/xps;
2033 if (xsize < ysize) {
2034 xncm = ywkwn*xsize/ysize;
2036 dxwn = (xwkwn-xncm)/2;
2041 yncm = xwkwn*ysize/xsize;
2042 dywn = (ywkwn-yncm)/2;
2046 yncm = xwkwn*ysize/xsize;
2048 dywn = (ywkwn-yncm)/2;
2052 xncm = ywkwn*xsize/ysize;
2053 dxwn = (xwkwn-xncm)/2;
2118 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2123 PrintStr(
" /PaintProc { begin gsave");
2124 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2125 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2126 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2131 PrintStr(
" /PaintProc { begin gsave");
2132 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2133 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2134 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2139 PrintStr(
" /PaintProc { begin gsave");
2140 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2141 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2142 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2145 PrintStr(
" /BBox [ 0 0 100 100 ]");
2146 PrintStr(
" /XStep 100 /YStep 100");
2147 PrintStr(
" /PaintProc { begin gsave");
2149 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2152 PrintStr(
" /BBox [ 0 0 100 100 ]");
2153 PrintStr(
" /XStep 100 /YStep 100");
2154 PrintStr(
" /PaintProc { begin gsave");
2156 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2159 PrintStr(
" /BBox [ 0 0 100 100 ]");
2160 PrintStr(
" /XStep 100 /YStep 100");
2161 PrintStr(
" /PaintProc { begin gsave");
2163 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2166 PrintStr(
" /BBox [ 0 0 100 100 ]");
2167 PrintStr(
" /XStep 100 /YStep 100");
2168 PrintStr(
" /PaintProc { begin gsave");
2170 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2173 PrintStr(
" /BBox [ 0 0 101 101 ]");
2174 PrintStr(
" /XStep 100 /YStep 100");
2175 PrintStr(
" /PaintProc { begin gsave");
2176 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2177 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2178 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2179 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2180 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2181 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2184 PrintStr(
" /BBox [ 0 0 100 100 ]");
2185 PrintStr(
" /XStep 100 /YStep 100");
2186 PrintStr(
" /PaintProc { begin gsave");
2187 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2188 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2189 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
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");
2196 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2197 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2199 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2202 PrintStr(
" /BBox [ 0 0 100 100 ]");
2203 PrintStr(
" /XStep 100 /YStep 100");
2204 PrintStr(
" /PaintProc { begin gsave");
2205 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2206 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2207 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2208 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2209 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2210 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2211 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2212 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2213 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2214 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2215 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2218 PrintStr(
" /BBox [ 0 0 100 100 ]");
2219 PrintStr(
" /XStep 100 /YStep 100");
2220 PrintStr(
" /PaintProc { begin gsave");
2221 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2222 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2223 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2224 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2225 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2226 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2227 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2228 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2229 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2232 PrintStr(
" /BBox [ 0 0 100 100 ]");
2233 PrintStr(
" /XStep 100 /YStep 100");
2234 PrintStr(
" /PaintProc { begin gsave");
2235 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2236 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2239 PrintStr(
" /BBox [ 0 0 100 100 ]");
2241 PrintStr(
" /PaintProc { begin gsave");
2242 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2243 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2244 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2245 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2246 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2251 PrintStr(
" /PaintProc { begin gsave");
2252 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2253 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2254 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2255 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2256 PrintStr(
" 50 30 m 45 30 5 0 360");
2257 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2258 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2259 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2260 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2263 PrintStr(
" /BBox [ 0 0 100 100 ]");
2264 PrintStr(
" /XStep 100 /YStep 100");
2265 PrintStr(
" /PaintProc { begin gsave");
2266 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2267 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2268 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2271 PrintStr(
" /BBox [ 0 0 100 100 ]");
2272 PrintStr(
" /XStep 100 /YStep 100");
2273 PrintStr(
" /PaintProc { begin gsave");
2274 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2275 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2278 PrintStr(
" /BBox [ 0 0 100 100 ]");
2279 PrintStr(
" /XStep 100 /YStep 100");
2280 PrintStr(
" /PaintProc { begin gsave");
2281 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2282 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2285 PrintStr(
" /BBox [ 0 0 100 100 ]");
2286 PrintStr(
" /XStep 100 /YStep 100");
2287 PrintStr(
" /PaintProc { begin gsave");
2288 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2289 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2290 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2291 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2292 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2293 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2296 PrintStr(
" /BBox [ 0 0 100 100 ]");
2297 PrintStr(
" /XStep 100 /YStep 100");
2298 PrintStr(
" /PaintProc { begin gsave");
2299 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2300 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2301 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2304 PrintStr(
" /BBox [ 0 0 101 101 ]");
2305 PrintStr(
" /XStep 100 /YStep 100");
2306 PrintStr(
" /PaintProc { begin gsave");
2307 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2308 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2309 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2310 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2311 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2314 PrintStr(
" /BBox [ 0 0 101 101 ]");
2315 PrintStr(
" /XStep 100 /YStep 100");
2316 PrintStr(
" /PaintProc { begin gsave");
2317 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2318 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2319 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2320 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2321 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2324 PrintStr(
" /BBox [ 0 0 100 100 ]");
2325 PrintStr(
" /XStep 100 /YStep 100");
2326 PrintStr(
" /PaintProc { begin gsave");
2327 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2328 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2329 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2330 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2333 PrintStr(
" /BBox [ 0 0 100 100 ]");
2334 PrintStr(
" /XStep 100 /YStep 100");
2335 PrintStr(
" /PaintProc { begin gsave");
2336 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2337 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2338 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2339 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2340 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2341 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2342 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2343 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2344 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2345 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2346 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2347 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2348 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2351 PrintStr(
" /BBox [ 0 0 101 101 ]");
2352 PrintStr(
" /XStep 100 /YStep 100");
2353 PrintStr(
" /PaintProc { begin gsave");
2354 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2355 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2356 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2358 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2366 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2367 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2369 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2370 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2390 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2391 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2392 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2457 Int_t nch = strlen(st);
2489 if (color < 0) color = 0;
2548 static const char *psfont[31][2] = {
2549 {
"Root.PSFont.1",
"/Times-Italic" },
2550 {
"Root.PSFont.2",
"/Times-Bold" },
2551 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2552 {
"Root.PSFont.4",
"/Helvetica" },
2553 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2554 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2555 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2556 {
"Root.PSFont.8",
"/Courrier" },
2557 {
"Root.PSFont.9",
"/Courrier-Oblique" },
2558 {
"Root.PSFont.10",
"/Courrier-Bold" },
2559 {
"Root.PSFont.11",
"/Courrier-BoldOblique" },
2560 {
"Root.PSFont.12",
"/Symbol" },
2561 {
"Root.PSFont.13",
"/Times-Roman" },
2562 {
"Root.PSFont.14",
"/ZapfDingbats" },
2563 {
"Root.PSFont.15",
"/Symbol" },
2564 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2565 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2566 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2567 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2568 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2569 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2570 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2571 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2572 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2573 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2574 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2575 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2576 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2577 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2578 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2579 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2597 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2601 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2603 Double_t fontsize = 4*(72*(ftsize)/2.54);
2604 if( fontsize <= 0)
return;
2610 if( font > 31 || font < 1) font = 1;
2617 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2619 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2622 x += 0.8*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2623 }
else if (txalv == 2) {
2625 x += 0.4*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2637 saveAttText.TAttText::operator=(*this);
2638 const Int_t len=strlen(chars);
2639 Int_t *charWidthsCumul = 0;
2645 t.TAttText::Modify();
2646 if (w0-w != 0) kerning =
kTRUE;
2650 charWidthsCumul =
new Int_t[len];
2651 for (
Int_t i = len - 1;i >= 0;i--) {
2659 saveAttText.TAttText::Modify();
2691 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2692 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2703 for (
Int_t i = len-1; i >= 1; i--) {
2706 delete [] charWidthsCumul;
2718 for (
Int_t i=0; i<len;i++) {
2719 if (chars[i]!=
'\n') {
2720 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2723 }
else if ((chars[i]==
'-') && (font != 12)) {
2738 if (font != 15)
PrintStr(
" show NC");
2753 static const char *psfont[31][2] = {
2754 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2755 {
"Root.PSFont.2",
"/FreeSerifBold" },
2756 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2757 {
"Root.PSFont.4",
"/FreeSans" },
2758 {
"Root.PSFont.5",
"/FreeSansOblique" },
2759 {
"Root.PSFont.6",
"/FreeSansBold" },
2760 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2761 {
"Root.PSFont.8",
"/FreeMono" },
2762 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2763 {
"Root.PSFont.10",
"/FreeMonoBold" },
2764 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2765 {
"Root.PSFont.12",
"/SymbolMT" },
2766 {
"Root.PSFont.13",
"/FreeSerif" },
2767 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2768 {
"Root.PSFont.15",
"/SymbolMT" },
2769 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2770 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2771 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2772 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2773 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2774 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2775 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2776 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2777 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2778 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2779 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2780 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2781 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2782 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2783 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2784 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2787 Int_t len = wcslen(chars);
2805 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2809 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2811 Double_t fontsize = 4*(72*(ftsize)/2.54);
2812 if( fontsize <= 0)
return;
2818 if( font > 29 || font < 1) font = 1;
2825 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2827 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2830 x += 0.8*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2831 }
else if (txalv == 2) {
2833 x += 0.4*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2866 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2867 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2874 for(
Int_t i = 0; i < len; i++) {
2878 const wchar_t *lower = std::lower_bound(
2882 *lower == chars[i]) {
2884 const unsigned long index =
2888 else if((
unsigned int)chars[i] < 0xffff) {
2891 (
unsigned int)chars[i]));
2896 (
unsigned int)chars[i]));
2937 return Int_t(0.5 + 288*cm/2.54);
2946 return Int_t(0.5 + 288*cm/2.54);
virtual ~TPostScript()
Default PostScript destructor.
Int_t GetColorModelPS() const
virtual const char * GetName() const
Returns name of object.
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]
Float_t GetLineScalePS() const
Int_t fNBSameColorCell
Number of boxes with the same color.
void Text(Double_t x, Double_t y, const char *string)
Write a string of characters.
virtual int GetPid()
Get process id.
Float_t fXsize
Page size along X.
Bool_t fClear
True when page must be cleared.
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.
Float_t fYsize
Page size along Y.
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
const char * fImplicitCREsc
Size_t fMarkerSize
Marker size.
Bool_t fBoundingBox
True for Encapsulated PostScript.
Int_t fCurrentColor
current Postscript color index
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
Short_t Min(Short_t a, Short_t b)
static const unsigned long nadobe_glyph
Int_t fLastCellRed
Last red value.
Float_t fMarkerSizeCur
current transformed value of marker size
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
Int_t fNXzone
Number of zones along X.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
char fPatterns[32]
Indicate if pattern n is defined.
Bool_t fFontEmbed
True is FontEmbed has been called.
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.
Int_t fType
PostScript workstation type.
void SetLineStyle(Style_t linestyle=1)
Change the line style.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
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...
Int_t fSave
Number of gsave for restore.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
static const double x2[5]
Float_t fMaxsize
Largest dimension of X and Y.
Int_t fNpages
number of pages
TPostScript()
Default PostScript constructor.
void SetLineWidth(Width_t linewidth=1)
Change the line width.
void Open(const char *filename, Int_t type=-111)
Open a PostScript file.
static Int_t fgLineJoin
Appearance of joining lines.
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
TString fFileName
PS file name.
Int_t fNYzone
Number of zones along Y.
bool FontEmbedType2(const char *filename)
Int_t fNbCellW
Number of boxes per line.
Bool_t fClipStatus
Clipping Indicator.
Base class for several text objects.
Int_t fIYzone
Current zone along Y.
Int_t fNbCellLine
Number of boxes in the current line.
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.
Style_t fMarkerStyle
Marker style.
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.
Float_t fTextAngle
Text angle.
Style_t fLineStyle
Line style.
R__EXTERN TSystem * gSystem
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Color_t fLineColor
Line color.
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.
const char * GetTitlePS() const
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Width_t fLineWidth
Line width.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
Int_t fLastCellBlue
Last blue value.
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.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void FontEncode()
Font Re-encoding.
Float_t fRed
Per cent of red.
Font_t fTextFont
Text font.
const char * GetHeaderPS() const
Bool_t fRange
True when a range has been defined.
Int_t GetJoinLinePS() const
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.
Int_t fNbinCT
Number of entries in the current Cell Array.
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.
Bool_t fZone
Zone indicator.
bool FontEmbedType1(const char *filename)
virtual Color_t GetFillColor() const
Return the fill area color.
Int_t fIXzone
Current zone along X.
const char * AsString() const
Return the date & time as a string (ctime() format).
The color creation and management class.
Float_t fTextSize
Text size.
void Zone()
Initialize the PostScript page in zones.
void SetColor(Int_t color=1)
Set the current color.
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
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.
Color_t fFillColor
Fill area color.
Int_t fClip
Clipping mode.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
void Initialize()
PostScript Initialisation.
R__EXTERN TVirtualPS * gVirtualPS
Int_t fMode
PostScript mode.
Int_t fLastCellGreen
Last green value.
void NewPage()
Move to a new PostScript page.
Float_t fLineScale
Line width scale factor.
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Double_t Sqrt(Double_t x)
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
Color_t fMarkerColor
Marker color.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Color_t fTextColor
Text color.
void SetTextColor(Color_t cindex=1)
Set color index for text.
void SetLineColor(Color_t cindex=1)
Set color index for lines.
Float_t fGreen
Per cent of green.
Int_t fMaxLines
Maximum number of lines in a PS array.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Float_t fBlue
Per cent of blue.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Style_t fFillStyle
Fill area style.
Short_t fTextAlign
Text alignment.
const char * Data() const
static const wchar_t adobe_glyph_ucs[nadobe_glyph]