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-2021 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 "plotter.h"
29 
30 
35 class PSLIKE_PLOTTER : public PLOTTER
36 {
37 public:
39  plotScaleAdjX( 1 ),
40  plotScaleAdjY( 1 ),
42  {
43  }
44 
48  virtual void SetTextMode( PLOT_TEXT_MODE mode ) override
49  {
50  if( mode != PLOT_TEXT_MODE::DEFAULT )
51  m_textMode = mode;
52  }
53 
57  void SetScaleAdjust( double scaleX, double scaleY )
58  {
59  plotScaleAdjX = scaleX;
60  plotScaleAdjY = scaleY;
61  }
62 
63  // Pad routines are handled with lower level primitives
64  virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
65  OUTLINE_MODE aTraceMode, void* aData ) override;
66  virtual void FlashPadOval( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
67  OUTLINE_MODE aTraceMode, void* aData ) override;
68  virtual void FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize, double aPadOrient,
69  OUTLINE_MODE aTraceMode, void* aData ) override;
70  virtual void FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSize,
71  int aCornerRadius, double aOrient,
72  OUTLINE_MODE aTraceMode, void* aData ) override;
73  virtual void FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize, double aOrient,
74  SHAPE_POLY_SET* aPolygons,
75  OUTLINE_MODE aTraceMode, void* aData ) override;
76  virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
77  double aPadOrient, OUTLINE_MODE aTraceMode, void* aData ) override;
78  virtual void FlashRegularPolygon( const wxPoint& aShapePos, int aDiameter, int aCornerCount,
79  double aOrient, OUTLINE_MODE aTraceMode,
80  void* aData ) override;
81 
87  virtual void SetColor( const COLOR4D& color ) override;
88 
89 protected:
98  void computeTextParameters( const wxPoint& aPos,
99  const wxString& aText,
100  int aOrient,
101  const wxSize& aSize,
102  bool aMirror,
103  enum EDA_TEXT_HJUSTIFY_T aH_justify,
104  enum EDA_TEXT_VJUSTIFY_T aV_justify,
105  int aWidth,
106  bool aItalic,
107  bool aBold,
108  double *wideningFactor,
109  double *ctm_a,
110  double *ctm_b,
111  double *ctm_c,
112  double *ctm_d,
113  double *ctm_e,
114  double *ctm_f,
115  double *heightFactor );
116 
123  void postscriptOverlinePositions( const wxString& aText, int aXSize, bool aItalic, bool aBold,
124  std::vector<int> *pos_pairs );
125 
128  virtual std::string encodeStringForPlotter( const wxString& aUnicode );
129 
131  virtual void emitSetRGBColor( double r, double g, double b ) = 0;
132 
134  static const double postscriptTextAscent; // = 0.718;
135 
142  int returnPostscriptTextWidth( const wxString& aText, int aXSize, bool aItalic, bool aBold );
143 
146 
149 };
150 
151 
153 {
154 public:
156  {
157  // The phantom plot in postscript is an hack and reportedly
158  // crashes Adobe's own postscript interpreter!
160  }
161 
162  static wxString GetDefaultFileExtension()
163  {
164  return wxString( wxT( "ps" ) );
165  }
166 
167  virtual PLOT_FORMAT GetPlotterType() const override
168  {
169  return PLOT_FORMAT::POST;
170  }
171 
185  virtual bool StartPlot() override;
186  virtual bool EndPlot() override;
187 
191  virtual void SetCurrentLineWidth( int width, void* aData = nullptr ) override;
192 
196  virtual void SetDash( PLOT_DASH_TYPE dashed ) override;
197 
198  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
199  double aScale, bool aMirror ) override;
200  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill,
201  int width = USE_DEFAULT_LINE_WIDTH ) override;
202  virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill,
203  int width = USE_DEFAULT_LINE_WIDTH ) override;
204  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
205  int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
206 
207  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_TYPE aFill,
208  int aWidth = USE_DEFAULT_LINE_WIDTH, void* aData = nullptr ) override;
209 
213  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
214  double aScaleFactor ) override;
215 
216  virtual void PenTo( const wxPoint& pos, char plume ) override;
217  virtual void Text( const wxPoint& aPos,
218  const COLOR4D& aColor,
219  const wxString& aText,
220  double aOrient,
221  const wxSize& aSize,
222  enum EDA_TEXT_HJUSTIFY_T aH_justify,
223  enum EDA_TEXT_VJUSTIFY_T aV_justify,
224  int aWidth,
225  bool aItalic,
226  bool aBold,
227  bool aMultilineAllowed = false,
228  void* aData = nullptr ) override;
229 protected:
230  virtual void emitSetRGBColor( double r, double g, double b ) override;
231 };
232 
233 
235 {
236 public:
238  pageTreeHandle( 0 ),
239  fontResDictHandle( 0 ),
240  pageStreamHandle( 0 ),
241  streamLengthHandle( 0 ),
242  workFile( nullptr )
243  {
244  }
245 
246  virtual PLOT_FORMAT GetPlotterType() const override
247  {
248  return PLOT_FORMAT::PDF;
249  }
250 
251  static wxString GetDefaultFileExtension()
252  {
253  return wxString( wxT( "pdf" ) );
254  }
255 
265  virtual bool OpenFile( const wxString& aFullFilename ) override;
266 
271  virtual bool StartPlot() override;
272  virtual bool EndPlot() override;
273 
277  virtual void StartPage();
278 
282  virtual void ClosePage();
283 
292  virtual void SetCurrentLineWidth( int width, void* aData = nullptr ) override;
293 
297  virtual void SetDash( PLOT_DASH_TYPE dashed ) override;
298 
303  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
304  double aScale, bool aMirror ) override;
305 
309  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill,
310  int width = USE_DEFAULT_LINE_WIDTH ) override;
311 
315  virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill,
316  int width = USE_DEFAULT_LINE_WIDTH ) override;
317 
322  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
323  int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
324 
328  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_TYPE aFill,
329  int aWidth = USE_DEFAULT_LINE_WIDTH, void* aData = nullptr ) override;
330 
331  virtual void PenTo( const wxPoint& pos, char plume ) override;
332 
333  virtual void Text( const wxPoint& aPos,
334  const COLOR4D& aColor,
335  const wxString& aText,
336  double aOrient,
337  const wxSize& aSize,
338  enum EDA_TEXT_HJUSTIFY_T aH_justify,
339  enum EDA_TEXT_VJUSTIFY_T aV_justify,
340  int aWidth,
341  bool aItalic,
342  bool aBold,
343  bool aMultilineAllowed = false,
344  void* aData = nullptr ) override;
348  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
349  double aScaleFactor ) override;
350 
351 
352 protected:
355  std::string encodeStringForPlotter( const wxString& aUnicode ) override;
356 
366  virtual void emitSetRGBColor( double r, double g, double b ) override;
367 
373  int allocPdfObject();
374 
379  int startPdfObject(int handle = -1);
380 
384  void closePdfObject();
385 
392  int startPdfStream(int handle = -1);
393 
397  void closePdfStream();
398 
401  std::vector<int> pageHandles;
404  wxString workFilename;
405  FILE* workFile;
406  std::vector<long> xrefTable;
407 };
408 
409 
411 {
412 public:
413  SVG_PLOTTER();
414 
415  static wxString GetDefaultFileExtension()
416  {
417  return wxString( wxT( "svg" ) );
418  }
419 
420  virtual PLOT_FORMAT GetPlotterType() const override
421  {
422  return PLOT_FORMAT::SVG;
423  }
424 
425  virtual void SetColor( const COLOR4D& color ) override;
426 
430  virtual bool StartPlot() override;
431  virtual bool EndPlot() override;
432 
436  virtual void SetCurrentLineWidth( int width, void* aData = nullptr ) override;
437 
441  virtual void SetDash( PLOT_DASH_TYPE dashed ) override;
442 
443  virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
444  double aScale, bool aMirror ) override;
445  virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill,
446  int width = USE_DEFAULT_LINE_WIDTH ) override;
447  virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill,
448  int width = USE_DEFAULT_LINE_WIDTH ) override;
449  virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
450  int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override;
451 
452  virtual void BezierCurve( const wxPoint& aStart, const wxPoint& aControl1,
453  const wxPoint& aControl2, const wxPoint& aEnd,
454  int aTolerance,
455  int aLineThickness = USE_DEFAULT_LINE_WIDTH ) override;
456 
457  virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
458  FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH,
459  void * aData = nullptr ) override;
460 
464  virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos,
465  double aScaleFactor ) override;
466 
467  virtual void PenTo( const wxPoint& pos, char plume ) override;
468 
480  virtual void SetSvgCoordinatesFormat( unsigned aResolution, bool aUseInches = false ) override;
481 
487  virtual void StartBlock( void* aData ) override;
488 
494  virtual void EndBlock( void* aData ) override;
495 
496  virtual void Text( const wxPoint& aPos,
497  const COLOR4D& aColor,
498  const wxString& aText,
499  double aOrient,
500  const wxSize& aSize,
501  enum EDA_TEXT_HJUSTIFY_T aH_justify,
502  enum EDA_TEXT_VJUSTIFY_T aV_justify,
503  int aWidth,
504  bool aItalic,
505  bool aBold,
506  bool aMultilineAllowed = false,
507  void* aData = nullptr ) override;
508 
509 protected:
514  virtual void emitSetRGBColor( double r, double g, double b ) override;
515 
522  void setSVGPlotStyle( bool aIsGroup = true, const std::string& aExtraStyle = {} );
523 
527  void setFillMode( FILL_TYPE fill );
528 
529  FILL_TYPE m_fillMode; // true if the current contour
530  // rect, arc, circle, polygon must be filled
531  long m_pen_rgb_color; // current rgb color value: each color has
532  // a value 0 ... 255, and the 3 colors are
533  // grouped in a 3x8 bits value
534  // (written in hex to svg files)
535  long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill
536  // some contours.
537  bool m_graphics_changed; // true if a pen/brush parameter is modified
538  // color, pen size, fill mode ...
539  // the new SVG stype must be output on file
540  PLOT_DASH_TYPE m_dashed; // plot line style
541  bool m_useInch; // is 0 if the step size is 10**-n*mm
542  // is 1 if the step size is 10**-n*inch
543  // Where n is given from m_precision
544  unsigned m_precision; // How fine the step size is
545  // Use 3-6 (3 means um precision, 6 nm precision) in PcbNew
546  // 3-4 in other modules (avoid values >4 to avoid overflow)
547  // see also comment for m_useInch.
548 };
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:548
virtual void StartPage()
Start a new page in the PDF document.
static wxString GetDefaultFileExtension()
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=nullptr) override
Draw text with the plotter.
virtual void PenTo(const wxPoint &pos, char plume) override
Moveto/lineto primitive, moves the 'pen' to the specified direction.
Definition: PS_plotter.cpp:768
void SetScaleAdjust(double scaleX, double scaleY)
Set the 'fine' scaling for the postscript engine.
int color
Definition: DXF_plotter.cpp:57
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:960
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 FlashPadRect(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:143
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=nullptr) override
Draw text with the plotter.
Definition: PS_plotter.cpp:974
std::vector< int > pageHandles
Font resource dictionary.
virtual void SetCurrentLineWidth(int width, void *aData=nullptr) override
Set the current line width (in IUs) for the next plot.
Definition: PS_plotter.cpp:528
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 SetColor(const COLOR4D &color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
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:325
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:317
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:803
virtual void FlashPadCircle(const wxPoint &aPadPos, int aDiameter, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:120
static const int USE_DEFAULT_LINE_WIDTH
Definition: plotter.h:126
virtual void SetColor(const COLOR4D &color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
Definition: PS_plotter.cpp:62
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:270
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
Draw a polygon ( filled or not ).
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:365
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
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:602
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 Circle(const wxPoint &pos, int diametre, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:591
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:43
virtual bool StartPlot() override
Create SVG file header.
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:661
virtual void emitSetRGBColor(double r, double g, double b) override
PDF supports colors fully.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
Draw a polygon ( filled or not ).
Definition: PS_plotter.cpp:639
std::vector< long > xrefTable
Temporary file to construct the stream before zipping.
virtual void SetCurrentLineWidth(int width, void *aData=nullptr) override
Set the current line width (in IUs) for the next plot.
virtual void FlashPadRoundRect(const wxPoint &aPadPos, const wxSize &aSize, int aCornerRadius, double aOrient, OUTLINE_MODE aTraceMode, void *aData) override
Definition: PS_plotter.cpp:193
virtual void SetCurrentLineWidth(int width, void *aData=nullptr) override
Pen width setting for PDF.
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:233
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:580
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:388
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
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=nullptr) override
Draw text with the plotter.
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.
Definition: PS_plotter.cpp:437
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_TYPE aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr) override
Polygon plotting for PDF.
PLOT_TEXT_MODE
Which kind of text to output with the PSLIKE plotters.
Definition: plotter.h:93
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:90
virtual void SetDash(PLOT_DASH_TYPE dashed) override
PostScript supports dashed lines.
Definition: PS_plotter.cpp:557
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
virtual void PlotImage(const wxImage &aImage, const wxPoint &aPos, double aScaleFactor) override
PDF images are handles as inline, not XObject streams...