79 if(
color != COLOR4D::WHITE )
100 if( size.
x > size.
y )
102 std::swap( size.
x, size.
y );
113 if( aTraceMode ==
FILLED )
114 ThickSegment( a + aPadPos, b + aPadPos, size.
x, aTraceMode,
nullptr );
123 if( aTraceMode ==
FILLED )
125 Circle( aPadPos, aDiameter, FILL_T::FILLED_SHAPE, 0 );
141 std::vector<VECTOR2I> cornerList;
143 cornerList.reserve( 4 );
145 if( aTraceMode ==
FILLED )
154 corner.
x = aPadPos.
x - dx;
155 corner.
y = aPadPos.
y + dy;
156 cornerList.push_back( corner );
157 corner.
x = aPadPos.
x - dx;
158 corner.
y = aPadPos.
y - dy;
159 cornerList.push_back( corner );
160 corner.
x = aPadPos.
x + dx;
161 corner.
y = aPadPos.
y - dy;
162 cornerList.push_back( corner );
163 corner.
x = aPadPos.
x + dx;
164 corner.
y = aPadPos.
y + dy,
165 cornerList.push_back( corner );
167 for(
unsigned ii = 0; ii < cornerList.size(); ii++ )
168 RotatePoint( cornerList[ii], aPadPos, aPadOrient );
170 cornerList.push_back( cornerList[0] );
172 PlotPoly( cornerList, ( aTraceMode ==
FILLED ) ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL,
178 int aCornerRadius,
const EDA_ANGLE& aOrient,
183 if( aTraceMode ==
FILLED )
197 std::vector<VECTOR2I> cornerList;
203 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
204 cornerList.emplace_back( poly.
CPoint( ii ).
x, poly.
CPoint( ii ).
y );
207 cornerList.push_back( cornerList[0] );
209 PlotPoly( cornerList, ( aTraceMode ==
FILLED ) ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL,
220 if( aTraceMode ==
FILLED )
230 std::vector<VECTOR2I> cornerList;
232 for(
int cnt = 0; cnt < aPolygons->
OutlineCount(); ++cnt )
237 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
238 cornerList.emplace_back( poly.
CPoint( ii ).
x, poly.
CPoint( ii ).
y );
241 cornerList.push_back( cornerList[0] );
243 PlotPoly( cornerList, ( aTraceMode ==
FILLED ) ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL,
253 static std::vector<VECTOR2I> cornerList;
256 for(
int ii = 0; ii < 4; ii++ )
257 cornerList.push_back( aCorners[ii] );
259 if( aTraceMode ==
FILLED )
268 for(
int ii = 0; ii < 4; ii++ )
271 cornerList[ii] += aPadPos;
274 cornerList.push_back( cornerList[0] );
275 PlotPoly( cornerList, ( aTraceMode ==
FILLED ) ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL,
292 std::string converted;
296 for(
unsigned i = 0; i < aUnicode.Len(); i++ )
299 wchar_t ch = aUnicode[i];
330 bool aItalic,
bool aBold )
336 for(
unsigned i = 0; i < aText.length(); i++ )
338 wchar_t AsciiCode = aText[i];
341 if( AsciiCode !=
'~' && AsciiCode < 256 )
343 tally += width_table[AsciiCode];
353 bool aItalic,
bool aBold,
354 std::vector<int> *pos_pairs )
362 for(
unsigned i = 0; i < aText.length(); i++ )
364 wchar_t AsciiCode = aText[i];
367 if( AsciiCode !=
'~' && AsciiCode < 256 )
369 tally += width_table[AsciiCode];
373 if( AsciiCode ==
'~' )
379 if( pos_pairs->size() % 2 == 1 )
385 double aScale,
bool aMirror )
402 const wxString& aText,
411 double *wideningFactor,
418 double *heightFactor )
450 *wideningFactor = sz_dev.
x / sz_dev.
y;
454 *wideningFactor = -*wideningFactor;
458 double sinalpha = sin( alpha );
459 double cosalpha = cos( alpha );
481 else if( aWidth == 0 )
484 wxASSERT_MSG( aWidth > 0,
"Plotter called to set negative pen width" );
503 r = ( r * a ) + ( 1 - a );
504 g = ( g * a ) + ( 1 - a );
505 b = ( b * a ) + ( 1 - a );
509 fprintf(
m_outputFile,
"%.3g %.3g %.3g setrgbcolor\n", r, g, b );
517 case PLOT_DASH_TYPE::DASH:
522 case PLOT_DASH_TYPE::DOT:
527 case PLOT_DASH_TYPE::DASHDOT:
533 case PLOT_DASH_TYPE::DASHDOTDOT:
534 fprintf(
m_outputFile,
"[%d %d %d %d %d %d] 0 setdash\n",
552 fprintf(
m_outputFile,
"%g %g %g %g rect%d\n", p1_dev.
x, p1_dev.
y,
553 p2_dev.
x - p1_dev.
x, p2_dev.
y - p1_dev.
y,
getFillId( fill ) );
575 FILL_T aFill,
int aWidth,
int aMaxError )
582 double radius_device = ( start_device - center_device ).
EuclideanNorm();
587 std::swap( startAngle, endAngle );
603 if( aCornerList.size() <= 1 )
611 for(
unsigned ii = 1; ii < aCornerList.size(); ii++ )
625 pix_size.
x = aImage.GetWidth();
626 pix_size.
y = aImage.GetHeight();
627 VECTOR2D drawsize( aScaleFactor * pix_size.
x,
628 aScaleFactor * pix_size.
y );
632 start.
x -= drawsize.
x / 2;
633 start.
y += drawsize.
y / 2;
637 end.
x = start.
x + drawsize.
x;
638 end.
y = start.
y - drawsize.
y;
645 fprintf(
m_outputFile,
"%g %g translate\n", start_dev.
x, start_dev.
y );
657 fprintf(
m_outputFile,
" [%d 0 0 %d 0 %d]\n", pix_size.
x, -pix_size.
y , pix_size.
y);
660 fprintf(
m_outputFile,
"{currentfile pix readhexstring pop}\n" );
671 for(
int yy = 0; yy < pix_size.
y; yy ++ )
673 for(
int xx = 0; xx < pix_size.
x; xx++, jj++ )
681 int red, green, blue;
682 red = aImage.GetRed( xx, yy) & 0xFF;
683 green = aImage.GetGreen( xx, yy) & 0xFF;
684 blue = aImage.GetBlue( xx, yy) & 0xFF;
687 if( aImage.HasAlpha() )
689 unsigned char alpha = aImage.GetAlpha( xx, yy ) & 0xFF;
693 float a = 1.0 - ( (float) alpha / 255.0 );
694 red = ( int )(
red + ( a * 0xFF ) ) & 0xFF;
695 green = ( int )( green + ( a * 0xFF ) ) & 0xFF;
696 blue = ( int )( blue + ( a * 0xFF ) ) & 0xFF;
700 if( aImage.HasMask() )
702 if(
red == aImage.GetMaskRed() && green == aImage.GetMaskGreen()
703 && blue == aImage.GetMaskBlue() )
718 unsigned char grey =
KiROUND(
red * 0.2126 + green * 0.7152 + blue * 0.0722 );
756 pos_dev.
x, pos_dev.
y,
757 ( plume==
'D' ) ?
"line" :
"move" );
769 static const char* PSMacro[] =
772 "/line { newpath moveto lineto stroke } bind def\n",
773 "/cir0 { newpath 0 360 arc stroke } bind def\n",
774 "/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
775 "/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
776 "/arc0 { newpath arc stroke } bind def\n",
777 "/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill\n",
778 " grestore stroke } bind def\n",
779 "/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill\n",
780 " grestore stroke } bind def\n",
781 "/poly0 { stroke } bind def\n",
782 "/poly1 { closepath gsave fill grestore stroke } bind def\n",
783 "/poly2 { closepath gsave fill grestore stroke } bind def\n",
784 "/rect0 { rectstroke } bind def\n",
785 "/rect1 { rectfill } bind def\n",
786 "/rect2 { rectfill } bind def\n",
787 "/linemode0 { 0 setlinecap 0 setlinejoin 0 setlinewidth } bind def\n",
788 "/linemode1 { 1 setlinecap 1 setlinejoin } bind def\n",
789 "/dashedline { [200] 100 setdash } bind def\n",
790 "/solidline { [] 0 setdash } bind def\n",
793 "/phantomshow { moveto\n",
794 " /KicadFont findfont 0.000001 scalefont setfont\n",
795 " show } bind def\n",
798 "/textshow { gsave\n",
799 " findfont exch scalefont setfont concat 1 scale 0 0 moveto show\n",
804 " findfont dup length dict begin\n",
805 " { 1 index /FID ne\n",
807 " { pop pop } ifelse\n",
809 " /Encoding ISOLatin1Encoding def\n",
814 "/KicadFont /Helvetica reencodefont definefont pop\n",
815 "/KicadFont-Bold /Helvetica-Bold reencodefont definefont pop\n",
816 "/KicadFont-Oblique /Helvetica-Oblique reencodefont definefont pop\n",
817 "/KicadFont-BoldOblique /Helvetica-BoldOblique reencodefont definefont pop\n",
822 time_t time1970 = time(
nullptr );
830 fprintf(
m_outputFile,
"%%%%CreationDate: %s", ctime( &time1970 ) );
836 const double BIGPTsPERMIL = 0.072;
850 (
int) ceil( psPaperSize.
x * BIGPTsPERMIL ),
851 (
int) ceil( psPaperSize.
y * BIGPTsPERMIL ) );
870 fprintf(
m_outputFile,
"%%%%DocumentMedia: Custom %d %d 0 () ()\n",
871 KiROUND( psPaperSize.
x * BIGPTsPERMIL ),
872 KiROUND( psPaperSize.
y * BIGPTsPERMIL ) );
876 fprintf(
m_outputFile,
"%%%%DocumentMedia: %s %d %d 0 () ()\n",
878 KiROUND( psPaperSize.
x * BIGPTsPERMIL ),
879 KiROUND( psPaperSize.
y * BIGPTsPERMIL ) );
885 fprintf(
m_outputFile,
"%%%%Orientation: Landscape\n" );
891 for(
int ii = 0; PSMacro[ii] !=
nullptr; ii++ )
901 fprintf(
m_outputFile,
"%%Page: %s 1\n", page_num.c_str() );
903 fputs(
"%%BeginPageSetup\n"
905 "0.0072 0.0072 scale\n"
911 fprintf(
m_outputFile,
"%d 0 translate 90 rotate\n", 10 * psPaperSize.
x );
942 const wxString& aText,
950 bool aMultilineAllowed,
962 fprintf(
m_outputFile,
"%s %g %g phantomshow\n", ps_test.c_str(), pos_dev.
x, pos_dev.
y );
965 PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aWidth, aItalic,
966 aBold, aMultilineAllowed, aFont, aData );
972 const wxString& aText,
985 fprintf(
m_outputFile,
"%s %g %g phantomshow\n", ps_test.c_str(), pos_dev.
x, pos_dev.
y );
996 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
997 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
998 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
999 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1000 0.278, 0.278, 0.355, 0.556, 0.556, 0.889, 0.667, 0.191,
1001 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1002 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1003 0.556, 0.556, 0.278, 0.278, 0.584, 0.584, 0.584, 0.556,
1004 1.015, 0.667, 0.667, 0.722, 0.722, 0.667, 0.611, 0.778,
1005 0.722, 0.278, 0.500, 0.667, 0.556, 0.833, 0.722, 0.778,
1006 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1007 0.667, 0.667, 0.611, 0.278, 0.278, 0.278, 0.469, 0.556,
1008 0.333, 0.556, 0.556, 0.500, 0.556, 0.556, 0.278, 0.556,
1009 0.556, 0.222, 0.222, 0.500, 0.222, 0.833, 0.556, 0.556,
1010 0.556, 0.556, 0.333, 0.500, 0.278, 0.556, 0.500, 0.722,
1011 0.500, 0.500, 0.500, 0.334, 0.260, 0.334, 0.584, 0.278,
1012 0.278, 0.278, 0.222, 0.556, 0.333, 1.000, 0.556, 0.556,
1013 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1014 0.278, 0.222, 0.222, 0.333, 0.333, 0.350, 0.556, 1.000,
1015 0.333, 1.000, 0.500, 0.333, 0.944, 0.278, 0.278, 0.667,
1016 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.260, 0.556,
1017 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1018 0.400, 0.584, 0.333, 0.333, 0.333, 0.556, 0.537, 0.278,
1019 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1020 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 1.000, 0.722,
1021 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1022 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1023 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1024 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.500,
1025 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1026 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.584,
1027 0.611, 0.556, 0.556, 0.556, 0.556, 0.500, 0.556, 0.500
1035 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1036 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1037 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1038 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1039 0.278, 0.333, 0.474, 0.556, 0.556, 0.889, 0.722, 0.238,
1040 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1041 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1042 0.556, 0.556, 0.333, 0.333, 0.584, 0.584, 0.584, 0.611,
1043 0.975, 0.722, 0.722, 0.722, 0.722, 0.667, 0.611, 0.778,
1044 0.722, 0.278, 0.556, 0.722, 0.611, 0.833, 0.722, 0.778,
1045 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1046 0.667, 0.667, 0.611, 0.333, 0.278, 0.333, 0.584, 0.556,
1047 0.333, 0.556, 0.611, 0.556, 0.611, 0.556, 0.333, 0.611,
1048 0.611, 0.278, 0.278, 0.556, 0.278, 0.889, 0.611, 0.611,
1049 0.611, 0.611, 0.389, 0.556, 0.333, 0.611, 0.556, 0.778,
1050 0.556, 0.556, 0.500, 0.389, 0.280, 0.389, 0.584, 0.278,
1051 0.278, 0.278, 0.278, 0.556, 0.500, 1.000, 0.556, 0.556,
1052 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1053 0.278, 0.278, 0.278, 0.500, 0.500, 0.350, 0.556, 1.000,
1054 0.333, 1.000, 0.556, 0.333, 0.944, 0.278, 0.278, 0.667,
1055 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.280, 0.556,
1056 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1057 0.400, 0.584, 0.333, 0.333, 0.333, 0.611, 0.556, 0.278,
1058 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1059 0.722, 0.722, 0.722, 0.722, 0.722, 0.722, 1.000, 0.722,
1060 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1061 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1062 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1063 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.556,
1064 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1065 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.584,
1066 0.611, 0.611, 0.611, 0.611, 0.611, 0.556, 0.611, 0.556
1074 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1075 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1076 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1077 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1078 0.278, 0.278, 0.355, 0.556, 0.556, 0.889, 0.667, 0.191,
1079 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1080 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1081 0.556, 0.556, 0.278, 0.278, 0.584, 0.584, 0.584, 0.556,
1082 1.015, 0.667, 0.667, 0.722, 0.722, 0.667, 0.611, 0.778,
1083 0.722, 0.278, 0.500, 0.667, 0.556, 0.833, 0.722, 0.778,
1084 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1085 0.667, 0.667, 0.611, 0.278, 0.278, 0.278, 0.469, 0.556,
1086 0.333, 0.556, 0.556, 0.500, 0.556, 0.556, 0.278, 0.556,
1087 0.556, 0.222, 0.222, 0.500, 0.222, 0.833, 0.556, 0.556,
1088 0.556, 0.556, 0.333, 0.500, 0.278, 0.556, 0.500, 0.722,
1089 0.500, 0.500, 0.500, 0.334, 0.260, 0.334, 0.584, 0.278,
1090 0.278, 0.278, 0.222, 0.556, 0.333, 1.000, 0.556, 0.556,
1091 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1092 0.278, 0.222, 0.222, 0.333, 0.333, 0.350, 0.556, 1.000,
1093 0.333, 1.000, 0.500, 0.333, 0.944, 0.278, 0.278, 0.667,
1094 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.260, 0.556,
1095 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1096 0.400, 0.584, 0.333, 0.333, 0.333, 0.556, 0.537, 0.278,
1097 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1098 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 1.000, 0.722,
1099 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1100 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1101 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1102 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.500,
1103 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1104 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.584,
1105 0.611, 0.556, 0.556, 0.556, 0.556, 0.500, 0.556, 0.500
1113 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1114 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1115 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1116 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278,
1117 0.278, 0.333, 0.474, 0.556, 0.556, 0.889, 0.722, 0.238,
1118 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278,
1119 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556,
1120 0.556, 0.556, 0.333, 0.333, 0.584, 0.584, 0.584, 0.611,
1121 0.975, 0.722, 0.722, 0.722, 0.722, 0.667, 0.611, 0.778,
1122 0.722, 0.278, 0.556, 0.722, 0.611, 0.833, 0.722, 0.778,
1123 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944,
1124 0.667, 0.667, 0.611, 0.333, 0.278, 0.333, 0.584, 0.556,
1125 0.333, 0.556, 0.611, 0.556, 0.611, 0.556, 0.333, 0.611,
1126 0.611, 0.278, 0.278, 0.556, 0.278, 0.889, 0.611, 0.611,
1127 0.611, 0.611, 0.389, 0.556, 0.333, 0.611, 0.556, 0.778,
1128 0.556, 0.556, 0.500, 0.389, 0.280, 0.389, 0.584, 0.278,
1129 0.278, 0.278, 0.278, 0.556, 0.500, 1.000, 0.556, 0.556,
1130 0.333, 1.000, 0.667, 0.333, 1.000, 0.278, 0.278, 0.278,
1131 0.278, 0.278, 0.278, 0.500, 0.500, 0.350, 0.556, 1.000,
1132 0.333, 1.000, 0.556, 0.333, 0.944, 0.278, 0.278, 0.667,
1133 0.278, 0.333, 0.556, 0.556, 0.556, 0.556, 0.280, 0.556,
1134 0.333, 0.737, 0.370, 0.556, 0.584, 0.333, 0.737, 0.333,
1135 0.400, 0.584, 0.333, 0.333, 0.333, 0.611, 0.556, 0.278,
1136 0.333, 0.333, 0.365, 0.556, 0.834, 0.834, 0.834, 0.611,
1137 0.722, 0.722, 0.722, 0.722, 0.722, 0.722, 1.000, 0.722,
1138 0.667, 0.667, 0.667, 0.667, 0.278, 0.278, 0.278, 0.278,
1139 0.722, 0.722, 0.778, 0.778, 0.778, 0.778, 0.778, 0.584,
1140 0.778, 0.722, 0.722, 0.722, 0.722, 0.667, 0.667, 0.611,
1141 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.889, 0.556,
1142 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.278, 0.278,
1143 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.611, 0.584,
1144 0.611, 0.611, 0.611, 0.611, 0.611, 0.556, 0.611, 0.556
VECTOR2D mapCoords(const VECTOR2D &aSource)
const double hvbo_widths[256]
Character widths for Helvetica-BoldOblique.
static int getFillId(FILL_T aFill)
const double hvb_widths[256]
Character widths for Helvetica-Bold.
const double hv_widths[256]
Character widths for Helvetica.
const double hvo_widths[256]
Character widths for Helvetica-Oblique.
FONT is an abstract base class for both outline and stroke fonts.
A color representation with 4 components: red, green, blue, alpha.
int GetDefaultPenWidth() const
const VECTOR2I & GetSizeMils() const
int GetHeightMils() const
const wxString & GetType() const
double GetDotMarkLenIU(int aLineWidth) const
virtual void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode, void *aData)
double GetDashGapLenIU(int aLineWidth) const
virtual void Circle(const VECTOR2I &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
static const int USE_DEFAULT_LINE_WIDTH
virtual VECTOR2D userToDeviceCoordinates(const VECTOR2I &aCoordinate)
Modify coordinates according to the orientation, scale factor, and offsets trace.
virtual void Text(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aPenWidth, bool aItalic, bool aBold, bool aMultilineAllowed, KIFONT::FONT *aFont, void *aData=nullptr)
Draw text with the plotter.
virtual VECTOR2D userToDeviceSize(const VECTOR2I &size)
Modify size according to the plotter scale factors (VECTOR2I version, returns a VECTOR2D).
void sketchOval(const VECTOR2I &aPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, int aWidth)
int GetPlotterArcHighDef() const
double m_plotScale
Plot scale - chosen by the user (even implicitly with 'fit in a4')
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr)
FILE * m_outputFile
Output file.
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=0
Draw a polygon ( filled or not ).
static const int DO_NOT_SET_LINE_WIDTH
RENDER_SETTINGS * m_renderSettings
virtual int GetCurrentLineWidth() const
double GetDashMarkLenIU(int aLineWidth) const
static const double postscriptTextAscent
Height of the postscript font (from the AFM)
virtual void FlashRegularPolygon(const VECTOR2I &aShapePos, int aDiameter, int aCornerCount, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a regular polygon.
virtual void SetColor(const COLOR4D &color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
virtual void FlashPadRoundRect(const VECTOR2I &aPadPos, const VECTOR2I &aSize, int aCornerRadius, const EDA_ANGLE &aOrient, OUTLINE_MODE aTraceMode, void *aData) override
virtual void FlashPadCustom(const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData) override
virtual void FlashPadCircle(const VECTOR2I &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData) override
virtual void emitSetRGBColor(double r, double g, double b, double a)=0
Virtual primitive for emitting the setrgbcolor operator.
PLOT_TEXT_MODE m_textMode
How to draw text.
virtual void FlashPadTrapez(const VECTOR2I &aPadPos, const VECTOR2I *aCorners, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a trapezoidal pad.
virtual void FlashPadRect(const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
int returnPostscriptTextWidth(const wxString &aText, int aXSize, bool aItalic, bool aBold)
Sister function for the GraphicTextWidth in drawtxt.cpp Does the same processing (i....
double plotScaleAdjX
Fine user scale adjust ( = 1.0 if no correction)
void computeTextParameters(const VECTOR2I &aPos, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, bool aMirror, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, double *wideningFactor, double *ctm_a, double *ctm_b, double *ctm_c, double *ctm_d, double *ctm_e, double *ctm_f, double *heightFactor)
This is the core for postscript/PDF text alignment.
virtual std::string encodeStringForPlotter(const wxString &aUnicode)
convert a wxString unicode string to a char string compatible with the accepted string plotter format...
virtual void FlashPadOval(const VECTOR2I &aPadPos, const VECTOR2I &aSize, const EDA_ANGLE &aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
void postscriptOverlinePositions(const wxString &aText, int aXSize, bool aItalic, bool aBold, std::vector< int > *pos_pairs)
Computes the x coordinates for the overlining in a string of text.
virtual void Arc(const VECTOR2I &aCenter, const VECTOR2I &aStart, const VECTOR2I &aEnd, FILL_T aFill, int aWidth, int aMaxError) override
Generic fallback: arc rendered as a polyline.
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr) override
virtual bool EndPlot() override
virtual void Text(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, KIFONT::FONT *aFont=nullptr, void *aData=nullptr) override
Draw text with the plotter.
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
Draw a polygon ( filled or not ).
virtual void PlotImage(const wxImage &aImage, const VECTOR2I &aPos, double aScaleFactor) override
PostScript-likes at the moment are the only plot engines supporting bitmaps.
virtual void SetViewport(const VECTOR2I &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual void SetDash(int aLineWidth, PLOT_DASH_TYPE aLineStyle) override
PostScript supports dashed lines.
virtual void Circle(const VECTOR2I &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual bool StartPlot(const wxString &aPageNumber) override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
virtual void emitSetRGBColor(double r, double g, double b, double a) override
Virtual primitive for emitting the setrgbcolor operator.
virtual void SetCurrentLineWidth(int width, void *aData=nullptr) override
Set the current line width (in IUs) for the next plot.
virtual void PenTo(const VECTOR2I &pos, char plume) override
Moveto/lineto primitive, moves the 'pen' to the specified direction.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int OutlineCount() const
Return the number of outlines in the set.
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aPosition, const VECTOR2I &aSize, const EDA_ANGLE &aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle with rounded corners and/or chamfered corners to a polygon.
static constexpr EDA_ANGLE & ANGLE_90
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Plotting engines similar to ps (PostScript, Gerber, svg)
PLOT_DASH_TYPE
Dashed line types.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
double EuclideanNorm(const VECTOR2I &vector)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< double > VECTOR2D