2009-03-02 13:43:52 +00:00
|
|
|
/**
|
|
|
|
* Functions to draw and plot text on screen
|
2009-03-28 20:02:34 +00:00
|
|
|
* @file drawtxt.cpp
|
2009-03-02 13:43:52 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "plot_common.h"
|
|
|
|
|
|
|
|
#include "trigo.h"
|
|
|
|
#include "macros.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
|
|
|
#include "class_base_screen.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#ifndef DEFAULT_SIZE_TEXT
|
2009-03-02 13:43:52 +00:00
|
|
|
# define DEFAULT_SIZE_TEXT 50
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define EDA_DRAWBASE
|
|
|
|
#include "grfonte.h"
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
|
|
|
|
/** Function DrawGraphicText
|
|
|
|
* Draw a graphic text (like module texts)
|
2009-01-30 14:11:36 +00:00
|
|
|
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
|
|
|
|
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
|
2008-12-16 19:44:57 +00:00
|
|
|
* @param aPos = text position (according to h_justify, v_justify)
|
2008-12-14 19:45:05 +00:00
|
|
|
* @param aColor (enum EDA_Colors) = text color
|
|
|
|
* @param aText = text to draw
|
|
|
|
* @param aOrient = angle in 0.1 degree
|
|
|
|
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
|
|
|
|
* @param aH_justify = horizontal justification (Left, center, right)
|
|
|
|
* @param aV_justify = vertical justification (bottom, center, top)
|
2008-12-16 19:44:57 +00:00
|
|
|
* @param aWidth = line width (pen width) (default = 0)
|
|
|
|
* if width < 0 : draw segments in sketch mode, width = abs(width)
|
|
|
|
* @param aItalic = true to simulate an italic font
|
|
|
|
* @param aCallback() = function called (if non null) to draw each segment.
|
2009-01-30 14:11:36 +00:00
|
|
|
* used to draw 3D texts or for plotting, NULL for normal drawings
|
2008-01-19 20:34:10 +00:00
|
|
|
*/
|
2009-03-02 13:43:52 +00:00
|
|
|
/****************************************************************************************************/
|
|
|
|
void DrawGraphicText( WinEDA_DrawPanel* aPanel,
|
|
|
|
wxDC* aDC,
|
|
|
|
const wxPoint& aPos,
|
|
|
|
EDA_Colors aColor,
|
|
|
|
const wxString& aText,
|
|
|
|
int aOrient,
|
|
|
|
const wxSize& aSize,
|
|
|
|
enum GRTextHorizJustifyType aH_justify,
|
|
|
|
enum GRTextVertJustifyType aV_justify,
|
|
|
|
int aWidth,
|
|
|
|
bool aItalic,
|
|
|
|
void (* aCallback) (int x0, int y0, int xf, int yf))
|
|
|
|
/****************************************************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-03-28 20:02:34 +00:00
|
|
|
int kk, char_count, AsciiCode;
|
2008-12-16 19:44:57 +00:00
|
|
|
int x0, y0;
|
2008-12-19 20:40:08 +00:00
|
|
|
int size_h, size_v, pitch;
|
2008-01-19 20:34:10 +00:00
|
|
|
SH_CODE f_cod, plume = 'U';
|
|
|
|
const SH_CODE* ptcar;
|
|
|
|
int ptr;
|
|
|
|
int ux0, uy0, dx, dy; // Draw coordinate for segments to draw. also used in some other calculation
|
|
|
|
int cX, cY; // Texte center
|
|
|
|
int ox, oy; // Draw coordinates for the current char
|
2009-03-28 20:02:34 +00:00
|
|
|
#define BUF_SIZE 100
|
|
|
|
wxPoint coord[BUF_SIZE+1]; // Buffer coordinate used to draw polylines (one char shape)
|
2008-12-16 19:44:57 +00:00
|
|
|
bool sketch_mode = false;
|
2009-03-28 20:02:34 +00:00
|
|
|
bool italic_reverse = false; // true for mirrored texts with m_Size.x < 0
|
2008-01-19 20:34:10 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
size_h = aSize.x;
|
|
|
|
size_v = aSize.y;
|
2008-01-19 20:34:10 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
if( aWidth < 0 )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
2008-12-14 19:45:05 +00:00
|
|
|
aWidth = -aWidth;
|
2009-03-28 20:02:34 +00:00
|
|
|
sketch_mode = true;
|
2008-01-19 20:34:10 +00:00
|
|
|
}
|
2008-12-20 13:12:57 +00:00
|
|
|
int thickness = aWidth;
|
2008-12-20 20:38:39 +00:00
|
|
|
if ( aSize.x < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis)
|
|
|
|
italic_reverse = true;
|
2008-12-16 19:44:57 +00:00
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
kk = 0;
|
2008-01-19 20:34:10 +00:00
|
|
|
ptr = 0; /* ptr = text index */
|
|
|
|
|
2008-12-16 19:44:57 +00:00
|
|
|
char_count = aText.Len();
|
|
|
|
if( char_count == 0 )
|
2008-01-19 20:34:10 +00:00
|
|
|
return;
|
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
pitch = (10 * size_h ) / 9; // this is the pitch between chars
|
|
|
|
if ( pitch > 0 )
|
2008-12-20 13:12:57 +00:00
|
|
|
pitch += ABS(thickness);
|
2008-12-16 19:44:57 +00:00
|
|
|
else
|
2008-12-20 13:12:57 +00:00
|
|
|
pitch -= ABS(thickness);
|
2008-12-16 19:44:57 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
ox = cX = aPos.x;
|
|
|
|
oy = cY = aPos.y;
|
2008-01-19 20:34:10 +00:00
|
|
|
|
|
|
|
/* Do not draw the text if out of draw area! */
|
2008-12-14 19:45:05 +00:00
|
|
|
if( aPanel )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
int xm, ym, ll, xc, yc;
|
2008-12-19 20:40:08 +00:00
|
|
|
int textsize = ABS( pitch );
|
2009-01-29 14:26:20 +00:00
|
|
|
ll = aPanel->GetScreen()->Scale( textsize * char_count );
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
xc = GRMapX( cX );
|
|
|
|
yc = GRMapY( cY );
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
x0 = aPanel->m_ClipBox.GetX() - ll;
|
|
|
|
y0 = aPanel->m_ClipBox.GetY() - ll;
|
|
|
|
xm = aPanel->m_ClipBox.GetRight() + ll;
|
|
|
|
ym = aPanel->m_ClipBox.GetBottom() + ll;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
if( xc < x0 )
|
|
|
|
return;
|
|
|
|
if( yc < y0 )
|
|
|
|
return;
|
|
|
|
if( xc > xm )
|
|
|
|
return;
|
|
|
|
if( yc > ym )
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Compute the position ux0, uy0 of the first letter , next */
|
2008-12-19 20:40:08 +00:00
|
|
|
dx = (pitch * char_count) / 2;
|
2008-01-19 20:34:10 +00:00
|
|
|
dy = size_v / 2; /* dx, dy = draw offset between first letter and text center */
|
|
|
|
|
|
|
|
ux0 = uy0 = 0; /* Decalage du centre du texte / coord de ref */
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
if( (aOrient == 0) || (aOrient == 1800) ) /* Horizontal Text */
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
2008-12-14 19:45:05 +00:00
|
|
|
switch( aH_justify )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
case GR_TEXT_HJUSTIFY_CENTER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_HJUSTIFY_RIGHT:
|
|
|
|
ux0 = -dx;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_HJUSTIFY_LEFT:
|
|
|
|
ux0 = dx;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
switch( aV_justify )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
case GR_TEXT_VJUSTIFY_CENTER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_VJUSTIFY_TOP:
|
|
|
|
uy0 = dy;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_VJUSTIFY_BOTTOM:
|
|
|
|
uy0 = -dy;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else /* Vertical Text */
|
|
|
|
{
|
2008-12-14 19:45:05 +00:00
|
|
|
switch( aH_justify )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
case GR_TEXT_HJUSTIFY_CENTER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_HJUSTIFY_RIGHT:
|
|
|
|
ux0 = -dy;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_HJUSTIFY_LEFT:
|
|
|
|
ux0 = dy;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
switch( aV_justify )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
case GR_TEXT_VJUSTIFY_CENTER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_VJUSTIFY_TOP:
|
|
|
|
uy0 = dx;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GR_TEXT_VJUSTIFY_BOTTOM:
|
|
|
|
uy0 = -dx;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-03-22 05:55:06 +00:00
|
|
|
|
|
|
|
cX += ux0;
|
2008-01-19 20:34:10 +00:00
|
|
|
cY += uy0;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
ox = cX - dx;
|
|
|
|
oy = cY + dy;
|
|
|
|
|
2009-01-30 14:11:36 +00:00
|
|
|
// Note: if aPanel == NULL, we are using a GL Canvas that handle scaling
|
|
|
|
if( aPanel && aPanel->GetScreen()->Scale( aSize.x ) == 0 )
|
2008-01-19 20:34:10 +00:00
|
|
|
return;
|
|
|
|
|
2009-01-30 14:11:36 +00:00
|
|
|
if( aPanel && ABS( (aPanel->GetScreen()->Scale( aSize.x ) ) ) < 3 ) /* shapes are too small: connot be drawn */
|
2008-12-20 13:12:57 +00:00
|
|
|
{ /* insteed the text is drawn as a line */
|
2008-12-19 20:40:08 +00:00
|
|
|
dx = (pitch * char_count) / 2;
|
2008-12-20 13:12:57 +00:00
|
|
|
dy = size_v / 2; /* line is always centered */
|
2008-01-19 20:34:10 +00:00
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
ux0 = cX - dx;
|
2008-01-19 20:34:10 +00:00
|
|
|
uy0 = cY;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
|
|
|
dx += cX;
|
2008-01-19 20:34:10 +00:00
|
|
|
dy = cY;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
RotatePoint( &ux0, &uy0, cX, cY, aOrient );
|
|
|
|
RotatePoint( &dx, &dy, cX, cY, aOrient );
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-12-16 19:44:57 +00:00
|
|
|
if ( aCallback )
|
|
|
|
aCallback( ux0, uy0, dx, dy );
|
|
|
|
else
|
2009-01-30 14:11:36 +00:00
|
|
|
GRLine( &aPanel->m_ClipBox, aDC, ux0, uy0, dx, dy, aWidth, aColor );
|
2008-01-19 20:34:10 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-12-16 19:44:57 +00:00
|
|
|
while( kk++ < char_count )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
x0 = 0; y0 = 0;
|
2008-11-05 11:41:15 +00:00
|
|
|
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
|
2008-12-14 19:45:05 +00:00
|
|
|
AsciiCode = aText.GetChar(ptr) & 0x7FF;
|
2008-11-05 11:41:15 +00:00
|
|
|
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
|
|
|
|
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
|
|
|
|
else
|
|
|
|
AsciiCode = AsciiCode & 0xFF;
|
|
|
|
#else
|
2008-12-14 19:45:05 +00:00
|
|
|
AsciiCode = aText.GetChar( ptr ) & 0xFF;
|
2008-11-05 11:41:15 +00:00
|
|
|
#endif
|
2008-01-19 20:34:10 +00:00
|
|
|
ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description
|
|
|
|
* du caractere a dessiner */
|
|
|
|
|
2009-03-28 20:02:34 +00:00
|
|
|
int point_count;
|
|
|
|
bool endcar;
|
|
|
|
for( point_count = 0, endcar = false; !endcar; ptcar++ )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
f_cod = *ptcar;
|
|
|
|
|
|
|
|
/* get code n de la forme selectionnee */
|
|
|
|
switch( f_cod )
|
|
|
|
{
|
|
|
|
case 'X':
|
2009-03-28 20:02:34 +00:00
|
|
|
endcar = true; /* fin du caractere */
|
2008-01-19 20:34:10 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'U':
|
2009-03-28 20:02:34 +00:00
|
|
|
if( point_count && (plume == 'D' ) )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
2008-12-14 19:45:05 +00:00
|
|
|
if( aWidth <= 1 )
|
2008-12-16 19:44:57 +00:00
|
|
|
aWidth = 0;
|
|
|
|
if ( aCallback )
|
|
|
|
{
|
2009-03-28 20:02:34 +00:00
|
|
|
for( int ik = 0; ik < (point_count - 1); ik ++ )
|
|
|
|
{
|
|
|
|
aCallback( coord[ik].x, coord[ik].y,
|
|
|
|
coord[ik+1].x, coord[ik+1].y );
|
|
|
|
}
|
2008-12-16 19:44:57 +00:00
|
|
|
}
|
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
else if( sketch_mode )
|
|
|
|
{
|
2009-03-28 20:02:34 +00:00
|
|
|
for( int ik = 0; ik < (point_count - 1); ik ++ )
|
|
|
|
GRCSegm( &aPanel->m_ClipBox, aDC, coord[ik].x, coord[ik].y,
|
|
|
|
coord[ik+1].x, coord[ik+1].y, aWidth, aColor );
|
2008-01-19 20:34:10 +00:00
|
|
|
}
|
|
|
|
else
|
2009-03-28 20:02:34 +00:00
|
|
|
GRPoly( &aPanel->m_ClipBox, aDC, point_count, coord, 0,
|
2008-12-14 19:45:05 +00:00
|
|
|
aWidth, aColor, aColor );
|
2008-01-19 20:34:10 +00:00
|
|
|
}
|
2009-03-28 20:02:34 +00:00
|
|
|
plume = f_cod; point_count = 0;
|
2008-01-19 20:34:10 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'D':
|
2008-03-22 05:55:06 +00:00
|
|
|
plume = f_cod;
|
2008-01-19 20:34:10 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
2008-12-16 19:44:57 +00:00
|
|
|
int y, k1, k2;
|
|
|
|
y = k1 = f_cod; /* trace sur axe V */
|
2008-01-19 20:34:10 +00:00
|
|
|
k1 = -( (k1 * size_v) / 9 );
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
ptcar++;
|
|
|
|
f_cod = *ptcar;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
k2 = f_cod; /* trace sur axe H */
|
|
|
|
k2 = (k2 * size_h) / 9;
|
2008-12-16 19:44:57 +00:00
|
|
|
// To simulate an italic font, add a x offset depending on the y offset
|
|
|
|
if ( aItalic )
|
2008-12-20 20:38:39 +00:00
|
|
|
k2 -= italic_reverse ? - k1/8 : k1/8;
|
2008-01-19 20:34:10 +00:00
|
|
|
dx = k2 + ox; dy = k1 + oy;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
RotatePoint( &dx, &dy, cX, cY, aOrient );
|
2009-03-28 20:02:34 +00:00
|
|
|
coord[point_count].x = dx;
|
|
|
|
coord[point_count].y = dy;
|
|
|
|
if ( point_count < BUF_SIZE-1 )
|
|
|
|
point_count++;
|
2008-01-19 20:34:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* end switch */
|
|
|
|
}
|
|
|
|
|
2008-12-16 19:44:57 +00:00
|
|
|
/* end draw 1 char */
|
2008-01-19 20:34:10 +00:00
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
ptr++; ox += pitch;
|
2008-01-19 20:34:10 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
|
|
|
|
/* functions used to plot texts, using DrawGraphicText() with a call back function */
|
|
|
|
static void (*MovePenFct)( wxPoint pos, int state ); // a pointer to actual plot function (HPGL, PS, ..)
|
|
|
|
static bool s_Plotbegin; // Flag to init plot
|
2009-03-02 13:43:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The call back function
|
|
|
|
*/
|
|
|
|
/**********************/
|
|
|
|
static void
|
|
|
|
s_Callback_plot(int x0,
|
|
|
|
int y0,
|
|
|
|
int xf,
|
|
|
|
int yf)
|
|
|
|
/**********************/
|
2008-12-19 20:40:08 +00:00
|
|
|
{
|
|
|
|
static wxPoint PenLastPos;
|
|
|
|
wxPoint pstart;
|
|
|
|
pstart.x = x0;
|
|
|
|
pstart.y = y0;
|
|
|
|
wxPoint pend;
|
|
|
|
pend.x = xf;
|
|
|
|
pend.y = yf;
|
|
|
|
if ( s_Plotbegin ) // First segment to plot
|
|
|
|
{
|
|
|
|
MovePenFct( pstart, 'U' );
|
|
|
|
MovePenFct( pend, 'D' );
|
|
|
|
s_Plotbegin = false;
|
|
|
|
}
|
2008-12-20 13:12:57 +00:00
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( PenLastPos == pstart ) // this is a next segment in a polyline
|
|
|
|
{
|
|
|
|
MovePenFct( pend, 'D' );
|
|
|
|
}
|
|
|
|
else // New segment to plot
|
|
|
|
{
|
|
|
|
MovePenFct( pstart, 'U' );
|
|
|
|
MovePenFct( pend, 'D' );
|
|
|
|
}
|
|
|
|
}
|
2008-12-20 13:12:57 +00:00
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
PenLastPos = pend;
|
|
|
|
}
|
2008-12-22 21:06:44 +00:00
|
|
|
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
/** Function PlotGraphicText
|
|
|
|
* same as DrawGraphicText, but plot graphic text insteed of draw it
|
|
|
|
* @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER)
|
|
|
|
* @param aPos = text position (according to aH_justify, aV_justify)
|
|
|
|
* @param aColor (enum EDA_Colors) = text color
|
|
|
|
* @param aText = text to draw
|
|
|
|
* @param aOrient = angle in 0.1 degree
|
|
|
|
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
|
|
|
|
* @param aH_justify = horizontal justification (Left, center, right)
|
|
|
|
* @param aV_justify = vertical justification (bottom, center, top)
|
2008-12-19 20:40:08 +00:00
|
|
|
* @param aWidth = line width (pen width) (default = 0)
|
|
|
|
* if width < 0 : draw segments in sketch mode, width = abs(width)
|
|
|
|
* @param aItalic = true to simulate an italic font
|
2008-01-19 20:34:10 +00:00
|
|
|
*/
|
2009-03-02 13:43:52 +00:00
|
|
|
/******************************************************************************************/
|
|
|
|
void PlotGraphicText( int aFormat_plot,
|
|
|
|
const wxPoint& aPos,
|
|
|
|
enum EDA_Colors aColor,
|
|
|
|
const wxString& aText,
|
|
|
|
int aOrient,
|
|
|
|
const wxSize& aSize,
|
|
|
|
enum GRTextHorizJustifyType aH_justify,
|
|
|
|
enum GRTextVertJustifyType aV_justify,
|
|
|
|
int aWidth,
|
|
|
|
bool aItalic )
|
|
|
|
/******************************************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-12-19 20:40:08 +00:00
|
|
|
// Initialise the actual function used to plot lines:
|
2008-12-14 19:45:05 +00:00
|
|
|
switch( aFormat_plot )
|
2008-01-19 20:34:10 +00:00
|
|
|
{
|
|
|
|
case PLOT_FORMAT_POST:
|
2008-12-19 20:40:08 +00:00
|
|
|
MovePenFct = LineTo_PS;
|
2008-01-19 20:34:10 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PLOT_FORMAT_HPGL:
|
2008-12-19 20:40:08 +00:00
|
|
|
MovePenFct = Move_Plume_HPGL;
|
2008-01-19 20:34:10 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PLOT_FORMAT_GERBER:
|
2008-12-22 21:06:44 +00:00
|
|
|
MovePenFct = LineTo_GERBER;
|
|
|
|
break;
|
|
|
|
|
2008-01-19 20:34:10 +00:00
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
if( aColor >= 0 && IsPostScript( aFormat_plot ) )
|
|
|
|
SetColorMapPS( aColor );
|
2008-01-19 20:34:10 +00:00
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
s_Plotbegin = true;
|
|
|
|
DrawGraphicText( NULL, NULL, aPos, aColor, aText,
|
|
|
|
aOrient, aSize,
|
|
|
|
aH_justify, aV_justify,
|
|
|
|
aWidth, aItalic,
|
|
|
|
s_Callback_plot);
|
2008-01-19 20:34:10 +00:00
|
|
|
|
2008-12-19 20:40:08 +00:00
|
|
|
/* end text : pen UP ,no move */
|
|
|
|
MovePenFct( wxPoint( 0, 0 ), 'Z' );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
2009-03-02 13:43:52 +00:00
|
|
|
|