225 #pragma optimize("",off) 232 #include <fontconfig/fontconfig.h> 247 #include "../../../graf2d/mathtext/inc/fontembed.h" 289 fNBSameColorCell = 0;
323 for (i=0; i<32; i++) fPatterns[i] = 0;
354 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 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1534 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1535 if (fontid != 15 &&
MustEmbed[fontid-1]) {
1537 char *ttfont =
NULL;
1539 FcPattern *pat, *match;
1540 FcCharSet *
set =
NULL;
1543 pat = FcPatternCreate ();
1547 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freeserif");
1548 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1549 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1552 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freeserif");
1553 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1554 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1557 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freeserif");
1558 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1559 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1562 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freesans");
1563 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1564 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1567 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freesans");
1568 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1569 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1572 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freesans");
1573 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1574 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1577 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freesans");
1578 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1579 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1582 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freemono");
1583 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1584 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1587 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freemono");
1588 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1589 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1592 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freemono");
1593 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1594 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1597 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freemono");
1598 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1599 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1602 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"symbol");
1603 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1604 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1607 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"freeserif");
1608 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1609 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1612 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"dingbats");
1613 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1614 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1617 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixgeneral");
1618 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1619 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1622 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixgeneral");
1623 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1624 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1627 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixgeneral");
1628 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1629 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1632 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixgeneral");
1633 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1634 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ITALIC);
1637 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize1");
1638 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1639 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1642 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize1");
1643 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1644 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1647 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize2");
1648 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1649 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1652 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize2");
1653 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1654 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1657 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize3");
1658 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1659 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1662 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize3");
1663 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1664 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1667 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize4");
1668 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1669 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1672 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize4");
1673 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_BOLD);
1674 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1677 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"stixsize5");
1678 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1679 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1682 FcPatternAddString (pat, FC_FAMILY, (
const FcChar8*)
"droidsansfallback");
1683 FcPatternAddInteger (pat, FC_WEIGHT, FC_WEIGHT_REGULAR);
1684 FcPatternAddInteger (pat, FC_SLANT, FC_SLANT_ROMAN);
1685 set = FcCharSetCreate ();
1686 FcCharSetAddChar (
set, 0x0410);
1687 FcCharSetAddChar (
set, 0x4e00);
1688 FcPatternAddCharSet (pat, FC_CHARSET,
set);
1692 FcConfigSubstitute (
NULL, pat, FcMatchPattern);
1693 FcDefaultSubstitute (pat);
1694 match = FcFontMatch (
NULL, pat, &result);
1696 FcPatternGetString (match, FC_FILE, 0, (FcChar8**)&ttfnt);
1698 FcPatternDestroy (match);
1699 FcPatternDestroy (pat);
1700 if (
set) FcCharSetDestroy (
set);
1703 Error(
"TPostScript::FontEmbed",
"font %d not found in path",
1713 Error(
"TPostScript::FontEmbed",
"failed to embed font %d)",
1720 PrintStr(
"%%IncludeResource: font Times-Roman@");
1721 PrintStr(
"%%IncludeResource: font Times-Italic@");
1722 PrintStr(
"%%IncludeResource: font Times-Bold@");
1723 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1724 PrintStr(
"%%IncludeResource: font Helvetica@");
1725 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1726 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1727 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1728 PrintStr(
"%%IncludeResource: font Courier@");
1729 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1730 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1731 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1732 PrintStr(
"%%IncludeResource: font Symbol@");
1733 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1745 PrintStr(
" dup length dict begin");
1752 PrintStr(
" dup /FontName get exch");
1755 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1756 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1757 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1758 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1759 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1760 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1761 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1762 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1763 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1764 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1765 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1805 Double_t rpxmin, rpymin, width, heigth;
1806 rpxmin = rpymin = width = heigth = 0;
1818 if( fMode <= 0 || fMode > 5) {
1819 Error(
"Initialize",
"invalid file type %d",
fMode);
1835 format = atype/1000;
1836 if( format == 0 ) format = 4;
1837 if( format == 99 ) format = 0;
1841 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1843 if(!pstitle[0] &&
fMode != 3) {;
1845 if ( format <= 99 ) {;
1851 if ( format == 100 )
PrintFast(8,
" Letter)");
1852 if ( format == 200 )
PrintFast(7,
" Legal)");
1853 if ( format == 300 )
PrintFast(8,
" Ledger)");
1859 if (!strchr(pstitle,
'\n')) {
1866 PrintFast(24,
"%%Creator: ROOT Version ");
1883 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1884 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1885 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1887 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1889 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1891 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1892 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1893 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1894 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 @");
1895 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1896 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def @");
1908 width = (8.5*2.54)-2.*rpxmin;
1909 heigth = (11.*2.54)-2.*rpymin;
1912 width = (8.5*2.54)-2.*rpxmin;
1913 heigth = (14.*2.54)-2.*rpymin;
1916 width = (11.*2.54)-2.*rpxmin;
1917 heigth = (17.*2.54)-2.*rpymin;
1920 width = 21.0-2.*rpxmin;
1921 heigth = 29.7-2.*rpymin;
1931 width = (11.*2.54)-2.*rpxmin;
1932 heigth = (8.5*2.54)-2.*rpymin;
1934 width = (14.*2.54)-2.*rpxmin;
1935 heigth = (8.5*2.54)-2.*rpymin;
1937 width = (17.*2.54)-2.*rpxmin;
1938 heigth = (11.*2.54)-2.*rpymin;
1940 width = 29.7-2.*rpxmin;
1941 heigth = 21-2.*rpymin;
1960 width = (8.5*2.54)-2.*rpxmin;
1961 heigth = (11.*2.54)-2.*rpymin;
1963 width = (8.5*2.54)-2.*rpxmin;
1964 heigth = (14.*2.54)-2.*rpymin;
1966 width = (11.*2.54)-2.*rpxmin;
1967 heigth = (17.*2.54)-2.*rpymin;
1969 width = (21.0-2*rpxmin);
1970 heigth = (29.7-2.*rpymin);
1980 width = (11.*2.54)-2.*rpxmin;
1981 heigth = (8.5*2.54)-2.*rpymin;
1983 width = (14.*2.54)-2.*rpxmin;
1984 heigth = (8.5*2.54)-2.*rpymin;
1986 width = (17.*2.54)-2.*rpxmin;
1987 heigth = (11.*2.54)-2.*rpymin;
1989 width = (29.7-2*rpxmin);
1990 heigth = (21-2.*rpymin);
1996 else if (format == 100) value = 8.5*2.54;
1997 else if (format == 200) value = 8.5*2.54;
1998 else if (format == 300) value = 11.*2.54;
1999 if (format >= 100) format = 4;
2011 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
2063 if (ix != 0 && iy != 0) {
2067 }
else if (ix != 0) {
2070 }
else if (iy != 0) {
2092 Double_t xlow=0, ylow=0, xup=1, yup=1;
2094 xlow =
gPad->GetAbsXlowNDC();
2095 xup = xlow +
gPad->GetAbsWNDC();
2096 ylow =
gPad->GetAbsYlowNDC();
2097 yup = ylow +
gPad->GetAbsHNDC();
2121 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
2126 else { xps = xsize; yps = ysize; }
2128 if( xsize <= xps && ysize < yps) {
2129 if ( xps > yps ) xymax = xps;
2133 dxwn = ((xps/xymax)-xncm)/2;
2134 dywn = ((yps/xymax)-yncm)/2;
2136 if (xps/yps < 1) xwkwn = xps/yps;
2138 if (yps/xps < 1) ywkwn = yps/xps;
2141 if (xsize < ysize) {
2142 xncm = ywkwn*xsize/ysize;
2144 dxwn = (xwkwn-xncm)/2;
2149 yncm = xwkwn*ysize/xsize;
2150 dywn = (ywkwn-yncm)/2;
2154 yncm = xwkwn*ysize/xsize;
2156 dywn = (ywkwn-yncm)/2;
2160 xncm = ywkwn*xsize/ysize;
2161 dxwn = (xwkwn-xncm)/2;
2212 snprintf(cpat,5,
" P%2.2d", ipat);
2226 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2231 PrintStr(
" /PaintProc { begin gsave");
2232 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2233 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2234 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2239 PrintStr(
" /PaintProc { begin gsave");
2240 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2241 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2242 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2247 PrintStr(
" /PaintProc { begin gsave");
2248 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2249 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2250 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2253 PrintStr(
" /BBox [ 0 0 100 100 ]");
2254 PrintStr(
" /XStep 100 /YStep 100");
2255 PrintStr(
" /PaintProc { begin gsave");
2257 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2260 PrintStr(
" /BBox [ 0 0 100 100 ]");
2261 PrintStr(
" /XStep 100 /YStep 100");
2262 PrintStr(
" /PaintProc { begin gsave");
2264 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2267 PrintStr(
" /BBox [ 0 0 100 100 ]");
2268 PrintStr(
" /XStep 100 /YStep 100");
2269 PrintStr(
" /PaintProc { begin gsave");
2271 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2274 PrintStr(
" /BBox [ 0 0 100 100 ]");
2275 PrintStr(
" /XStep 100 /YStep 100");
2276 PrintStr(
" /PaintProc { begin gsave");
2278 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2281 PrintStr(
" /BBox [ 0 0 101 101 ]");
2282 PrintStr(
" /XStep 100 /YStep 100");
2283 PrintStr(
" /PaintProc { begin gsave");
2284 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2285 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2286 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2287 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2288 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2289 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2292 PrintStr(
" /BBox [ 0 0 100 100 ]");
2293 PrintStr(
" /XStep 100 /YStep 100");
2294 PrintStr(
" /PaintProc { begin gsave");
2295 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2296 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2297 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2298 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2301 PrintStr(
" /BBox [ 0 0 100 100 ]");
2302 PrintStr(
" /XStep 100 /YStep 100");
2303 PrintStr(
" /PaintProc { begin gsave");
2304 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2305 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2307 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2310 PrintStr(
" /BBox [ 0 0 100 100 ]");
2311 PrintStr(
" /XStep 100 /YStep 100");
2312 PrintStr(
" /PaintProc { begin gsave");
2313 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2314 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2315 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2316 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2317 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2318 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2319 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2320 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2321 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2322 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2323 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2326 PrintStr(
" /BBox [ 0 0 100 100 ]");
2327 PrintStr(
" /XStep 100 /YStep 100");
2328 PrintStr(
" /PaintProc { begin gsave");
2329 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2330 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2331 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2332 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2333 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2334 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2335 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2336 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2337 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2340 PrintStr(
" /BBox [ 0 0 100 100 ]");
2341 PrintStr(
" /XStep 100 /YStep 100");
2342 PrintStr(
" /PaintProc { begin gsave");
2343 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2344 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2347 PrintStr(
" /BBox [ 0 0 100 100 ]");
2349 PrintStr(
" /PaintProc { begin gsave");
2350 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2351 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2352 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2353 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2354 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2359 PrintStr(
" /PaintProc { begin gsave");
2360 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2361 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2362 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2363 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2364 PrintStr(
" 50 30 m 45 30 5 0 360");
2365 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2366 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2367 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2368 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2371 PrintStr(
" /BBox [ 0 0 100 100 ]");
2372 PrintStr(
" /XStep 100 /YStep 100");
2373 PrintStr(
" /PaintProc { begin gsave");
2374 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2375 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2376 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2379 PrintStr(
" /BBox [ 0 0 100 100 ]");
2380 PrintStr(
" /XStep 100 /YStep 100");
2381 PrintStr(
" /PaintProc { begin gsave");
2382 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2383 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2386 PrintStr(
" /BBox [ 0 0 100 100 ]");
2387 PrintStr(
" /XStep 100 /YStep 100");
2388 PrintStr(
" /PaintProc { begin gsave");
2389 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2390 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2393 PrintStr(
" /BBox [ 0 0 100 100 ]");
2394 PrintStr(
" /XStep 100 /YStep 100");
2395 PrintStr(
" /PaintProc { begin gsave");
2396 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2397 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2398 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2399 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2400 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2401 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2404 PrintStr(
" /BBox [ 0 0 100 100 ]");
2405 PrintStr(
" /XStep 100 /YStep 100");
2406 PrintStr(
" /PaintProc { begin gsave");
2407 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2408 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2409 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2412 PrintStr(
" /BBox [ 0 0 101 101 ]");
2413 PrintStr(
" /XStep 100 /YStep 100");
2414 PrintStr(
" /PaintProc { begin gsave");
2415 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2416 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2417 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2418 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2419 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2422 PrintStr(
" /BBox [ 0 0 101 101 ]");
2423 PrintStr(
" /XStep 100 /YStep 100");
2424 PrintStr(
" /PaintProc { begin gsave");
2425 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2426 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2427 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2428 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2429 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2432 PrintStr(
" /BBox [ 0 0 100 100 ]");
2433 PrintStr(
" /XStep 100 /YStep 100");
2434 PrintStr(
" /PaintProc { begin gsave");
2435 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2436 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2437 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2438 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2441 PrintStr(
" /BBox [ 0 0 100 100 ]");
2442 PrintStr(
" /XStep 100 /YStep 100");
2443 PrintStr(
" /PaintProc { begin gsave");
2444 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2445 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2446 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2447 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2448 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2449 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2450 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2451 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2452 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2453 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2454 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2455 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2456 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2459 PrintStr(
" /BBox [ 0 0 101 101 ]");
2460 PrintStr(
" /XStep 100 /YStep 100");
2461 PrintStr(
" /PaintProc { begin gsave");
2462 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2463 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2464 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2466 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2474 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2475 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2477 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2478 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2498 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2499 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2500 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2563 Int_t nch = strlen(st);
2595 if (color < 0) color = 0;
2654 static const char *psfont[31][2] = {
2655 {
"Root.PSFont.1",
"/Times-Italic" },
2656 {
"Root.PSFont.2",
"/Times-Bold" },
2657 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2658 {
"Root.PSFont.4",
"/Helvetica" },
2659 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2660 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2661 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2662 {
"Root.PSFont.8",
"/Courier" },
2663 {
"Root.PSFont.9",
"/Courier-Oblique" },
2664 {
"Root.PSFont.10",
"/Courier-Bold" },
2665 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2666 {
"Root.PSFont.12",
"/Symbol" },
2667 {
"Root.PSFont.13",
"/Times-Roman" },
2668 {
"Root.PSFont.14",
"/ZapfDingbats" },
2669 {
"Root.PSFont.15",
"/Symbol" },
2670 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2671 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2672 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2673 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2674 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2675 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2676 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2677 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2678 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2679 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2680 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2681 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2682 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2683 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2684 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2685 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2703 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2707 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2709 Double_t fontsize = 4*(72*(ftsize)/2.54);
2710 if( fontsize <= 0)
return;
2716 if( font > 31 || font < 1) font = 1;
2723 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2725 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2728 x += 0.8*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2729 }
else if (txalv == 2) {
2731 x += 0.4*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2743 saveAttText.TAttText::operator=(*this);
2744 const Int_t len=strlen(chars);
2745 Int_t *charWidthsCumul = 0;
2751 t.TAttText::Modify();
2752 if (w0-w != 0) kerning =
kTRUE;
2756 charWidthsCumul =
new Int_t[len];
2757 for (
Int_t i = len - 1;i >= 0;i--) {
2765 saveAttText.TAttText::Modify();
2797 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2798 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2809 for (
Int_t i = len-1; i >= 1; i--) {
2812 delete [] charWidthsCumul;
2824 for (
Int_t i=0; i<len;i++) {
2825 if (chars[i]!=
'\n') {
2826 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2827 snprintf(str,8,
"\\%c",chars[i]);
2829 }
else if ((chars[i]==
'-') && (font != 12)) {
2832 snprintf(str,8,
"%c",chars[i]);
2844 if (font != 15)
PrintStr(
" show NC");
2859 static const char *psfont[31][2] = {
2860 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2861 {
"Root.PSFont.2",
"/FreeSerifBold" },
2862 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2863 {
"Root.PSFont.4",
"/FreeSans" },
2864 {
"Root.PSFont.5",
"/FreeSansOblique" },
2865 {
"Root.PSFont.6",
"/FreeSansBold" },
2866 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2867 {
"Root.PSFont.8",
"/FreeMono" },
2868 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2869 {
"Root.PSFont.10",
"/FreeMonoBold" },
2870 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2871 {
"Root.PSFont.12",
"/StandardSymbolsL" },
2872 {
"Root.PSFont.13",
"/FreeSerif" },
2873 {
"Root.PSFont.14",
"/Dingbats" },
2874 {
"Root.PSFont.15",
"/StandardSymbolsL" },
2875 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2876 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2877 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2878 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2879 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2880 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2881 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2882 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2883 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2884 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2885 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2886 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2887 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2888 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2889 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2890 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2893 Int_t len = wcslen(chars);
2911 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2915 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2917 Double_t fontsize = 4*(72*(ftsize)/2.54);
2918 if( fontsize <= 0)
return;
2924 if( font > 29 || font < 1) font = 1;
2931 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2933 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2936 x += 0.8*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2937 }
else if (txalv == 2) {
2939 x += 0.4*tsizex*
TMath::Sin(kDEGRAD*fTextAngle);
2972 if(txalh == 2)
PrintStr(
Form(
" %d 0 t ", -psCharsLength/2));
2973 if(txalh == 3)
PrintStr(
Form(
" %d 0 t ", -psCharsLength));
2980 for(
Int_t i = 0; i < len; i++) {
2984 const wchar_t *
lower = std::lower_bound(
2988 *lower == chars[i]) {
2990 const unsigned long index =
2994 else if((
unsigned int)chars[i] < 0xffff) {
2997 (
unsigned int)chars[i]));
3002 (
unsigned int)chars[i]));
3043 return Int_t(0.5 + 288*cm/2.54);
3052 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
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.
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
const char * fImplicitCREsc
static const char * filename()
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
void DrawPS(Int_t n, Float_t *xw, Float_t *yw)
Draw a PolyLine.
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.
virtual void SetTextFont(Font_t tfont=62)
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...
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
static const double x2[5]
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.
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.
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.
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
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.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void FontEncode()
Font Re-encoding.
const char * GetHeaderPS() const
char * StrDup(const char *str)
Duplicate the string str.
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.
bool FontEmbedType1(const char *filename)
virtual Color_t GetFillColor() const
const char * AsString() const
Return the date & time as a string (ctime() format).
The color creation and management class.
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.
void Initialize()
PostScript Initialisation.
R__EXTERN TVirtualPS * gVirtualPS
void NewPage()
Move to a new PostScript page.
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.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void SetTextColor(Color_t cindex=1)
Set color index for text.
void SetLineColor(Color_t cindex=1)
Set color index for lines.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * Data() const
static const wchar_t adobe_glyph_ucs[nadobe_glyph]