MCPcopy Create free account
hub / github.com/KiCad/kicad-source-mirror / StartPlot

Method StartPlot

common/plotters/PS_plotter.cpp:731–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729
730
731bool PS_PLOTTER::StartPlot( const wxString& aPageNumber )
732{
733 wxASSERT( m_outputFile );
734
735 std::string PSMacro =
736 "%%BeginProlog\n"
737 "/line { newpath moveto lineto stroke } bind def\n"
738 "/cir0 { newpath 0 360 arc stroke } bind def\n"
739 "/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n"
740 "/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n"
741 "/arc0 { newpath arc stroke } bind def\n"
742 "/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill\n"
743 " grestore stroke } bind def\n"
744 "/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill\n"
745 " grestore stroke } bind def\n"
746 "/poly0 { stroke } bind def\n"
747 "/poly1 { closepath gsave fill grestore stroke } bind def\n"
748 "/poly2 { closepath gsave fill grestore stroke } bind def\n"
749 "/rect0 { rectstroke } bind def\n"
750 "/rect1 { rectfill } bind def\n"
751 "/rect2 { rectfill } bind def\n"
752 "/linemode0 { 0 setlinecap 0 setlinejoin 0 setlinewidth } bind def\n"
753 "/linemode1 { 1 setlinecap 1 setlinejoin } bind def\n"
754 "/dashedline { [200] 100 setdash } bind def\n"
755 "/solidline { [] 0 setdash } bind def\n"
756
757 // This is for 'hidden' text (search anchors for PDF)
758 "/phantomshow { moveto\n"
759 " /KicadFont findfont 0.000001 scalefont setfont\n"
760 " show } bind def\n"
761
762 // This is for regular postscript text
763 "/textshow { gsave\n"
764 " findfont exch scalefont setfont concat 1 scale 0 0 moveto show\n"
765 " } bind def\n"
766
767 // Utility for getting Latin1 encoded fonts
768 "/reencodefont {\n"
769 " findfont dup length dict begin\n"
770 " { 1 index /FID ne\n"
771 " { def }\n"
772 " { pop pop } ifelse\n"
773 " } forall\n"
774 " /Encoding ISOLatin1Encoding def\n"
775 " currentdict\n"
776 " end } bind def\n"
777
778 // Remap AdobeStandard fonts to Latin1
779 "/KicadFont /Helvetica reencodefont definefont pop\n"
780 "/KicadFont-Bold /Helvetica-Bold reencodefont definefont pop\n"
781 "/KicadFont-Oblique /Helvetica-Oblique reencodefont definefont pop\n"
782 "/KicadFont-BoldOblique /Helvetica-BoldOblique reencodefont definefont pop\n"
783 "%%EndProlog\n";
784
785 time_t time1970 = time( nullptr );
786
787 fmt::print( m_outputFile, "%!PS-Adobe-3.0\n" ); // Print header
788

Callers 15

BOOST_AUTO_TEST_CASEFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
PlotToSvgStringMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
doSymExportSvgMethod · 0.45
createPDFFileMethod · 0.45
plotOneSheetPSMethod · 0.45
plotOneSheetSVGMethod · 0.45
plotOneSheetDXFMethod · 0.45

Calls 5

c_strMethod · 0.80
GetTypeAsStringMethod · 0.80
GetDefaultPenWidthMethod · 0.80
KiROUNDFunction · 0.50
IsCustomMethod · 0.45

Tested by 7

BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
PlotToSvgStringMethod · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36