229#pragma optimize("",off)
254#include "../../../builtins/mathtext/inc/fontembed.h"
269 for (
Int_t i = 0; i < 32; i++)
271 for (
Int_t i = 0; i < 29; i++)
292 for (
Int_t i = 0; i < 32; i++)
294 for (
Int_t i = 0; i < 29; i++)
307 Warning(
"Open",
"postscript file already open");
332 ww *=
gPad->GetWNDC();
360 PrintStr(
"%!PS-Adobe-2.0 EPSF-2.0@");
424 Error(
"Close",
"Cannot open temporary file: %s",
tmpname.Data());
441 if (
strstr(
line,
"EndComments"))
PrintStr(
"%%DocumentNeededResources: ProcSet (FontSetInit)@");
468 Error(
"On",
"no postscript file open");
538 PrintStr(
" NBBD NBB eq {exit} if");
544 PrintStr(
" /IX IX 1 add def} def");
554 PrintStr(
" /RC 0 def /GC 1 def /BC 2 def");
565 PrintStr(
"{CT RC get 255 div CT GC get 255 div CT BC get 255 div setrgbcolor");
569 PrintStr(
" /BC BC 3 add def} ifelse NBBD NBB eq {exit} if} for");
570 PrintStr(
" /YY YY HT sub def clear} def");
724 if( idx ) {
MovePS(idx,0); idx = 0; }
731 if( !idx ) { idx = ix;
continue;}
732 if( ix*idx > 0 ) idx += ix;
733 else {
MovePS(idx,0); idx = ix; }
737 if( idx ) {
MovePS(idx,0); idx = 0; }
738 if( !
idy) {
idy = iy;
continue;}
739 if( iy*
idy > 0 )
idy += iy;
774 if( idx ) {
MovePS(idx,0); idx = 0; }
781 if( !idx ) { idx = ix;
continue;}
782 if( ix*idx > 0 ) idx += ix;
783 else {
MovePS(idx,0); idx = ix; }
787 if( idx ) {
MovePS(idx,0); idx = 0; }
788 if( !
idy) {
idy = iy;
continue;}
789 if( iy*
idy > 0 )
idy += iy;
831 if(
n == 0)
goto END;
847 if( idx ) {
MovePS(idx,0); idx = 0; }
854 if( !idx ) { idx = ix;
continue;}
855 if( ix*idx > 0 ) idx += ix;
856 else {
MovePS(idx,0); idx = ix; }
860 if( idx ) {
MovePS(idx,0); idx = 0; }
861 if( !
idy) {
idy = iy;
continue;}
862 if( iy*
idy > 0 )
idy += iy;
915 if(
n == 0)
goto END;
931 if( idx ) {
MovePS(idx,0); idx = 0; }
938 if( !idx ) { idx = ix;
continue;}
939 if( ix*idx > 0 ) idx += ix;
940 else {
MovePS(idx,0); idx = ix; }
944 if( idx ) {
MovePS(idx,0); idx = 0; }
945 if( !
idy) {
idy = iy;
continue;}
946 if( iy*
idy > 0 )
idy += iy;
981 Int_t markerSize = 0;
982 std::vector<TPoint>
points;
996 PrintStr(
" { gsave translate newpath");
1013 for (std::size_t i = 0; i <
points.size(); ++i) {
1016 PrintStr(i == 0 ?
" moveto" :
" lineto");
1026 for (std::size_t i = 0; i <
points.size(); ++i) {
1029 PrintStr(i % 2 == 0 ?
" moveto" :
" lineto stroke");
1033 for (std::size_t i = 0; i <
points.size(); ++i) {
1036 PrintStr(i % 3 == 0 ?
" moveto" :
" lineto");
1047 SetWidth((markerLineWidth > 1) ? markerLineWidth : 1);
1050 for (
Int_t k = 0; k <
n; ++k) {
1091 static Float_t dyhatch[24] = {.0075,.0075,.0075,.0075,.0075,.0075,.0075,.0075,
1092 .01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,.01 ,
1093 .015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015 ,.015};
1095 180, 90,135, 45,150, 30,120, 60,
1096 180, 90,135, 45,150, 30,120, 60};
1097 Int_t i,
n,
ixd0,
iyd0, idx,
idy,
ixdi,
iydi, ix, iy,
fais,
fasi;
1134 if(
n == 0)
goto END;
1149 if( idx ) {
MovePS(idx,0); idx = 0; }
1154 if( !idx ) { idx = ix;}
1156 else {
MovePS(idx,0); idx = ix;}
1158 if( idx ) {
MovePS(idx,0); idx = 0;}
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};
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;
1245 if(
n == 0)
goto END;
1260 if( idx ) {
MovePS(idx,0); idx = 0; }
1265 if( !idx ) { idx = ix;}
1267 else {
MovePS(idx,0); idx = ix;}
1269 if( idx ) {
MovePS(idx,0); idx = 0;}
1306 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1314 Warning(
"DrawHatch",
"hatch fill style not yet implemented");
1336 std::string font_name;
1338 mathtext::font_embed_postscript_t::font_embed_type_1(
1369 std::string font_name;
1371 mathtext::font_embed_postscript_t::font_embed_type_2(font_name,
font_data);
1401 std::string font_name;
1403 mathtext::font_embed_postscript_t::font_embed_type_42(font_name,
font_data);
1422 {
"Root.TTFont.0",
"FreeSansBold.otf" },
1423 {
"Root.TTFont.1",
"FreeSerifItalic.otf" },
1424 {
"Root.TTFont.2",
"FreeSerifBold.otf" },
1425 {
"Root.TTFont.3",
"FreeSerifBoldItalic.otf" },
1426 {
"Root.TTFont.4",
"FreeSans.otf" },
1427 {
"Root.TTFont.5",
"FreeSansOblique.otf" },
1428 {
"Root.TTFont.6",
"FreeSansBold.otf" },
1429 {
"Root.TTFont.7",
"FreeSansBoldOblique.otf" },
1430 {
"Root.TTFont.8",
"FreeMono.otf" },
1431 {
"Root.TTFont.9",
"FreeMonoOblique.otf" },
1432 {
"Root.TTFont.10",
"FreeMonoBold.otf" },
1433 {
"Root.TTFont.11",
"FreeMonoBoldOblique.otf" },
1434 {
"Root.TTFont.12",
"symbol.ttf" },
1435 {
"Root.TTFont.13",
"FreeSerif.otf" },
1436 {
"Root.TTFont.14",
"wingding.ttf" },
1437 {
"Root.TTFont.15",
"symbol.ttf" },
1438 {
"Root.TTFont.STIXGen",
"STIXGeneral.otf" },
1439 {
"Root.TTFont.STIXGenIt",
"STIXGeneralItalic.otf" },
1440 {
"Root.TTFont.STIXGenBd",
"STIXGeneralBol.otf" },
1441 {
"Root.TTFont.STIXGenBdIt",
"STIXGeneralBolIta.otf" },
1442 {
"Root.TTFont.STIXSiz1Sym",
"STIXSiz1Sym.otf" },
1443 {
"Root.TTFont.STIXSiz1SymBd",
"STIXSiz1SymBol.otf" },
1444 {
"Root.TTFont.STIXSiz2Sym",
"STIXSiz2Sym.otf" },
1445 {
"Root.TTFont.STIXSiz2SymBd",
"STIXSiz2SymBol.otf" },
1446 {
"Root.TTFont.STIXSiz3Sym",
"STIXSiz3Sym.otf" },
1447 {
"Root.TTFont.STIXSiz3SymBd",
"STIXSiz3SymBol.otf" },
1448 {
"Root.TTFont.STIXSiz4Sym",
"STIXSiz4Sym.otf" },
1449 {
"Root.TTFont.STIXSiz4SymBd",
"STIXSiz4SymBol.otf" },
1450 {
"Root.TTFont.STIXSiz5Sym",
"STIXSiz5Sym.otf" },
1451 {
"Root.TTFont.ME",
"DroidSansFallback.ttf" },
1452 {
"Root.TTFont.CJKMing",
"DroidSansFallback.ttf" },
1453 {
"Root.TTFont.CJKCothic",
"DroidSansFallback.ttf" }
1456 PrintStr(
"%%IncludeResource: ProcSet (FontSetInit)@");
1468 "font %d (filename '%s') not found in path",
1478 "failed to embed font %d (filename '%s')",
1483 PrintStr(
"%%IncludeResource: font Times-Roman@");
1484 PrintStr(
"%%IncludeResource: font Times-Italic@");
1485 PrintStr(
"%%IncludeResource: font Times-Bold@");
1486 PrintStr(
"%%IncludeResource: font Times-BoldItalic@");
1487 PrintStr(
"%%IncludeResource: font Helvetica@");
1488 PrintStr(
"%%IncludeResource: font Helvetica-Oblique@");
1489 PrintStr(
"%%IncludeResource: font Helvetica-Bold@");
1490 PrintStr(
"%%IncludeResource: font Helvetica-BoldOblique@");
1491 PrintStr(
"%%IncludeResource: font Courier@");
1492 PrintStr(
"%%IncludeResource: font Courier-Oblique@");
1493 PrintStr(
"%%IncludeResource: font Courier-Bold@");
1494 PrintStr(
"%%IncludeResource: font Courier-BoldOblique@");
1495 PrintStr(
"%%IncludeResource: font Symbol@");
1496 PrintStr(
"%%IncludeResource: font ZapfDingbats@");
1508 PrintStr(
" dup length dict begin");
1515 PrintStr(
" dup /FontName get exch");
1518 PrintStr(
" [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica");
1519 PrintStr(
" /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique");
1520 PrintStr(
" /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique");
1521 PrintStr(
" /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique");
1522 PrintStr(
" /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi");
1523 PrintStr(
" /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic");
1524 PrintStr(
" /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique");
1525 PrintStr(
" /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold");
1526 PrintStr(
" /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic");
1527 PrintStr(
" /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman");
1528 PrintStr(
" ] {ISOLatin1Encoding reEncode } forall");
1582 Error(
"Initialize",
"invalid file type %d",
fMode);
1629 PrintFast(24,
"%%Creator: ROOT Version ");
1638 PrintStr(
"%%Orientation: Portrait@");
1640 PrintStr(
"%%Orientation: Landscape@");
1649 PrintStr(
"/s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def@");
1650 PrintStr(
"/r {rotate} def /rl {roll} def /R {repeat} def@");
1651 PrintStr(
"/d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def@");
1653 PrintStr(
"/c {setcmykcolor} def /black {0 0 0 1 setcmykcolor} def /sd {setdash} def@");
1655 PrintStr(
"/c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def@");
1657 PrintStr(
"/cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def@");
1658 PrintStr(
"/box {m dup 0 exch d exch 0 d 0 exch neg d cl} def@");
1659 PrintStr(
"/NC{systemdict begin initclip end}def/C{NC box clip newpath}def@");
1660 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@");
1661 PrintStr(
"/K {{pop pop 0 moveto} exch kshow} bind def@");
1662 PrintStr(
"/ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def@");
1784 PrintFast(33,
"/Zone {/iy exch def /ix exch def ");
1836 if (ix != 0 && iy != 0) {
1840 }
else if (ix != 0) {
1843 }
else if (iy != 0) {
1865 Double_t xlow=0, ylow=0, xup=1, yup=1;
1867 xlow =
gPad->GetAbsXlowNDC();
1868 xup = xlow +
gPad->GetAbsWNDC();
1869 ylow =
gPad->GetAbsYlowNDC();
1870 yup = ylow +
gPad->GetAbsHNDC();
1998 PrintStr(
" << /PatternType 1 /PaintType 2 /TilingType 1");
2003 PrintStr(
" /PaintProc { begin gsave");
2004 PrintStr(
" [1] 0 sd 2 4 m 99 4 l s 1 3 m 98 3 l s");
2005 PrintStr(
" 2 2 m 99 2 l s 1 1 m 98 1 l s");
2006 PrintStr(
" gr end } >> [ 4.0 0 0 4.0 0 0 ]");
2011 PrintStr(
" /PaintProc { begin gsave");
2012 PrintStr(
" [1 3] 0 sd 2 4 m 98 4 l s 0 3 m 96 3 l s");
2013 PrintStr(
" 2 2 m 98 2 l s 0 1 m 96 1 l s");
2014 PrintStr(
" gr end } >> [ 3.0 0 0 3.0 0 0 ]");
2019 PrintStr(
" /PaintProc { begin gsave");
2020 PrintStr(
" [1 3] 0 sd 2 13 m 98 13 l s 0 9 m 96 9 l s");
2021 PrintStr(
" 2 5 m 98 5 l s 0 1 m 96 1 l s");
2022 PrintStr(
" gr end } >> [ 2.0 0 0 2.0 0 0 ]");
2025 PrintStr(
" /BBox [ 0 0 100 100 ]");
2026 PrintStr(
" /XStep 100 /YStep 100");
2027 PrintStr(
" /PaintProc { begin gsave");
2029 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2032 PrintStr(
" /BBox [ 0 0 100 100 ]");
2033 PrintStr(
" /XStep 100 /YStep 100");
2034 PrintStr(
" /PaintProc { begin gsave");
2036 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2039 PrintStr(
" /BBox [ 0 0 100 100 ]");
2040 PrintStr(
" /XStep 100 /YStep 100");
2041 PrintStr(
" /PaintProc { begin gsave");
2043 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2046 PrintStr(
" /BBox [ 0 0 100 100 ]");
2047 PrintStr(
" /XStep 100 /YStep 100");
2048 PrintStr(
" /PaintProc { begin gsave");
2050 PrintStr(
" gr end } >> [ 0.12 0 0 0.12 0 0 ]");
2053 PrintStr(
" /BBox [ 0 0 101 101 ]");
2054 PrintStr(
" /XStep 100 /YStep 100");
2055 PrintStr(
" /PaintProc { begin gsave");
2056 PrintStr(
" 0 0 m 0 30 l 30 0 l f 0 70 m 0 100 l 30 100 l f");
2057 PrintStr(
" 70 100 m 100 100 l 100 70 l f 70 0 m 100 0 l");
2058 PrintStr(
" 100 30 l f 50 20 m 20 50 l 50 80 l 80 50 l f");
2059 PrintStr(
" 50 80 m 30 100 l s 20 50 m 0 30 l s 50 20 m");
2060 PrintStr(
" 70 0 l s 80 50 m 100 70 l s");
2061 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2064 PrintStr(
" /BBox [ 0 0 100 100 ]");
2065 PrintStr(
" /XStep 100 /YStep 100");
2066 PrintStr(
" /PaintProc { begin gsave");
2067 PrintStr(
" 0 50 m 50 50 50 180 360 arc");
2068 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2069 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2070 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2073 PrintStr(
" /BBox [ 0 0 100 100 ]");
2074 PrintStr(
" /XStep 100 /YStep 100");
2075 PrintStr(
" /PaintProc { begin gsave");
2076 PrintStr(
" 0 50 m 100 50 l 1 1 m 100 1 l");
2077 PrintStr(
" 0 0 m 0 50 l 100 0 m 100 50 l");
2079 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2082 PrintStr(
" /BBox [ 0 0 100 100 ]");
2083 PrintStr(
" /XStep 100 /YStep 100");
2084 PrintStr(
" /PaintProc { begin gsave");
2085 PrintStr(
" 0 0 m 0 20 l 50 0 m 50 20 l");
2086 PrintStr(
" 100 0 m 100 20 l 0 80 m 0 100 l");
2087 PrintStr(
" 50 80 m 50 100 l 100 80 m 100 100 l");
2088 PrintStr(
" 25 30 m 25 70 l 75 30 m 75 70 l");
2089 PrintStr(
" 0 100 m 20 85 l 50 100 m 30 85 l");
2090 PrintStr(
" 50 100 m 70 85 l 100 100 m 80 85 l");
2091 PrintStr(
" 0 0 m 20 15 l 50 0 m 30 15 l");
2092 PrintStr(
" 50 0 m 70 15 l 100 0 m 80 15 l");
2093 PrintStr(
" 5 35 m 45 65 l 5 65 m 45 35 l");
2094 PrintStr(
" 55 35 m 95 65 l 55 65 m 95 35 l s");
2095 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2098 PrintStr(
" /BBox [ 0 0 100 100 ]");
2099 PrintStr(
" /XStep 100 /YStep 100");
2100 PrintStr(
" /PaintProc { begin gsave");
2101 PrintStr(
" 0 80 m 0 100 20 270 360 arc");
2102 PrintStr(
" 30 100 m 50 100 20 180 360 arc");
2103 PrintStr(
" 80 100 m 100 100 20 180 270 arc");
2104 PrintStr(
" 20 0 m 0 0 20 0 90 arc");
2105 PrintStr(
" 70 0 m 50 0 20 0 180 arc");
2106 PrintStr(
" 100 20 m 100 0 20 90 180 arc");
2107 PrintStr(
" 45 50 m 25 50 20 0 360 arc");
2108 PrintStr(
" 95 50 m 75 50 20 0 360 arc s");
2109 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2112 PrintStr(
" /BBox [ 0 0 100 100 ]");
2113 PrintStr(
" /XStep 100 /YStep 100");
2114 PrintStr(
" /PaintProc { begin gsave");
2115 PrintStr(
" 0 0 m 100 100 l 0 100 m 100 0 l s");
2116 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2119 PrintStr(
" /BBox [ 0 0 100 100 ]");
2121 PrintStr(
" /PaintProc { begin gsave");
2122 PrintStr(
" 0 20 m 100 20 l 20 0 m 20 100 l");
2123 PrintStr(
" 0 80 m 100 80 l 80 0 m 80 100 l");
2124 PrintStr(
" 20 40 m 60 40 l 60 20 m 60 60 l");
2125 PrintStr(
" 40 40 m 40 80 l 40 60 m 80 60 l s");
2126 PrintStr(
" gr end } >> [ 0.60 0 0 0.60 0 0 ]");
2131 PrintStr(
" /PaintProc { begin gsave");
2132 PrintStr(
" 0 55 m 0 60 5 270 360 arc");
2133 PrintStr(
" 25 60 m 30 60 5 180 360 arc");
2134 PrintStr(
" 55 60 m 60 60 5 180 270 arc");
2135 PrintStr(
" 20 30 m 15 30 5 0 360 arc");
2136 PrintStr(
" 50 30 m 45 30 5 0 360");
2137 PrintStr(
" arc 5 0 m 0 0 5 0 90 arc");
2138 PrintStr(
" 35 0 m 30 0 5 0 180 arc");
2139 PrintStr(
" 60 5 m 60 0 5 90 180 arc s");
2140 PrintStr(
" gr end } >> [ 0.41 0 0 0.41 0 0 ]");
2143 PrintStr(
" /BBox [ 0 0 100 100 ]");
2144 PrintStr(
" /XStep 100 /YStep 100");
2145 PrintStr(
" /PaintProc { begin gsave");
2146 PrintStr(
" 50 50 m 25 50 25 0 180 arc s");
2147 PrintStr(
" 50 50 m 75 50 25 180 360 arc s");
2148 PrintStr(
" gr end } >> [ 0.4 0 0 0.2 0 0 ]");
2151 PrintStr(
" /BBox [ 0 0 100 100 ]");
2152 PrintStr(
" /XStep 100 /YStep 100");
2153 PrintStr(
" /PaintProc { begin gsave");
2154 PrintStr(
" [24] 0 setdash 0 0 m 100 100 l s");
2155 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2158 PrintStr(
" /BBox [ 0 0 100 100 ]");
2159 PrintStr(
" /XStep 100 /YStep 100");
2160 PrintStr(
" /PaintProc { begin gsave");
2161 PrintStr(
" [24] 0 setdash 0 100 m 100 0 l s");
2162 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2165 PrintStr(
" /BBox [ 0 0 100 100 ]");
2166 PrintStr(
" /XStep 100 /YStep 100");
2167 PrintStr(
" /PaintProc { begin gsave");
2168 PrintStr(
" 90 50 m 50 50 40 0 360 arc");
2169 PrintStr(
" 0 50 m 0 100 50 270 360 arc");
2170 PrintStr(
" 50 0 m 0 0 50 0 90 arc");
2171 PrintStr(
" 100 50 m 100 0 50 90 180 arc");
2172 PrintStr(
" 50 100 m 100 100 50 180 270 arc s");
2173 PrintStr(
" gr end } >> [ 0.47 0 0 0.47 0 0 ]");
2176 PrintStr(
" /BBox [ 0 0 100 100 ]");
2177 PrintStr(
" /XStep 100 /YStep 100");
2178 PrintStr(
" /PaintProc { begin gsave");
2179 PrintStr(
" 50 50 m 50 75 25 270 450 arc s");
2180 PrintStr(
" 50 50 m 50 25 25 90 270 arc s");
2181 PrintStr(
" gr end } >> [ 0.2 0 0 0.4 0 0 ]");
2184 PrintStr(
" /BBox [ 0 0 101 101 ]");
2185 PrintStr(
" /XStep 100 /YStep 100");
2186 PrintStr(
" /PaintProc { begin gsave");
2187 PrintStr(
" 1 1 m 25 1 l 25 25 l 50 25 l 50 50 l");
2188 PrintStr(
" 75 50 l 75 75 l 100 75 l 100 100 l");
2189 PrintStr(
" 50 1 m 75 1 l 75 25 l 100 25 l 100 50 l");
2190 PrintStr(
" 0 50 m 25 50 l 25 75 l 50 75 l 50 100 l s");
2191 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2194 PrintStr(
" /BBox [ 0 0 101 101 ]");
2195 PrintStr(
" /XStep 100 /YStep 100");
2196 PrintStr(
" /PaintProc { begin gsave");
2197 PrintStr(
" 1 100 m 25 100 l 25 75 l 50 75 l 50 50 l");
2198 PrintStr(
" 75 50 l 75 25 l 100 25 l 100 1 l");
2199 PrintStr(
" 50 100 m 75 100 l 75 75 l 100 75 l 100 50 l");
2200 PrintStr(
" 0 50 m 25 50 l 25 25 l 50 25 l 50 1 l s");
2201 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2204 PrintStr(
" /BBox [ 0 0 100 100 ]");
2205 PrintStr(
" /XStep 100 /YStep 100");
2206 PrintStr(
" /PaintProc { begin gsave");
2207 PrintStr(
" [1 7] 0 sd 0 8 50 { dup dup m 2 mul 0 l s } for");
2208 PrintStr(
" 0 8 50 { dup dup 2 mul 100 m 50 add exch 50");
2209 PrintStr(
" add l s } for 100 0 m 100 100 l 50 50 l f");
2210 PrintStr(
" gr end } >> [ 0.24 0 0 0.24 0 0 ]");
2213 PrintStr(
" /BBox [ 0 0 100 100 ]");
2214 PrintStr(
" /XStep 100 /YStep 100");
2215 PrintStr(
" /PaintProc { begin gsave");
2216 PrintStr(
" 100 100 m 100 36 l 88 36 l 88 88 l f");
2217 PrintStr(
" 100 0 m 100 12 l 56 12 l 50 0 l f");
2218 PrintStr(
" 0 0 m 48 0 l 48 48 l 50 48 l 56 60 l");
2219 PrintStr(
" 36 60 l 36 12 l 0 12 l f [1 7] 0 sd");
2220 PrintStr(
" 61 8 87 { dup dup dup 12 exch m 88 exch l s");
2221 PrintStr(
" 16 exch 4 sub m 88 exch 4 sub l s } for");
2222 PrintStr(
" 13 8 35 { dup dup dup 0 exch m 36 exch l s");
2223 PrintStr(
" 4 exch 4 sub m 36 exch 4 sub l s } for");
2224 PrintStr(
" 37 8 59 { dup dup dup 12 exch m 36 exch l s");
2225 PrintStr(
" 16 exch 4 sub m 36 exch 4 sub l s } for");
2226 PrintStr(
" 13 8 60 { dup dup dup 56 exch m 100 exch l s");
2227 PrintStr(
" 60 exch 4 sub m 100 exch 4 sub l s } for");
2228 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2231 PrintStr(
" /BBox [ 0 0 101 101 ]");
2232 PrintStr(
" /XStep 100 /YStep 100");
2233 PrintStr(
" /PaintProc { begin gsave");
2234 PrintStr(
" 0 0 m 30 30 l 70 30 l 70 70 l 100 100 l 100 0 l");
2235 PrintStr(
" f 30 30 m 30 70 l 70 70 l f");
2236 PrintStr(
" gr end } >> [ 0.5 0 0 0.5 0 0 ]");
2246 PrintStr(
" /cs {[/Pattern /DeviceCMYK] setcolorspace} def");
2247 PrintStr(
" /FA {f [/DeviceCMYK] setcolorspace} def");
2249 PrintStr(
" /cs {[/Pattern /DeviceRGB] setcolorspace} def");
2250 PrintStr(
" /FA {f [/DeviceRGB] setcolorspace} def");
2413 if (color < 0) color = 0;
2469 static const char *
psfont[31][2] = {
2470 {
"Root.PSFont.1",
"/Times-Italic" },
2471 {
"Root.PSFont.2",
"/Times-Bold" },
2472 {
"Root.PSFont.3",
"/Times-BoldItalic" },
2473 {
"Root.PSFont.4",
"/Helvetica" },
2474 {
"Root.PSFont.5",
"/Helvetica-Oblique" },
2475 {
"Root.PSFont.6",
"/Helvetica-Bold" },
2476 {
"Root.PSFont.7",
"/Helvetica-BoldOblique" },
2477 {
"Root.PSFont.8",
"/Courier" },
2478 {
"Root.PSFont.9",
"/Courier-Oblique" },
2479 {
"Root.PSFont.10",
"/Courier-Bold" },
2480 {
"Root.PSFont.11",
"/Courier-BoldOblique" },
2481 {
"Root.PSFont.12",
"/Symbol" },
2482 {
"Root.PSFont.13",
"/Times-Roman" },
2483 {
"Root.PSFont.14",
"/ZapfDingbats" },
2484 {
"Root.PSFont.15",
"/Symbol" },
2485 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2486 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2487 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2488 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2489 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2490 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2491 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2492 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2493 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2494 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2495 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2496 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2497 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2498 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2499 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2500 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2513 if (
wh <= 0 ||
hh <= 0)
2533 if( font > 31 || font < 1) font = 1;
2546 }
else if (
txalv == 2) {
2568 t.TAttText::Modify();
2574 for (
Int_t i =
len - 1;i >= 0;i--) {
2626 for (
Int_t i =
len-1; i >= 1; i--) {
2642 if (
chars[i]!=
'\n') {
2646 }
else if ((
chars[i]==
'-') && (font != 12)) {
2661 if (font != 15)
PrintStr(
" show NC");
2676 static const char *
psfont[31][2] = {
2677 {
"Root.PSFont.1",
"/FreeSerifItalic" },
2678 {
"Root.PSFont.2",
"/FreeSerifBold" },
2679 {
"Root.PSFont.3",
"/FreeSerifBoldItalic" },
2680 {
"Root.PSFont.4",
"/FreeSans" },
2681 {
"Root.PSFont.5",
"/FreeSansOblique" },
2682 {
"Root.PSFont.6",
"/FreeSansBold" },
2683 {
"Root.PSFont.7",
"/FreeSansBoldOblique" },
2684 {
"Root.PSFont.8",
"/FreeMono" },
2685 {
"Root.PSFont.9",
"/FreeMonoOblique" },
2686 {
"Root.PSFont.10",
"/FreeMonoBold" },
2687 {
"Root.PSFont.11",
"/FreeMonoBoldOblique" },
2688 {
"Root.PSFont.12",
"/SymbolMT" },
2689 {
"Root.PSFont.13",
"/FreeSerif" },
2690 {
"Root.PSFont.14",
"/Wingdings-Regular" },
2691 {
"Root.PSFont.15",
"/SymbolMT" },
2692 {
"Root.PSFont.STIXGen",
"/STIXGeneral" },
2693 {
"Root.PSFont.STIXGenIt",
"/STIXGeneral-Italic" },
2694 {
"Root.PSFont.STIXGenBd",
"/STIXGeneral-Bold" },
2695 {
"Root.PSFont.STIXGenBdIt",
"/STIXGeneral-BoldItalic" },
2696 {
"Root.PSFont.STIXSiz1Sym",
"/STIXSize1Symbols" },
2697 {
"Root.PSFont.STIXSiz1SymBd",
"/STIXSize1Symbols-Bold" },
2698 {
"Root.PSFont.STIXSiz2Sym",
"/STIXSize2Symbols" },
2699 {
"Root.PSFont.STIXSiz2SymBd",
"/STIXSize2Symbols-Bold" },
2700 {
"Root.PSFont.STIXSiz3Sym",
"/STIXSize3Symbols" },
2701 {
"Root.PSFont.STIXSiz3SymBd",
"/STIXSize3Symbols-Bold" },
2702 {
"Root.PSFont.STIXSiz4Sym",
"/STIXSize4Symbols" },
2703 {
"Root.PSFont.STIXSiz4SymBd",
"/STIXSize4Symbols-Bold" },
2704 {
"Root.PSFont.STIXSiz5Sym",
"/STIXSize5Symbols" },
2705 {
"Root.PSFont.ME",
"/DroidSansFallback" },
2706 {
"Root.PSFont.CJKMing",
"/DroidSansFallback" },
2707 {
"Root.PSFont.CJKGothic",
"/DroidSansFallback" }
2741 if( font > 29 || font < 1) font = 1;
2754 }
else if (
txalv == 2) {
2801 const wchar_t *
lower = std::lower_bound(
2807 const unsigned long index =
2811 else if((
unsigned int)
chars[i] < 0xffff) {
2814 (
unsigned int)
chars[i]));
2819 (
unsigned int)
chars[i]));
2869 return Int_t(0.5 + 288*cm/2.54);
2878 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)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 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.
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 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.