229#pragma optimize("",off)
255#include "mathtext/fontembed.h"
270 for (
Int_t i = 0; i < 32; i++)
272 for (
Int_t i = 0; i < 29; i++)
293 for (
Int_t i = 0; i < 32; i++)
295 for (
Int_t i = 0; i < 29; i++)
308 Warning(
"Open",
"postscript file already open");
318 fType = std::abs(wtype);
333 ww *=
gPad->GetWNDC();
334 wh *=
gPad->GetHNDC();
339 yrange = xrange*ratio;
340 if (yrange >
fXsize) { yrange =
fXsize; xrange = yrange/ratio;}
344 if (yrange >
fYsize) { yrange =
fYsize; xrange = yrange/ratio;}
361 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
425 Error(
"Close",
"Cannot open temporary file: %s", tmpname.
Data());
435 FILE *sg = fopen(tmpname.
Data(),
"r");
437 Error(
"Close",
"Cannot open file: %s", tmpname.
Data());
441 while (fgets(
line, 255, sg)) {
442 if (strstr(
line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
469 Error(
"On",
"no postscript file open");
539 PrintStr(
" NBBD NBB eq {exit} if");
545 PrintStr(
" /IX IX 1 add def} def");
555 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
566 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
570 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
571 PrintStr(
" /YY YY HT sub def clear} def");
632 Error(
"DrawImage",
"Fail to access ARGB values");
639 auto x1 =
gPad->AbsPixeltoX(
x);
641 auto y1 =
gPad->AbsPixeltoY(
y);
674 PrintStr(
" NBBD NBB eq {exit} if");
680 PrintStr(
" /IX IX 1 add def} def");
690 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
701 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
705 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
706 PrintStr(
" /YY YY HT sub def clear} def");
713 auto r =
static_cast<unsigned char>((
p >> 16) & 0xFF);
714 auto g =
static_cast<unsigned char>((
p >> 8) & 0xFF);
715 auto b =
static_cast<unsigned char>(
p & 0xFF);
735 if (fillis == 3 || fillis == 2) {
743 if (fillsi > 0 && fillsi < 26) {
790 Int_t xps[7], yps[7];
791 Int_t i, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
796 Int_t bordPS = 4*border;
798 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
799 xps[2] = xps[1]; yps[2] =
YtoPS(yt) - bordPS;
800 xps[3] =
XtoPS(xt) - bordPS; yps[3] = yps[2];
802 xps[5] = xps[0]; yps[5] = yps[4];
803 xps[6] = xps[0]; yps[6] = yps[0];
821 if( idx ) {
MovePS(idx,0); idx = 0; }
822 if( idy ) {
MovePS(0,idy); idy = 0; }
827 if( idy ) {
MovePS(0,idy); idy = 0; }
828 if( !idx ) { idx = ix;
continue;}
829 if( ix*idx > 0 ) idx += ix;
830 else {
MovePS(idx,0); idx = ix; }
834 if( idx ) {
MovePS(idx,0); idx = 0; }
835 if( !idy) { idy = iy;
continue;}
836 if( iy*idy > 0 ) idy += iy;
837 else {
MovePS(0,idy); idy = iy; }
848 xps[1] = xps[0] + bordPS; yps[1] = yps[0] + bordPS;
849 xps[2] =
XtoPS(xt) - bordPS; yps[2] = yps[1];
850 xps[3] = xps[2]; yps[3] =
YtoPS(yt) - bordPS;
852 xps[5] = xps[4]; yps[5] = yps[0];
853 xps[6] = xps[0]; yps[6] = yps[0];
871 if( idx ) {
MovePS(idx,0); idx = 0; }
872 if( idy ) {
MovePS(0,idy); idy = 0; }
877 if( idy ) {
MovePS(0,idy); idy = 0; }
878 if( !idx ) { idx = ix;
continue;}
879 if( ix*idx > 0 ) idx += ix;
880 else {
MovePS(idx,0); idx = ix; }
884 if( idx ) {
MovePS(idx,0); idx = 0; }
885 if( !idy) { idy = iy;
continue;}
886 if( iy*idy > 0 ) idy += iy;
887 else {
MovePS(0,idy); idy = iy; }
907 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
928 if(
n == 0)
goto END;
944 if( idx ) {
MovePS(idx,0); idx = 0; }
945 if( idy ) {
MovePS(0,idy); idy = 0; }
950 if( idy ) {
MovePS(0,idy); idy = 0; }
951 if( !idx ) { idx = ix;
continue;}
952 if( ix*idx > 0 ) idx += ix;
953 else {
MovePS(idx,0); idx = ix; }
957 if( idx ) {
MovePS(idx,0); idx = 0; }
958 if( !idy) { idy = iy;
continue;}
959 if( iy*idy > 0 ) idy += iy;
960 else {
MovePS(0,idy); idy = iy; }
991 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy;
1012 if(
n == 0)
goto END;
1028 if( idx ) {
MovePS(idx,0); idx = 0; }
1029 if( idy ) {
MovePS(0,idy); idy = 0; }
1034 if( idy ) {
MovePS(0,idy); idy = 0; }
1035 if( !idx ) { idx = ix;
continue;}
1036 if( ix*idx > 0 ) idx += ix;
1037 else {
MovePS(idx,0); idx = ix; }
1041 if( idx ) {
MovePS(idx,0); idx = 0; }
1042 if( !idy) { idy = iy;
continue;}
1043 if( iy*idy > 0 ) idy += iy;
1044 else {
MovePS(0,idy); idy = iy; }
1078 Int_t markerSize = 0;
1079 std::vector<TPoint>
points;
1093 PrintStr(
" { gsave translate newpath");
1110 for (std::size_t i = 0; i <
points.size(); ++i) {
1113 PrintStr(i == 0 ?
" moveto" :
" lineto");
1123 for (std::size_t i = 0; i <
points.size(); ++i) {
1126 PrintStr(i % 2 == 0 ?
" moveto" :
" lineto stroke");
1130 for (std::size_t i = 0; i <
points.size(); ++i) {
1133 PrintStr(i % 3 == 0 ?
" moveto" :
" lineto");
1144 SetWidth((markerLineWidth > 1) ? markerLineWidth : 1);
1147 for (
Int_t k = 0; k <
n; ++k) {
1165 DrawPolyMarkerShape<Float_t>(
n,
x,
y);
1173 DrawPolyMarkerShape<Double_t>(
n,
x,
y);
1188 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1189 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1190 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1191 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1192 180, 90,135, 45,150, 30,120, 60,
1193 180, 90,135, 45,150, 30,120, 60};
1194 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1195 fais = fasi =
n = 0;
1215 if (fais == 3 || fais == 2) {
1216 if (fasi > 100 && fasi <125) {
1217 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1220 if (fasi > 0 && fasi < 26) {
1231 if(
n == 0)
goto END;
1239 ixdi =
XtoPS(xw[i]);
1240 iydi =
YtoPS(yw[i]);
1246 if( idx ) {
MovePS(idx,0); idx = 0; }
1247 if( idy ) {
MovePS(0,idy); idy = 0; }
1250 if( idy ) {
MovePS(0,idy); idy = 0;}
1251 if( !idx ) { idx = ix;}
1253 else {
MovePS(idx,0); idx = ix;}
1255 if( idx ) {
MovePS(idx,0); idx = 0;}
1256 if( !idy) { idy = iy;}
1258 else {
MovePS(0,idy); idy = iy;}
1265 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1268 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1269 if (fais == 3 || fais == 2) {
1270 if (fasi > 0 && fasi < 26) {
1299 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1300 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1301 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1302 static Float_t anglehatch[24] = {180, 90,135, 45,150, 30,120, 60,
1303 180, 90,135, 45,150, 30,120, 60,
1304 180, 90,135, 45,150, 30,120, 60};
1305 Int_t i,
n, ixd0, iyd0, idx, idy, ixdi, iydi, ix, iy, fais, fasi;
1306 fais = fasi =
n = 0;
1326 if (fais == 3 || fais == 2) {
1327 if (fasi > 100 && fasi <125) {
1328 DrawHatch(dyhatch[fasi-101],anglehatch[fasi-101],
n, xw, yw);
1331 if (fasi > 0 && fasi < 26) {
1342 if(
n == 0)
goto END;
1350 ixdi =
XtoPS(xw[i]);
1351 iydi =
YtoPS(yw[i]);
1357 if( idx ) {
MovePS(idx,0); idx = 0; }
1358 if( idy ) {
MovePS(0,idy); idy = 0; }
1361 if( idy ) {
MovePS(0,idy); idy = 0;}
1362 if( !idx ) { idx = ix;}
1364 else {
MovePS(idx,0); idx = ix;}
1366 if( idx ) {
MovePS(idx,0); idx = 0;}
1367 if( !idy) { idy = iy;}
1369 else {
MovePS(0,idy); idy = iy;}
1376 if (xw[0] == xw[
n-1] && yw[0] == yw[
n-1])
PrintFast(3,
" cl");
1379 if (fais == 0) {
PrintFast(5,
" cl s");
goto END;}
1380 if (fais == 3 || fais == 2) {
1381 if (fasi > 0 && fasi < 26) {
1403 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1411 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1418 std::ifstream font_file(
filename, std::ios::binary);
1422 font_file.seekg(0, std::ios::end);
1424 const size_t font_file_length = font_file.tellg();
1426 font_file.seekg(0, std::ios::beg);
1428 std::vector<unsigned char> font_data(font_file_length,
'\0');
1430 font_file.read(
reinterpret_cast<char *
>(&font_data[0]),
1433 std::string font_name;
1434 std::string postscript_string =
1435 mathtext::font_embed_postscript_t::font_embed_type_1(
1436 font_name, font_data);
1438 if (!postscript_string.empty()) {
1439 PrintRaw(postscript_string.size(), postscript_string.data());
1452 std::ifstream font_file(
filename, std::ios::binary);
1456 font_file.seekg(0, std::ios::end);
1458 const size_t font_file_length = font_file.tellg();
1460 font_file.seekg(0, std::ios::beg);
1462 std::vector<unsigned char> font_data(font_file_length,
'\0');
1464 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1466 std::string font_name;
1467 std::string postscript_string =
1468 mathtext::font_embed_postscript_t::font_embed_type_2(font_name, font_data);
1470 if (!postscript_string.empty()) {
1471 PrintRaw(postscript_string.size(), postscript_string.data());
1484 std::ifstream font_file(
filename, std::ios::binary);
1488 font_file.seekg(0, std::ios::end);
1490 const size_t font_file_length = font_file.tellg();
1492 font_file.seekg(0, std::ios::beg);
1494 std::vector<unsigned char> font_data(font_file_length,
'\0');
1496 font_file.read(
reinterpret_cast<char *
>(&font_data[0]), font_file_length);
1498 std::string font_name;
1499 std::string postscript_string =
1500 mathtext::font_embed_postscript_t::font_embed_type_42(font_name, font_data);
1502 if (!postscript_string.empty()) {
1503 PrintRaw(postscript_string.size(), postscript_string.data());
1508 fprintf(stderr,
"%s:%d:\n", __FILE__, __LINE__);
1518 static const char *fonttable[32][2] = {
1519 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1520 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1521 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1522 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1523 {
"Root.TTFont.4",
"FreeSans.otf" },
1524 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1525 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1526 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1527 {
"Root.TTFont.8",
"FreeMono.otf" },
1528 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1529 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1530 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1531 {
"Root.TTFont.12",
"symbol.ttf" },
1532 {
"Root.TTFont.13",
"FreeSerif.otf" },
1533 {
"Root.TTFont.14",
"wingding.ttf" },
1534 {
"Root.TTFont.15",
"symbol.ttf" },
1535 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1536 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1537 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1538 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1539 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1540 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1541 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1542 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1543 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1544 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1545 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1546 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1547 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1548 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1549 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1550 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1553 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1559 for (
Int_t fontid = 1; fontid < 30; fontid++) {
1565 "font %d (filename '%s') not found in path",
1575 "failed to embed font %d (filename '%s')",
1580 PrintStr(
"%%IncludeResource: font Times-Roman@");
1581 PrintStr(
"%%IncludeResource: font Times-Italic@");
1582 PrintStr(
"%%IncludeResource: font Times-Bold@");
1583 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1584 PrintStr(
"%%IncludeResource: font Helvetica@");
1585 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1586 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1587 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1588 PrintStr(
"%%IncludeResource: font Courier@");
1589 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1590 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1591 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1592 PrintStr(
"%%IncludeResource: font Symbol@");
1593 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1605 PrintStr(
" dup length dict begin");
1612 PrintStr(
" dup /FontName get exch");
1615 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1616 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1617 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1618 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1619 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1620 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1621 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1622 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1623 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1624 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1625 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1666 rpxmin = rpymin =
width = heigth = 0;
1678 if( fMode <= 0 || fMode > 5) {
1679 Error(
"Initialize",
"invalid file type %d",
fMode);
1701 if (
gPad && !pstitle[0]) pstitle =
gPad->GetMother()->GetTitle();
1703 if(!pstitle[0] &&
fMode != 3) {;
1719 if (!strchr(pstitle,
'\n')) {
1726 PrintFast(24,
"%%Creator: ROOT Version ");
1735 PrintStr(
"%%Orientation: Portrait@");
1737 PrintStr(
"%%Orientation: Landscape@");
1746 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1747 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1748 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1750 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1752 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1754 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1755 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1756 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1757 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@");
1758 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1759 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def@");
1769 width = (8.5*2.54)-2.*rpxmin;
1770 heigth = (11.*2.54)-2.*rpymin;
1773 width = (8.5*2.54)-2.*rpxmin;
1774 heigth = (14.*2.54)-2.*rpymin;
1777 width = (11.*2.54)-2.*rpxmin;
1778 heigth = (17.*2.54)-2.*rpymin;
1781 width = 21.0-2.*rpxmin;
1782 heigth = 29.7-2.*rpymin;
1792 width = (11.*2.54)-2.*rpxmin;
1793 heigth = (8.5*2.54)-2.*rpymin;
1796 width = (14.*2.54)-2.*rpxmin;
1797 heigth = (8.5*2.54)-2.*rpymin;
1800 width = (17.*2.54)-2.*rpxmin;
1801 heigth = (11.*2.54)-2.*rpymin;
1804 width = 29.7-2.*rpxmin;
1805 heigth = 21-2.*rpymin;
1824 width = (8.5*2.54)-2.*rpxmin;
1825 heigth = (11.*2.54)-2.*rpymin;
1828 width = (8.5*2.54)-2.*rpxmin;
1829 heigth = (14.*2.54)-2.*rpymin;
1832 width = (11.*2.54)-2.*rpxmin;
1833 heigth = (17.*2.54)-2.*rpymin;
1836 width = (21.0-2*rpxmin);
1837 heigth = (29.7-2.*rpymin);
1847 width = (11.*2.54)-2.*rpxmin;
1848 heigth = (8.5*2.54)-2.*rpymin;
1851 width = (14.*2.54)-2.*rpxmin;
1852 heigth = (8.5*2.54)-2.*rpymin;
1855 width = (17.*2.54)-2.*rpxmin;
1856 heigth = (11.*2.54)-2.*rpymin;
1859 width = (29.7-2*rpxmin);
1860 heigth = (21-2.*rpymin);
1881 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
1933 if (ix != 0 && iy != 0) {
1937 }
else if (ix != 0) {
1940 }
else if (iy != 0) {
1962 Double_t xlow=0, ylow=0, xup=1, yup=1;
1964 xlow =
gPad->GetAbsXlowNDC();
1965 xup = xlow +
gPad->GetAbsWNDC();
1966 ylow =
gPad->GetAbsYlowNDC();
1967 yup = ylow +
gPad->GetAbsHNDC();
1991 Float_t xps=0, yps=0, xncm=0, yncm=0, dxwn=0, dywn=0, xwkwn=0, ywkwn=0, xymax=0;
1996 else { xps = xsize; yps = ysize; }
1998 if( xsize <= xps && ysize < yps) {
1999 if ( xps > yps ) xymax = xps;
2003 dxwn = ((xps/xymax)-xncm)/2;
2004 dywn = ((yps/xymax)-yncm)/2;
2006 if (xps/yps < 1) xwkwn = xps/yps;
2008 if (yps/xps < 1) ywkwn = yps/xps;
2011 if (xsize < ysize) {
2012 xncm = ywkwn*xsize/ysize;
2014 dxwn = (xwkwn-xncm)/2;
2019 yncm = xwkwn*ysize/xsize;
2020 dywn = (ywkwn-yncm)/2;
2024 yncm = xwkwn*ysize/xsize;
2026 dywn = (ywkwn-yncm)/2;
2030 xncm = ywkwn*xsize/ysize;
2031 dxwn = (xwkwn-xncm)/2;
2081 snprintf(cpat,5,
" P%2.2d", ipat);
2095 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2100 PrintStr(
" /PaintProc { begin gsave");
2101 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2102 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2103 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2108 PrintStr(
" /PaintProc { begin gsave");
2109 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2110 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2111 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2116 PrintStr(
" /PaintProc { begin gsave");
2117 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2118 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2119 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2122 PrintStr(
" /BBox [ 0 0 100 100 ]");
2123 PrintStr(
" /XStep 100 /YStep 100");
2124 PrintStr(
" /PaintProc { begin gsave");
2126 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2129 PrintStr(
" /BBox [ 0 0 100 100 ]");
2130 PrintStr(
" /XStep 100 /YStep 100");
2131 PrintStr(
" /PaintProc { begin gsave");
2133 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2136 PrintStr(
" /BBox [ 0 0 100 100 ]");
2137 PrintStr(
" /XStep 100 /YStep 100");
2138 PrintStr(
" /PaintProc { begin gsave");
2140 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2143 PrintStr(
" /BBox [ 0 0 100 100 ]");
2144 PrintStr(
" /XStep 100 /YStep 100");
2145 PrintStr(
" /PaintProc { begin gsave");
2147 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2150 PrintStr(
" /BBox [ 0 0 101 101 ]");
2151 PrintStr(
" /XStep 100 /YStep 100");
2152 PrintStr(
" /PaintProc { begin gsave");
2153 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2154 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2155 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2156 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2157 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2158 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2161 PrintStr(
" /BBox [ 0 0 100 100 ]");
2162 PrintStr(
" /XStep 100 /YStep 100");
2163 PrintStr(
" /PaintProc { begin gsave");
2164 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2165 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2166 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2167 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2170 PrintStr(
" /BBox [ 0 0 100 100 ]");
2171 PrintStr(
" /XStep 100 /YStep 100");
2172 PrintStr(
" /PaintProc { begin gsave");
2173 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2174 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2176 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2179 PrintStr(
" /BBox [ 0 0 100 100 ]");
2180 PrintStr(
" /XStep 100 /YStep 100");
2181 PrintStr(
" /PaintProc { begin gsave");
2182 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2183 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2184 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2185 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2186 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2187 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2188 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2189 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2190 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2191 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2192 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2195 PrintStr(
" /BBox [ 0 0 100 100 ]");
2196 PrintStr(
" /XStep 100 /YStep 100");
2197 PrintStr(
" /PaintProc { begin gsave");
2198 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2199 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2200 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2201 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2202 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2203 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2204 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2205 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2206 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2209 PrintStr(
" /BBox [ 0 0 100 100 ]");
2210 PrintStr(
" /XStep 100 /YStep 100");
2211 PrintStr(
" /PaintProc { begin gsave");
2212 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2213 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2216 PrintStr(
" /BBox [ 0 0 100 100 ]");
2218 PrintStr(
" /PaintProc { begin gsave");
2219 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2220 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2221 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2222 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2223 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2228 PrintStr(
" /PaintProc { begin gsave");
2229 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2230 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2231 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2232 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2233 PrintStr(
" 50 30 m 45 30 5 0 360");
2234 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2235 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2236 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2237 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2240 PrintStr(
" /BBox [ 0 0 100 100 ]");
2241 PrintStr(
" /XStep 100 /YStep 100");
2242 PrintStr(
" /PaintProc { begin gsave");
2243 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2244 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2245 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2248 PrintStr(
" /BBox [ 0 0 100 100 ]");
2249 PrintStr(
" /XStep 100 /YStep 100");
2250 PrintStr(
" /PaintProc { begin gsave");
2251 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2252 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2255 PrintStr(
" /BBox [ 0 0 100 100 ]");
2256 PrintStr(
" /XStep 100 /YStep 100");
2257 PrintStr(
" /PaintProc { begin gsave");
2258 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2259 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2262 PrintStr(
" /BBox [ 0 0 100 100 ]");
2263 PrintStr(
" /XStep 100 /YStep 100");
2264 PrintStr(
" /PaintProc { begin gsave");
2265 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2266 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2267 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2268 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2269 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2270 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2273 PrintStr(
" /BBox [ 0 0 100 100 ]");
2274 PrintStr(
" /XStep 100 /YStep 100");
2275 PrintStr(
" /PaintProc { begin gsave");
2276 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2277 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2278 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2281 PrintStr(
" /BBox [ 0 0 101 101 ]");
2282 PrintStr(
" /XStep 100 /YStep 100");
2283 PrintStr(
" /PaintProc { begin gsave");
2284 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2285 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2286 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2287 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2288 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2291 PrintStr(
" /BBox [ 0 0 101 101 ]");
2292 PrintStr(
" /XStep 100 /YStep 100");
2293 PrintStr(
" /PaintProc { begin gsave");
2294 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2295 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2296 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2297 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2298 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2301 PrintStr(
" /BBox [ 0 0 100 100 ]");
2302 PrintStr(
" /XStep 100 /YStep 100");
2303 PrintStr(
" /PaintProc { begin gsave");
2304 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2305 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2306 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
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(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2314 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2315 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2316 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2317 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2318 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2319 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2320 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2321 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2322 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2323 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2324 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2325 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2328 PrintStr(
" /BBox [ 0 0 101 101 ]");
2329 PrintStr(
" /XStep 100 /YStep 100");
2330 PrintStr(
" /PaintProc { begin gsave");
2331 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2332 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2333 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2335 snprintf(cdef,28,
" makepattern /%s exch def",&cpat[1]);
2343 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2344 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2346 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2347 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2367 Double_t colCyan = (1-colRed-colBlack)/(1-colBlack);
2368 Double_t colMagenta = (1-colGreen-colBlack)/(1-colBlack);
2369 Double_t colYellow = (1-colBlue-colBlack)/(1-colBlack);
2462 if (linestyle ==
fStyle)
return;
2468 Int_t nch = strlen(st);
2487 if (linewidth ==
fWidth)
return;
2510 if (color < 0) color = 0;
2566 static const char *psfont[31][2] = {
2567 {
"Root.PSFont.1",
"/Times-Italic" },
2568 {
"Root.PSFont.2",
"/Times-Bold" },
2569 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2570 {
"Root.PSFont.4",
"/Helvetica" },
2571 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2572 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2573 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2574 {
"Root.PSFont.8",
"/Courier" },
2575 {
"Root.PSFont.9",
"/Courier-Oblique" },
2576 {
"Root.PSFont.10",
"/Courier-Bold" },
2577 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2578 {
"Root.PSFont.12",
"/Symbol" },
2579 {
"Root.PSFont.13",
"/Times-Roman" },
2580 {
"Root.PSFont.14",
"/ZapfDingbats" },
2581 {
"Root.PSFont.15",
"/Symbol" },
2582 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2583 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2584 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2585 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2586 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2587 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2588 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2589 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2590 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2591 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2592 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2593 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2594 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2595 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2596 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2597 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2610 if (wh <= 0 || hh <= 0)
2617 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2621 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2623 Double_t fontsize = 4*(72*(ftsize)/2.54);
2624 if( fontsize <= 0)
return;
2630 if( font > 31 || font < 1) font = 1;
2637 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2639 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2643 }
else if (txalv == 2) {
2657 saveAttText.TAttText::operator=(*this);
2659 Int_t *charWidthsCumul =
nullptr;
2665 t.TAttText::Modify();
2671 for (
Int_t i =
len - 1;i >= 0;i--) {
2679 saveAttText.TAttText::Modify();
2723 for (
Int_t i =
len-1; i >= 1; i--) {
2726 delete [] charWidthsCumul;
2739 if (chars[i]!=
'\n') {
2740 if (chars[i]==
'(' || chars[i]==
')' || chars[i]==
'\\') {
2741 snprintf(str,8,
"\\%c",chars[i]);
2743 }
else if ((chars[i]==
'-') && (font != 12)) {
2746 snprintf(str,8,
"%c",chars[i]);
2758 if (font != 15)
PrintStr(
" show NC");
2773 static const char *psfont[31][2] = {
2774 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2775 {
"Root.PSFont.2",
"/FreeSerifBold" },
2776 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2777 {
"Root.PSFont.4",
"/FreeSans" },
2778 {
"Root.PSFont.5",
"/FreeSansOblique" },
2779 {
"Root.PSFont.6",
"/FreeSansBold" },
2780 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2781 {
"Root.PSFont.8",
"/FreeMono" },
2782 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2783 {
"Root.PSFont.10",
"/FreeMonoBold" },
2784 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2785 {
"Root.PSFont.12",
"/SymbolMT" },
2786 {
"Root.PSFont.13",
"/FreeSerif" },
2787 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2788 {
"Root.PSFont.15",
"/SymbolMT" },
2789 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2790 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2791 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2792 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2793 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2794 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2795 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2796 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2797 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2798 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2799 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2800 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2801 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2802 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2803 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2804 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2825 ftsize = (sizeTTF*
fXsize*
gPad->GetAbsWNDC())/wh;
2829 ftsize = (sizeTTF*
fYsize*
gPad->GetAbsHNDC())/hh;
2831 Double_t fontsize = 4*(72*(ftsize)/2.54);
2832 if(fontsize <= 0)
return;
2838 if( font > 29 || font < 1) font = 1;
2845 if (txalh <1) txalh = 1;
else if (txalh > 3) txalh = 3;
2847 if (txalv <1) txalv = 1;
else if (txalv > 3) txalv = 3;
2851 }
else if (txalv == 2) {
2898 const wchar_t *lower = std::lower_bound(
2902 *lower == chars[i]) {
2904 const unsigned long index =
2908 else if((
unsigned int)chars[i] < 0xffff) {
2911 (
unsigned int)chars[i]));
2916 (
unsigned int)chars[i]));
2966 return Int_t(0.5 + 288*cm/2.54);
2975 return Int_t(0.5 + 288*cm/2.54);
static const wchar_t adobe_glyph_ucs[nadobe_glyph]
static const unsigned long nadobe_glyph
static const char * adobe_glyph_name[nadobe_glyph]
short Style_t
Style number (short)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
short Width_t
Line width (short)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t SetLineWidth
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualPS * gVirtualPS
virtual Color_t GetFillColor() const
Return the fill area color.
Style_t fFillStyle
Fill area style.
Color_t fFillColor
Fill area color.
virtual Width_t GetLineWidth() const
Return the line width.
Width_t fLineWidth
Line width.
virtual Style_t GetLineStyle() const
Return the line style.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Color_t GetMarkerColor() const
Return the marker color.
Color_t fMarkerColor
Marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
EMarkerShape GetMarkerShape(Int_t &sz, std::vector< TPoint > &points, Float_t scale=1., UInt_t flags=0) const
Return marker shape.
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
Color_t fTextColor
Text color.
Float_t fTextAngle
Text angle.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Font_t fTextFont
Text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Short_t fTextAlign
Text alignment.
Float_t fTextSize
Text size.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
An abstract interface to image processing library.
virtual UInt_t * GetArgbArray()
virtual UInt_t GetWidth() const
virtual UInt_t GetHeight() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
2-D graphics point (world coordinates).
Float_t fXsize
Page size along X.
Int_t fIYzone
Current zone along Y.
Int_t fType
PostScript workstation type.
void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override
Draw markers at the n WC points x, y.
TPostScript()
Default PostScript constructor.
Int_t VtoPS(Double_t v)
Convert V from NDC coordinate to PostScript.
void CellArrayEnd() override
End the Cell Array painting.
static Int_t fgLineCap
Appearance of line caps.
void SetMarkerColor(Color_t cindex=1) override
Set color index for markers.
Int_t fNBSameColorCell
Number of boxes with the same color.
void DrawPolyMarkerShape(Int_t n, T *x, T *y)
Draw markers at the n WC points x, y.
void SetColor(Int_t color=1)
Set the current color.
Int_t fMode
PostScript mode.
Int_t fIXzone
Current zone along X.
void DrawPolyLineNDC(Int_t n, TPoints *uv)
Draw a PolyLine in NDC space.
void FontEncode()
Font Re-encoding.
Int_t fLastCellBlue
Last blue value.
Int_t fNbCellW
Number of boxes per line.
Float_t fWidth
Current line width.
Float_t fRed
Per cent of red.
void DrawPS(Int_t n, Float_t *xw, Float_t *yw) override
Draw a PolyLine.
Bool_t fClipStatus
Clipping Indicator.
Float_t fLineScale
Line width scale factor.
Float_t fMarkerSizeCur
current transformed value of marker size
Bool_t fZone
Zone indicator.
void Open(const char *filename, Int_t type=-111) override
Open a PostScript file.
void SetFillPatterns(Int_t ipat, Int_t color)
Patterns definition.
Int_t fLastCellRed
Last red value.
void SetLineWidth(Width_t linewidth=1) override
Change the line width.
void Off()
Deactivate an already open PostScript file.
Int_t YtoPS(Double_t y)
Convert Y from world coordinate to PostScript.
Bool_t fRange
True when a range has been defined.
Float_t fBlue
Per cent of blue.
void Text(Double_t x, Double_t y, const char *string) override
Write a string of characters.
void MovePS(Int_t x, Int_t y)
Move to a new position.
void Initialize()
PostScript Initialisation.
bool FontEmbedType2(const char *filename)
Int_t fNbCellLine
Number of boxes in the current line.
Float_t fMaxsize
Largest dimension of X and Y.
void SetStyle(Style_t linestyle=1)
Change the line style in the output file.
void SetFillColor(Color_t cindex=1) override
Set color index for fill areas.
Int_t fClip
Clipping mode.
TString fFileName
PS file name.
Int_t fNYzone
Number of zones along Y.
bool FontEmbedType1(const char *filename)
Float_t fGreen
Per cent of green.
void SetLineColor(Color_t cindex=1) override
Set color index for lines.
void SetLineStyle(Style_t linestyle=1) override
Change the line style.
void SetLineCap(Int_t linecap=0)
Set the value of the global parameter TPostScript::fgLineCap.
void NewPage() override
Move to a new PostScript page.
void DrawPolyLine(Int_t n, TPoints *xy)
Draw a PolyLine.
void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Draw a Box.
void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t *x, Float_t *y)
Draw Fill area with hatch styles.
Int_t UtoPS(Double_t u)
Convert U from NDC coordinate to PostScript.
Bool_t fFontEmbed
True is FontEmbed has been called.
void SetWidth(Width_t linewidth=1)
Change the line width in the output file.
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) override
Draw a Frame around a box.
Int_t fSave
Number of gsave for restore.
Int_t fStyle
Current line style.
void CellArrayFill(Int_t r, Int_t g, Int_t b) override
Paint the Cell Array.
void SetTextColor(Color_t cindex=1) override
Set color index for text.
void On()
Activate an already open PostScript file.
bool FontEmbedType42(const char *filename)
void DrawImage(TImage *img, Int_t x, Int_t y, Int_t flags=0) override
Draw image in postscript.
void TextNDC(Double_t u, Double_t v, const char *string)
Write a string of characters in NDC.
Int_t fNXzone
Number of zones along X.
void TextUrl(Double_t x, Double_t y, const char *string, const char *url) override
Draw text with URL.
void SetLineScale(Float_t scale=3)
Bool_t fBoundingBox
True for Encapsulated PostScript.
Int_t XtoPS(Double_t x)
Convert X from world coordinate to PostScript.
~TPostScript() override
Default PostScript destructor.
char fPatterns[32]
Indicate if pattern n is defined.
Int_t fNbinCT
Number of entries in the current Cell Array.
static Int_t fgLineJoin
Appearance of joining lines.
std::map< std::string, bool > fMarkers
! array of already defined markers
Int_t fLastCellGreen
Last green value.
void SaveRestore(Int_t flag)
Compute number of gsaves for restore This allows to write the correct number of grestore at the end o...
Bool_t fClear
True when page must be cleared.
Int_t fMaxLines
Maximum number of lines in a PS array.
void Zone()
Initialize the PostScript page in zones.
void SetLineJoin(Int_t linejoin=0)
Set the value of the global parameter TPostScript::fgLineJoin.
void Range(Float_t xrange, Float_t yrange)
Set the range for the paper in centimeters.
void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override
Draw a Cell Array.
void FontEmbed()
Embed font in PS file.
void Close(Option_t *opt="") override
Close a PostScript file.
Bool_t fMustEmbed[29]
flag to embed font
Int_t fNpages
number of pages
Float_t fYsize
Page size along Y.
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Int_t GetJoinLinePS() const
Returns the line join method used for PostScript, PDF and SVG output. See TPostScript::SetLineJoin fo...
Int_t GetColorModelPS() const
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
const char * GetTitlePS() const
Int_t GetCapLinePS() const
Returns the line cap method used for PostScript, PDF and SVG output. See TPostScript::SetLineCap for ...
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
const char * GetHeaderPS() const
Float_t GetLineScalePS() const
virtual int GetPid()
Get process id.
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual int Unlink(const char *name)
Unlink, i.e.
Base class for several text objects.
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
virtual void GetTextAdvance(UInt_t &a, const char *text, const Bool_t kern=kTRUE) const
Return text advance for string text if kern is true (default) kerning is taken into account.
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
virtual void PrintRaw(Int_t len, const char *str)
Print a raw.
void CloseStream()
Close existing stream.
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
virtual void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
Bool_t OpenStream(const char *fname, Bool_t binary=kFALSE)
Open output stream.
void ClearBuffer()
Clear content of internal buffer.
const char * fImplicitCREsc
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.