KiCad PCB EDA Suite
plotters_pslike.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
26 #pragma once
27 
28 #include <vector>
29 #include <math/box2.h>
30 #include <eda_item.h> // FILL_TYPE
31 #include <plotter.h>
32 
33 
39 class PSLIKE_PLOTTER : public PLOTTER
40 {
41 public:
43  plotScaleAdjX( 1 ),
44  plotScaleAdjY( 1 ),
46  {
47  }
48 
52  virtual void SetTextMode( PLOT_TEXT_MODE mode ) override
53  {
54  if( mode != PLOT_TEXT_MODE::DEFAULT )
55  m_textMode = mode;
56  }
57 
61  void SetScaleAdjust( double scaleX, double scaleY )
62  {
63  plotScaleAdjX = scaleX;
64  plotScaleAdjY = scaleY;
65  }
66 
67  // Pad routines are handled with lower level primitives
68  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
69  OUTLINE_MODE aTraceMode, void* aData ) override;
70  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
71  OUTLINE_MODE aTraceMode, void* aData ) override;
72  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
73  double aPadOrient, OUTLINE_MODE aTraceMode,
74  void* aData ) override;
75  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
76  int aCornerRadius, double aOrient,
77  OUTLINE_MODE aTraceMode, void* aData ) override;
78  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize, double aOrient,
79  SHAPE_POLY_SET* aPolygons,
80  OUTLINE_MODE aTraceMode, void* aData ) override;
81  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
82  double aPadOrient, OUTLINE_MODE aTraceMode, void* aData ) override;
83  virtual void FlashRegularPolygon( const wxPoint& aShapePos, int aDiameter, int aCornerCount,
84  double aOrient, OUTLINE_MODE aTraceMode, void* aData ) override;
85 
91  virtual void SetColor( COLOR4D color ) override;
92 
93 protected:
94  void computeTextParameters( const wxPoint& aPos,
95  const wxString& aText,
96  int aOrient,
97  const wxSize& aSize,
98  bool aMirror,
99  enum EDA_TEXT_HJUSTIFY_T aH_justify,
100  enum EDA_TEXT_VJUSTIFY_T aV_justify,
101  int aWidth,
102  bool aItalic,
103  bool aBold,
104  double *wideningFactor,
105  double *ctm_a,
106  double *ctm_b,
107  double *ctm_c,
108  double *ctm_d,
109  double *ctm_e,
110  double *ctm_f,
111  double *heightFactor );
112  void postscriptOverlinePositions( const wxString& aText, int aXSize,
113  bool aItalic, bool aBold,
114  std::vector<int> *pos_pairs );
115 
118  virtual std::string encodeStringForPlotter( const wxString& aUnicode );
119 
121  virtual void emitSetRGBColor( double r, double g, double b ) = 0;
122 
124  static const double postscriptTextAscent; // = 0.718;
125 
126  int returnPostscriptTextWidth( const wxString& aText, int aXSize,
127  bool aItalic, bool aBold );
128 
131 
134 };
135 
136 
138 {
139 public:
141  {
142  // The phantom plot in postscript is an hack and reportedly
143  // crashes Adobe's own postscript interpreter!
145  }
146 
147  static wxString GetDefaultFileExtension()
148  {
149  return wxString( wxT( "ps" ) );
150  }
151 
152  virtual PLOT_FORMAT GetPlotterType() const override
153  {
154  return PLOT_FORMAT::POST;
155  }
156 
157  virtual bool StartPlot() override;
158  virtual bool EndPlot() override;
159  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
160  virtual void SetDash( PLOT_DASH_TYPE dashed ) override;
161 
162  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
163  double aScale, bool aMirror ) override;
164  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill,
165  int width = USE_DEFAULT_LINE_WIDTH ) override;
166  virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill,
167  int width = USE_DEFAULT_LINE_WIDTH ) override;
168  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
169  int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
170 
171  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
172  FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
173  void * aData = NULL ) override;
174 
175  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
176  double aScaleFactor ) override;
177 
178  virtual void PenTo( const wxPoint& pos, char plume ) override;
179  virtual void Text( const wxPoint& aPos,
180  const COLOR4D aColor,
181  const wxString& aText,
182  double aOrient,
183  const wxSize& aSize,
184  enum EDA_TEXT_HJUSTIFY_T aH_justify,
185  enum EDA_TEXT_VJUSTIFY_T aV_justify,
186  int aWidth,
187  bool aItalic,
188  bool aBold,
189  bool aMultilineAllowed = false,
190  void* aData = NULL ) override;
191 protected:
192  virtual void emitSetRGBColor( double r, double g, double b ) override;
193 };
194 
195 
197 {
198 public:
200  pageTreeHandle( 0 ),
201  fontResDictHandle( 0 ),
202  pageStreamHandle( 0 ),
203  streamLengthHandle( 0 ),
204  workFile( nullptr )
205  {
206  }
207 
208  virtual PLOT_FORMAT GetPlotterType() const override
209  {
210  return PLOT_FORMAT::PDF;
211  }
212 
213  static wxString GetDefaultFileExtension()
214  {
215  return wxString( wxT( "pdf" ) );
216  }
217 
227  virtual bool OpenFile( const wxString& aFullFilename ) override;
228 
234  virtual bool StartPlot() override;
235  virtual bool EndPlot() override;
236 
240  virtual void StartPage();
241 
245  virtual void ClosePage();
246 
255  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
256 
260  virtual void SetDash( PLOT_DASH_TYPE dashed ) override;
261 
266  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
267  double aScale, bool aMirror ) override;
268 
272  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill,
273  int width = USE_DEFAULT_LINE_WIDTH ) override;
274 
278  virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill,
279  int width = USE_DEFAULT_LINE_WIDTH ) override;
280 
285  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
286  int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
287 
291  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
292  FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
293  void * aData = NULL ) override;
294 
295  virtual void PenTo( const wxPoint& pos, char plume ) override;
296 
297  virtual void Text( const wxPoint& aPos,
298  const COLOR4D aColor,
299  const wxString& aText,
300  double aOrient,
301  const wxSize& aSize,
302  enum EDA_TEXT_HJUSTIFY_T aH_justify,
303  enum EDA_TEXT_VJUSTIFY_T aV_justify,
304  int aWidth,
305  bool aItalic,
306  bool aBold,
307  bool aMultilineAllowed = false,
308  void* aData = NULL ) override;
312  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
313  double aScaleFactor ) override;
314 
315 
316 protected:
319  std::string encodeStringForPlotter( const wxString& aUnicode ) override;
320 
330  virtual void emitSetRGBColor( double r, double g, double b ) override;
331 
337  int allocPdfObject();
338 
343  int startPdfObject(int handle = -1);
344 
348  void closePdfObject();
349 
356  int startPdfStream(int handle = -1);
357 
361  void closePdfStream();
362 
365  std::vector<int> pageHandles;
368  wxString workFilename;
369  FILE* workFile;
370  std::vector<long> xrefTable;
371 };
372 
373 
375 {
376 public:
377  SVG_PLOTTER();
378 
379  static wxString GetDefaultFileExtension()
380  {
381  return wxString( wxT( "svg" ) );
382  }
383 
384  virtual PLOT_FORMAT GetPlotterType() const override
385  {
386  return PLOT_FORMAT::SVG;
387  }
388 
389  virtual void SetColor( COLOR4D color ) override;
390  virtual bool StartPlot() override;
391  virtual bool EndPlot() override;
392  virtual void SetCurrentLineWidth( int width, void* aData = NULL ) override;
393  virtual void SetDash( PLOT_DASH_TYPE dashed ) override;
394 
395  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
396  double aScale, bool aMirror ) override;
397  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill,
398  int width = USE_DEFAULT_LINE_WIDTH ) override;
399  virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill,
400  int width = USE_DEFAULT_LINE_WIDTH ) override;
401  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
402  int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
403 
404  virtual void BezierCurve( const wxPoint& aStart, const wxPoint& aControl1,
405  const wxPoint& aControl2, const wxPoint& aEnd,
406  int aTolerance,
407  int aLineThickness = USE_DEFAULT_LINE_WIDTH ) override;
408 
409  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
410  FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
411  void * aData = NULL ) override;
412 
413  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
414  double aScaleFactor ) override;
415 
416  virtual void PenTo( const wxPoint& pos, char plume ) override;
417 
429  virtual void SetSvgCoordinatesFormat( unsigned aResolution, bool aUseInches = false ) override;
430 
436  virtual void StartBlock( void* aData ) override;
437 
443  virtual void EndBlock( void* aData ) override;
444 
445  virtual void Text( const wxPoint& aPos,
446  const COLOR4D aColor,
447  const wxString& aText,
448  double aOrient,
449  const wxSize& aSize,
450  enum EDA_TEXT_HJUSTIFY_T aH_justify,
451  enum EDA_TEXT_VJUSTIFY_T aV_justify,
452  int aWidth,
453  bool aItalic,
454  bool aBold,
455  bool aMultilineAllowed = false,
456  void* aData = NULL ) override;
457 
458 protected:
459  FILL_TYPE m_fillMode; // true if the current contour
460  // rect, arc, circle, polygon must be filled
461  long m_pen_rgb_color; // current rgb color value: each color has
462  // a value 0 ... 255, and the 3 colors are
463  // grouped in a 3x8 bits value
464  // (written in hex to svg files)
465  long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill
466  // some contours.
467  bool m_graphics_changed; // true if a pen/brush parameter is modified
468  // color, pen size, fill mode ...
469  // the new SVG stype must be output on file
470  PLOT_DASH_TYPE m_dashed; // plot line style
471  bool m_useInch; // is 0 if the step size is 10**-n*mm
472  // is 1 if the step size is 10**-n*inch
473  // Where n is given from m_precision
474  unsigned m_precision; // How fine the step size is
475  // Use 3-6 (3 means um precision, 6 nm precision) in PcbNew
476  // 3-4 in other modules (avoid values >4 to avoid overflow)
477  // see also comment for m_useInch.
478 
483  virtual void emitSetRGBColor( double r, double g, double b ) override;
484 
491  void setSVGPlotStyle( bool aIsGroup = true, const std::string& aExtraStyle = {} );
492 
496  void setFillMode( FILL_TYPE fill );
497 };
static wxString GetDefaultFileExtension()
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Definition: PS_plotter.cpp:420
OUTLINE_MODE
Definition: outline_mode.h:24
unsigned m_precision
void closePdfStream()
Finish the current PDF stream (writes the deferred length, too)
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:61
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
virtual void SetDash(PLOT_DASH_TYPE dashed) override
SVG supports dashed lines.
static wxString GetDefaultFileExtension()
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PostScript-likes at the moment are the only plot engines supporting bitmaps...
virtual PLOT_FORMAT GetPlotterType() const override
Returns the effective plot engine in use.
virtual void SetSvgCoordinatesFormat(unsigned aResolution, bool aUseInches=false) override
Select SVG step size (number of digits needed for 1 mm or 1 inch )
FILL_TYPE
The set of fill types used in plotting or drawing enclosed areas.
Definition: fill_type.h:28
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool EndPlot() override
virtual void emitSetRGBColor(double r, double g, double b) override
Virtual primitive for emitting the setrgbcolor operator.
Definition: PS_plotter.cpp:555
virtual void StartPage()
Starts a new page in the PDF document.
static wxString GetDefaultFileExtension()
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
Definition: PS_plotter.cpp:778
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
int color
Definition: DXF_plotter.cpp:60
The PSLIKE_PLOTTER class is an intermediate class to handle common routines for engines working more ...
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
virtual bool EndPlot() override
Definition: PS_plotter.cpp:983
virtual void PenTo(const wxPoint &pos, char plume) override
moveto/lineto primitive, moves the 'pen' to the specified direction
void setSVGPlotStyle(bool aIsGroup=true, const std::string &aExtraStyle={})
Output the string which define pen and brush color, shape, transparency.
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL) override
Draws text with the plotter.
virtual void FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:142
std::vector< int > pageHandles
Font resource dictionary.
virtual void SetDash(PLOT_DASH_TYPE dashed) override
PDF supports dashed lines.
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
The PDF engine can't directly plot arcs, it uses the base emulation.
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Rectangles in PDF.
PLOT_TEXT_MODE m_textMode
How to draw text.
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual std::string encodeStringForPlotter(const wxString &aUnicode)
convert a wxString unicode string to a char string compatible with the accepted string plotter format...
Definition: PS_plotter.cpp:316
PLOT_DASH_TYPE m_dashed
wxString workFilename
Handle to the deferred stream length.
virtual void FlashRegularPolygon(const wxPoint &aShapePos, int aDiameter, int aCornerCount, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a regular polygon.
Definition: PS_plotter.cpp:307
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL) override
Draws text with the plotter.
virtual bool EndPlot() override
virtual void ClosePage()
Close the current page in the PDF document (and emit its compressed stream)
int streamLengthHandle
Handle of the page content object.
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
Definition: PS_plotter.cpp:826
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:121
static const int USE_DEFAULT_LINE_WIDTH
Definition: plotter.h:126
virtual void FlashPadTrapez(const wxPoint &aPadPos, const wxPoint *aCorners, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Flash a trapezoidal pad.
Definition: PS_plotter.cpp:261
#define NULL
FILL_TYPE m_fillMode
virtual void emitSetRGBColor(double r, double g, double b)=0
Virtual primitive for emitting the setrgbcolor operator.
virtual void SetTextMode(PLOT_TEXT_MODE mode) override
PS and PDF fully implement native text (for the Latin-1 subset)
Represent a set of closed polygons.
int returnPostscriptTextWidth(const wxString &aText, int aXSize, bool aItalic, bool aBold)
Sister function for the GraphicTextWidth in drawtxt.cpp Does the same processing (i....
Definition: PS_plotter.cpp:361
int startPdfStream(int handle=-1)
Starts a PDF stream (for the page).
void setFillMode(FILL_TYPE fill)
Prepare parameters for setSVGPlotStyle()
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:67
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL) override
Draws text with the plotter.
Definition: PS_plotter.cpp:997
int startPdfObject(int handle=-1)
Open a new PDF object and returns the handle if the parameter is -1.
virtual void Arc(const wxPoint &centre, double StAngle, double EndAngle, int rayon, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: arc rendered as a polyline.
Definition: PS_plotter.cpp:612
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
PDF can have multiple pages, so SetPageSettings can be called with the outputFile open (but not insid...
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
Definition: PS_plotter.cpp:65
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:601
std::string encodeStringForPlotter(const wxString &aUnicode) override
convert a wxString unicode string to a char string compatible with the accepted string PDF format (co...
Definition: PDF_plotter.cpp:41
virtual bool StartPlot() override
The code within this function creates SVG files header.
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
Definition: PS_plotter.cpp:535
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Set the line width for the next drawing.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Polygon plotting for PDF.
void closePdfObject()
Close the current PDF object.
PLOT_DASH_TYPE
Dashed line types.
Definition: plotter.h:104
static const double postscriptTextAscent
Height of the postscript font (from the AFM)
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:68
int fontResDictHandle
Handle to the root of the page tree object.
virtual PLOT_FORMAT GetPlotterType() const override
Returns the effective plot engine in use.
Base plotter engine class.
Definition: plotter.h:121
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PostScript-likes at the moment are the only plot engines supporting bitmaps...
Definition: PS_plotter.cpp:674
virtual void emitSetRGBColor(double r, double g, double b) override
PDF supports colors fully.
std::vector< long > xrefTable
Temporary file to construct the stream before zipping.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:191
bool m_graphics_changed
long m_brush_rgb_color
double plotScaleAdjX
Fine user scale adjust ( = 1.0 if no correction)
virtual void FlashPadCustom(const wxPoint &aPadPos, const wxSize &aSize, double aOrient, SHAPE_POLY_SET *aPolygons, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:227
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
virtual void EndBlock(void *aData) override
Calling this function allows one to define the end of a group of drawing items the group is started b...
virtual void emitSetRGBColor(double r, double g, double b) override
Initialize m_pen_rgb_color from reduced values r, g ,b ( reduced values are 0.0 to 1....
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:590
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Draw a polygon ( filled or not )
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.
Definition: PS_plotter.cpp:390
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
virtual void StartBlock(void *aData) override
Calling this function allows one to define the beginning of a group of drawing items (used in SVG for...
void computeTextParameters(const wxPoint &aPos, const wxString &aText, int aOrient, const wxSize &aSize, bool aMirror, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_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 It computes the transformation matrix to generate ...
Definition: PS_plotter.cpp:442
PLOT_TEXT_MODE
Which kind of text to output with the PSLIKE plotters.
Definition: plotter.h:93
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=NULL) override
Draw a polygon ( filled or not )
Definition: PS_plotter.cpp:649
virtual bool StartPlot() override
The PDF engine supports multiple pages; the first one is opened 'for free' the following are to be cl...
virtual PLOT_FORMAT GetPlotterType() const override
Returns the effective plot engine in use.
int allocPdfObject()
Allocate a new handle in the table of the PDF object.
virtual void Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Circle drawing for PDF.
int pageStreamHandle
Handles to the page objects.
virtual void BezierCurve(const wxPoint &aStart, const wxPoint &aControl1, const wxPoint &aControl2, const wxPoint &aEnd, int aTolerance, int aLineThickness=USE_DEFAULT_LINE_WIDTH) override
Generic fallback: Cubic Bezier curve rendered as a polyline In KiCad the bezier curves have 4 control...
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:91
virtual void SetCurrentLineWidth(int width, void *aData=NULL) override
Pen width setting for PDF.
virtual void SetDash(PLOT_DASH_TYPE dashed) override
PostScript supports dashed lines.
Definition: PS_plotter.cpp:567
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PDF images are handles as inline, not XObject streams...