Commit 42b4cae4 authored by charras's avatar charras

commit hershey patch

parent 8ff28f7b
...@@ -175,6 +175,7 @@ EDA_TextStruct::EDA_TextStruct( const wxString& text ) ...@@ -175,6 +175,7 @@ EDA_TextStruct::EDA_TextStruct( const wxString& text )
m_VJustify = GR_TEXT_VJUSTIFY_CENTER; /* Justifications Horiz et Vert du texte */ m_VJustify = GR_TEXT_VJUSTIFY_CENTER; /* Justifications Horiz et Vert du texte */
m_Width = 0; /* thickness */ m_Width = 0; /* thickness */
m_Italic = false; /* true = italic shape */ m_Italic = false; /* true = italic shape */
m_Bold = false;
m_MultilineAllowed = false; // Set to true only for texts that can use multiline. m_MultilineAllowed = false; // Set to true only for texts that can use multiline.
m_Text = text; m_Text = text;
} }
...@@ -191,13 +192,9 @@ EDA_TextStruct::~EDA_TextStruct() ...@@ -191,13 +192,9 @@ EDA_TextStruct::~EDA_TextStruct()
* @param aLine : the line of text to consider. * @param aLine : the line of text to consider.
* For single line text, this parameter is always m_Text * For single line text, this parameter is always m_Text
*/ */
int EDA_TextStruct::LenSize( const wxString& aLine ) int EDA_TextStruct::LenSize( const wxString& aLine ) const
{ {
int nbchar = aLine.Len(); return TextWidth(aLine, m_Size.x, m_Italic, m_Bold ) + m_Width;
int len = ( ( (10 * m_Size.x ) / 9 ) + m_Width ) * nbchar;
return len;
} }
...@@ -328,21 +325,6 @@ bool EDA_TextStruct::HitTest( EDA_Rect& refArea ) ...@@ -328,21 +325,6 @@ bool EDA_TextStruct::HitTest( EDA_Rect& refArea )
return false; return false;
} }
/*********************************************/
int EDA_TextStruct::Pitch( int aMinTickness )
/*********************************************/
/**
* Function Pitch
* @return distance between 2 characters
* @param aMinTickness = min segments tickness
*/
{
return ( (m_Size.x * 10) / 9 ) + MAX( m_Width, aMinTickness );
}
/***************************************************************/ /***************************************************************/
void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_Colors aColor, const wxPoint& aOffset, EDA_Colors aColor,
...@@ -455,7 +437,7 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -455,7 +437,7 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
DrawGraphicText( aPanel, aDC, DrawGraphicText( aPanel, aDC,
aOffset + aPos, aColor, aText, aOffset + aPos, aColor, aText,
m_Orient, size, m_Orient, size,
m_HJustify, m_VJustify, width, m_Italic, true ); m_HJustify, m_VJustify, width, m_Italic, m_Bold );
} }
......
...@@ -31,6 +31,7 @@ void InitPlotParametresPS( wxPoint offset, Ki_PageDescr* sheet, ...@@ -31,6 +31,7 @@ void InitPlotParametresPS( wxPoint offset, Ki_PageDescr* sheet,
g_Plot_XScale = aXScale; g_Plot_XScale = aXScale;
g_Plot_YScale = aYScale; g_Plot_YScale = aYScale;
g_Plot_CurrentPenWidth = -1; g_Plot_CurrentPenWidth = -1;
g_Plot_PenState = 'Z';
} }
...@@ -211,18 +212,22 @@ void LineTo_PS( wxPoint pos, int plume ) ...@@ -211,18 +212,22 @@ void LineTo_PS( wxPoint pos, int plume )
/* Routine to draw to a new position /* Routine to draw to a new position
*/ */
{ {
if( plume == 'Z' ) char Line[256];
if( plume == 'Z' ) {
if (g_Plot_PenState != 'Z') {
fputs( "stroke\n", g_Plot_PlotOutputFile );
g_Plot_PenState = 'Z';
}
return; return;
}
UserToDeviceCoordinate( pos ); UserToDeviceCoordinate( pos );
if( plume == 'D' ) if (g_Plot_PenState == 'Z') {
{ fputs( "newpath\n", g_Plot_PlotOutputFile );
char Line[256];
sprintf( Line, "%d %d %d %d line\n",
g_Plot_LastPenPosition.x, g_Plot_LastPenPosition.y, pos.x, pos.y );
fputs( Line, g_Plot_PlotOutputFile );
} }
g_Plot_LastPenPosition = pos; sprintf( Line, "%d %d %sto\n", pos.x, pos.y, (plume=='D')?"line":"move" );
fputs( Line, g_Plot_PlotOutputFile );
g_Plot_PenState = plume;
} }
...@@ -272,11 +277,11 @@ void PrintHeaderPS( FILE* file, const wxString& Creator, ...@@ -272,11 +277,11 @@ void PrintHeaderPS( FILE* file, const wxString& Creator,
"/rect0 { rectstroke } bind def\n", "/rect0 { rectstroke } bind def\n",
"/rect1 { rectfill } bind def\n", "/rect1 { rectfill } bind def\n",
"/rect2 { rectfill } bind def\n", "/rect2 { rectfill } bind def\n",
"/linemode0 { 0 setlinecap 0 setlinejoin 0 setlinewidth } bind def\n",
"/linemode1 { 1 setlinecap 1 setlinejoin } bind def\n",
"gsave\n", "gsave\n",
"72 72 scale\t\t\t% Talk inches\n", "72 72 scale\t\t\t% Talk inches\n",
"1 setlinecap\n", "linemode1\n",
"1 setlinejoin\n",
"1 setlinewidth\n",
NULL NULL
}; };
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// Variables partagees avec Common plot Postscript et HPLG Routines // Variables partagees avec Common plot Postscript et HPLG Routines
wxPoint g_Plot_LastPenPosition;
wxPoint g_Plot_PlotOffset; wxPoint g_Plot_PlotOffset;
FILE* g_Plot_PlotOutputFile; FILE* g_Plot_PlotOutputFile;
double g_Plot_XScale, g_Plot_YScale; double g_Plot_XScale, g_Plot_YScale;
...@@ -81,6 +80,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -81,6 +80,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
void (*FctPlume)( wxPoint pos, int state ); void (*FctPlume)( wxPoint pos, int state );
int UpperLimit = VARIABLE_BLOCK_START_POSITION; int UpperLimit = VARIABLE_BLOCK_START_POSITION;
bool italic = false; bool italic = false;
bool bold = false;
bool thickness = 0; //@todo : use current pen bool thickness = 0; //@todo : use current pen
switch( format_plot ) switch( format_plot )
...@@ -121,6 +121,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -121,6 +121,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
pos.x = ref.x; pos.y = yg; pos.x = ref.x; pos.y = yg;
FctPlume( pos,'D' ); FctPlume( pos,'D' );
FctPlume(ref,'D'); FctPlume(ref,'D');
FctPlume(ref,'Z');
#else #else
for( ii = 0; ii < 2; ii++ ) for( ii = 0; ii < 2; ii++ )
...@@ -136,6 +137,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -136,6 +137,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
ref.x += GRID_REF_W * conv_unit; ref.y += GRID_REF_W * conv_unit; ref.x += GRID_REF_W * conv_unit; ref.y += GRID_REF_W * conv_unit;
xg -= GRID_REF_W * conv_unit; yg -= GRID_REF_W * conv_unit; xg -= GRID_REF_W * conv_unit; yg -= GRID_REF_W * conv_unit;
} }
FctPlume(ref,'Z');
#endif #endif
/* trace des reperes */ /* trace des reperes */
...@@ -162,7 +164,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -162,7 +164,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
PlotGraphicText(format_plot, pos, color, PlotGraphicText(format_plot, pos, color,
msg, TEXT_ORIENT_VERT, text_size, msg, TEXT_ORIENT_VERT, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
thickness, italic ); thickness, italic, false, false );
break; break;
case WS_SEGMENT_LU: case WS_SEGMENT_LU:
...@@ -170,6 +172,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -170,6 +172,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
pos.x = (ref.x - WsItem->m_Endx) * conv_unit; pos.x = (ref.x - WsItem->m_Endx) * conv_unit;
pos.y = (yg - WsItem->m_Endy) * conv_unit; pos.y = (yg - WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D'); FctPlume(pos, 'D');
FctPlume(ref,'Z');
break; break;
} }
} }
...@@ -185,6 +188,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -185,6 +188,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
pos.x = (ref.x + WsItem->m_Endx) * conv_unit; pos.x = (ref.x + WsItem->m_Endx) * conv_unit;
pos.y = (ref.y + WsItem->m_Endy) * conv_unit; pos.y = (ref.y + WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D'); FctPlume(pos, 'D');
FctPlume(ref,'Z');
break; break;
} }
} }
...@@ -202,13 +206,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -202,13 +206,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
FctPlume( pos, 'U' ); FctPlume( pos, 'U' );
pos.x = ii * conv_unit; pos.y = (ref.y + GRID_REF_W) * conv_unit; pos.x = ii * conv_unit; pos.y = (ref.y + GRID_REF_W) * conv_unit;
FctPlume( pos, 'D' ); FctPlume( pos, 'D' );
FctPlume(ref,'Z');
} }
pos.x = (ii - gxpas / 2) * conv_unit; pos.x = (ii - gxpas / 2) * conv_unit;
pos.y = (ref.y + GRID_REF_W / 2) * conv_unit; pos.y = (ref.y + GRID_REF_W / 2) * conv_unit;
PlotGraphicText( format_plot, pos, color, PlotGraphicText( format_plot, pos, color,
msg, TEXT_ORIENT_HORIZ, text_size, msg, TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false );
if( ii < xg - PAS_REF / 2 ) if( ii < xg - PAS_REF / 2 )
{ {
...@@ -216,13 +221,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -216,13 +221,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
FctPlume( pos, 'U' ); FctPlume( pos, 'U' );
pos.x = ii * conv_unit; pos.y = (yg - GRID_REF_W) * conv_unit; pos.x = ii * conv_unit; pos.y = (yg - GRID_REF_W) * conv_unit;
FctPlume( pos, 'D' ); FctPlume( pos, 'D' );
FctPlume(ref,'Z');
} }
pos.x = (ii - gxpas / 2) * conv_unit; pos.x = (ii - gxpas / 2) * conv_unit;
pos.y = (yg - GRID_REF_W / 2) * conv_unit; pos.y = (yg - GRID_REF_W / 2) * conv_unit;
PlotGraphicText( format_plot, pos, color, PlotGraphicText( format_plot, pos, color,
msg, TEXT_ORIENT_HORIZ, text_size, msg, TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false );
} }
/* Trace des reperes selon l'axe Y */ /* Trace des reperes selon l'axe Y */
...@@ -237,13 +243,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -237,13 +243,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
FctPlume( pos, 'U' ); FctPlume( pos, 'U' );
pos.x = (ref.x + GRID_REF_W) * conv_unit; pos.y = ii * conv_unit; pos.x = (ref.x + GRID_REF_W) * conv_unit; pos.y = ii * conv_unit;
FctPlume( pos, 'D' ); FctPlume( pos, 'D' );
FctPlume(ref,'Z');
} }
pos.x = (ref.x + GRID_REF_W / 2) * conv_unit; pos.x = (ref.x + GRID_REF_W / 2) * conv_unit;
pos.y = (ii - gypas / 2) * conv_unit; pos.y = (ii - gypas / 2) * conv_unit;
PlotGraphicText( format_plot, pos, color, PlotGraphicText( format_plot, pos, color,
msg, TEXT_ORIENT_HORIZ, text_size, msg, TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false );
if( ii < yg - PAS_REF / 2 ) if( ii < yg - PAS_REF / 2 )
{ {
...@@ -251,12 +258,13 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -251,12 +258,13 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
FctPlume( pos, 'U' ); FctPlume( pos, 'U' );
pos.x = (xg - GRID_REF_W) * conv_unit; pos.y = ii * conv_unit; pos.x = (xg - GRID_REF_W) * conv_unit; pos.y = ii * conv_unit;
FctPlume( pos, 'D' ); FctPlume( pos, 'D' );
FctPlume(ref,'Z');
} }
pos.x = (xg - GRID_REF_W / 2) * conv_unit; pos.x = (xg - GRID_REF_W / 2) * conv_unit;
pos.y = (ii - gypas / 2) * conv_unit; pos.y = (ii - gypas / 2) * conv_unit;
PlotGraphicText( format_plot, pos, color, msg, TEXT_ORIENT_HORIZ, text_size, PlotGraphicText( format_plot, pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false );
} }
#endif #endif
...@@ -285,7 +293,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -285,7 +293,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
if(WsItem->m_Legende) msg = WsItem->m_Legende; if(WsItem->m_Legende) msg = WsItem->m_Legende;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size, PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false, false );
break; break;
case WS_SIZESHEET: case WS_SIZESHEET:
break; break;
...@@ -294,14 +302,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -294,14 +302,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size, PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false, false );
break; break;
case WS_SHEETS: case WS_SHEETS:
if(WsItem->m_Legende) msg = WsItem->m_Legende; if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_NumberOfScreen; msg << screen->m_NumberOfScreen;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size, PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false, false );
break; break;
case WS_COMPANY_NAME: case WS_COMPANY_NAME:
break; break;
...@@ -322,6 +330,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -322,6 +330,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
pos.x = (ref.x - WsItem->m_Endx) * conv_unit; pos.x = (ref.x - WsItem->m_Endx) * conv_unit;
pos.y = (ref.y - WsItem->m_Endy) * conv_unit; pos.y = (ref.y - WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D'); FctPlume(pos, 'D');
FctPlume(ref,'Z');
break; break;
} }
} }
...@@ -339,14 +348,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -339,14 +348,14 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
if(WsItem->m_Legende) msg = WsItem->m_Legende; if(WsItem->m_Legende) msg = WsItem->m_Legende;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size, PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false, false );
break; break;
case WS_IDENTSHEET_D: case WS_IDENTSHEET_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende; if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size, PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, false, false );
break; break;
case WS_LEFT_SEGMENT_D: case WS_LEFT_SEGMENT_D:
case WS_SEGMENT_D: case WS_SEGMENT_D:
...@@ -354,6 +363,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -354,6 +363,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
pos.x = (ref.x - WsItem->m_Endx) * conv_unit; pos.x = (ref.x - WsItem->m_Endx) * conv_unit;
pos.y = (ref.y - WsItem->m_Endy) * conv_unit; pos.y = (ref.y - WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D'); FctPlume(pos, 'D');
FctPlume(ref,'Z');
break; break;
} }
} }
...@@ -366,6 +376,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -366,6 +376,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
{ {
pos.x = (ref.x - WsItem->m_Posx) * conv_unit; pos.x = (ref.x - WsItem->m_Posx) * conv_unit;
pos.y = (ref.y - WsItem->m_Posy) * conv_unit; pos.y = (ref.y - WsItem->m_Posy) * conv_unit;
bold = false;
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
else else
...@@ -375,10 +386,12 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -375,10 +386,12 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
{ {
case WS_DATE: case WS_DATE:
msg += screen->m_Date; msg += screen->m_Date;
bold = true;
break; break;
case WS_REV: case WS_REV:
msg += screen->m_Revision; msg += screen->m_Revision;
bold = true;
break; break;
case WS_KICAD_VERSION: case WS_KICAD_VERSION:
...@@ -409,10 +422,12 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -409,10 +422,12 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
msg += screen->m_Company; msg += screen->m_Company;
if( !msg.IsEmpty() ) if( !msg.IsEmpty() )
UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT ); UpperLimit = MAX( UpperLimit, WsItem->m_Posy + SIZETEXT );
bold = true;
break; break;
case WS_TITLE: case WS_TITLE:
msg += screen->m_Title; msg += screen->m_Title;
bold = true;
break; break;
case WS_COMMENT1: case WS_COMMENT1:
...@@ -456,6 +471,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -456,6 +471,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
auxpos.y = (ref.y - WsItem->m_Endy) * conv_unit;; auxpos.y = (ref.y - WsItem->m_Endy) * conv_unit;;
FctPlume( pos, 'U' ); FctPlume( pos, 'U' );
FctPlume( auxpos, 'D' ); FctPlume( auxpos, 'D' );
FctPlume(ref,'Z');
} }
break; break;
} }
...@@ -465,7 +481,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen ) ...@@ -465,7 +481,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
PlotGraphicText( format_plot, pos, color, PlotGraphicText( format_plot, pos, color,
msg.GetData(), TEXT_ORIENT_HORIZ, text_size, msg.GetData(), TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
thickness, italic ); thickness, italic, bold );
} }
} }
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
...@@ -326,7 +326,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -326,7 +326,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
DrawGraphicText( aPanel, aDC, DrawGraphicText( aPanel, aDC,
wxPoint( pos.x, pos.y - 8 ), (EDA_Colors) txtcolor, wxPoint( pos.x, pos.y - 8 ), (EDA_Colors) txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize( m_SheetNameSize, m_SheetNameSize ), Text, TEXT_ORIENT_HORIZ, wxSize( m_SheetNameSize, m_SheetNameSize ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth ); GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth, false, false, false );
/* Draw text : FileName */ /* Draw text : FileName */
if( aColor >= 0 ) if( aColor >= 0 )
...@@ -338,7 +338,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -338,7 +338,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
wxPoint( pos.x, pos.y + m_Size.y + 4 ), wxPoint( pos.x, pos.y + m_Size.y + 4 ),
(EDA_Colors) txtcolor, (EDA_Colors) txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize( m_FileNameSize, m_FileNameSize ), Text, TEXT_ORIENT_HORIZ, wxSize( m_FileNameSize, m_FileNameSize ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth ); GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth, false, false, false );
/* Draw text : SheetLabel */ /* Draw text : SheetLabel */
......
...@@ -95,7 +95,7 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con ...@@ -95,7 +95,7 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
} }
DrawGraphicText( panel, DC, wxPoint( tposx, posy ), txtcolor, DrawGraphicText( panel, DC, wxPoint( tposx, posy ), txtcolor,
m_Text, TEXT_ORIENT_HORIZ, size, m_Text, TEXT_ORIENT_HORIZ, size,
side, GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, true ); side, GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, false );
} }
/* Draw the graphic symbol */ /* Draw the graphic symbol */
......
...@@ -74,7 +74,7 @@ bool LibDrawField::Save( FILE* ExportFile ) const ...@@ -74,7 +74,7 @@ bool LibDrawField::Save( FILE* ExportFile ) const
(m_Attributs & TEXT_NO_VISIBLE ) ? 'I' : 'V', (m_Attributs & TEXT_NO_VISIBLE ) ? 'I' : 'V',
hjustify, vjustify, hjustify, vjustify,
m_Italic ? 'I' : 'N', m_Italic ? 'I' : 'N',
m_Width > 1 ? 'B' : 'N' ); m_Bold ? 'B' : 'N' );
/* Save field name, if necessary /* Save field name, if necessary
* Field name is saved only if it is not the default name. * Field name is saved only if it is not the default name.
...@@ -180,11 +180,10 @@ bool LibDrawField::Load( char* line, wxString& errorMsg ) ...@@ -180,11 +180,10 @@ bool LibDrawField::Load( char* line, wxString& errorMsg )
else else
return false; return false;
if ( strlen( textVJustify ) >= 2 && textVJustify[1] == 'I' ) // Italic if ( textVJustify[1] == 'I' ) // Italic
m_Italic = true; m_Italic = true;
if ( strlen( textVJustify ) >= 2 && textVJustify[2] == 'B' ) // Bold if ( textVJustify[2] == 'B' ) // Bold
m_Width = m_Size.x / 4; m_Bold = true;
} }
if( m_FieldId >= FIELD1 ) if( m_FieldId >= FIELD1 )
...@@ -241,7 +240,7 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -241,7 +240,7 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
DrawGraphicText( aPanel, aDC, text_pos, (EDA_Colors) color, text->GetData(), DrawGraphicText( aPanel, aDC, text_pos, (EDA_Colors) color, text->GetData(),
m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, m_HJustify, m_VJustify, linewidth, m_Italic ); m_Size, m_HJustify, m_VJustify, linewidth, m_Italic, m_Bold );
} }
...@@ -321,6 +320,7 @@ void LibDrawField::Copy( LibDrawField* Target ) const ...@@ -321,6 +320,7 @@ void LibDrawField::Copy( LibDrawField* Target ) const
Target->m_HJustify = m_HJustify; Target->m_HJustify = m_HJustify;
Target->m_VJustify = m_VJustify; Target->m_VJustify = m_VJustify;
Target->m_Italic = m_Italic; Target->m_Italic = m_Italic;
Target->m_Bold = m_Bold;
} }
......
...@@ -85,6 +85,7 @@ public: ...@@ -85,6 +85,7 @@ public:
m_Mirror = field.m_Mirror; m_Mirror = field.m_Mirror;
m_Attributs = field.m_Attributs; m_Attributs = field.m_Attributs;
m_Italic = field.m_Italic; m_Italic = field.m_Italic;
m_Bold = field.m_Bold;
m_HJustify = field.m_HJustify; m_HJustify = field.m_HJustify;
m_VJustify = field.m_VJustify; m_VJustify = field.m_VJustify;
} }
......
This diff is collapsed.
...@@ -150,7 +150,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -150,7 +150,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
DrawGraphicText( panel, DC, pos, color, m_Text, DrawGraphicText( panel, DC, pos, color, m_Text,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, hjustify, vjustify, LineWidth, m_Italic ); m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold, false );
} }
else else
{ {
...@@ -168,7 +168,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -168,7 +168,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
DrawGraphicText( panel, DC, pos, color, fulltext, DrawGraphicText( panel, DC, pos, color, fulltext,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size, hjustify, vjustify, LineWidth, m_Italic ); m_Size, hjustify, vjustify, LineWidth, m_Italic, m_Bold, false );
} }
} }
...@@ -187,6 +187,7 @@ void SCH_CMP_FIELD::ImportValues( const LibDrawField& aSource ) ...@@ -187,6 +187,7 @@ void SCH_CMP_FIELD::ImportValues( const LibDrawField& aSource )
m_HJustify = aSource.m_HJustify; m_HJustify = aSource.m_HJustify;
m_VJustify = aSource.m_VJustify; m_VJustify = aSource.m_VJustify;
m_Italic = aSource.m_Italic; m_Italic = aSource.m_Italic;
m_Bold = aSource.m_Bold;
m_Width = aSource.m_Width; m_Width = aSource.m_Width;
m_Attributs = aSource.m_Attributs; m_Attributs = aSource.m_Attributs;
m_Mirror = aSource.m_Mirror; m_Mirror = aSource.m_Mirror;
...@@ -207,6 +208,7 @@ void SCH_CMP_FIELD::SwapData( SCH_CMP_FIELD* copyitem ) ...@@ -207,6 +208,7 @@ void SCH_CMP_FIELD::SwapData( SCH_CMP_FIELD* copyitem )
EXCHG( m_Mirror, copyitem->m_Mirror ); EXCHG( m_Mirror, copyitem->m_Mirror );
EXCHG( m_Attributs, copyitem->m_Attributs ); EXCHG( m_Attributs, copyitem->m_Attributs );
EXCHG( m_Italic, copyitem->m_Italic ); EXCHG( m_Italic, copyitem->m_Italic );
EXCHG( m_Bold, copyitem->m_Bold );
EXCHG( m_HJustify, copyitem->m_HJustify ); EXCHG( m_HJustify, copyitem->m_HJustify );
EXCHG( m_VJustify, copyitem->m_VJustify ); EXCHG( m_VJustify, copyitem->m_VJustify );
} }
...@@ -245,20 +247,7 @@ EDA_Rect SCH_CMP_FIELD::GetBoundaryBox() const ...@@ -245,20 +247,7 @@ EDA_Rect SCH_CMP_FIELD::GetBoundaryBox() const
x1 = m_Pos.x - pos.x; x1 = m_Pos.x - pos.x;
y1 = m_Pos.y - pos.y; y1 = m_Pos.y - pos.y;
textlen = GetLength(); dx = LenSize(m_Text);
if( m_FieldId == REFERENCE ) // Real Text can be U1 or U1A
{
EDA_LibComponentStruct* Entry =
FindLibPart( DrawLibItem->m_ChipName.GetData(), wxEmptyString,
FIND_ROOT );
if( Entry && (Entry->m_UnitCount > 1) )
textlen++; // because U1 is show as U1A or U1B ...
}
dx = m_Size.x * textlen;
// Real X Size is 10/9 char size because space between 2 chars is 1/10 X Size
dx = (dx * 10) / 9;
dy = m_Size.y; dy = m_Size.y;
hjustify = m_HJustify; hjustify = m_HJustify;
vjustify = m_VJustify; vjustify = m_VJustify;
...@@ -356,7 +345,7 @@ bool SCH_CMP_FIELD::Save( FILE* aFile ) const ...@@ -356,7 +345,7 @@ bool SCH_CMP_FIELD::Save( FILE* aFile ) const
m_Attributs, m_Attributs,
hjustify, vjustify, hjustify, vjustify,
m_Italic ? 'I' : 'N', m_Italic ? 'I' : 'N',
m_Width > 1 ? 'B' : 'N' ) == EOF ) m_Bold ? 'B' : 'N' ) == EOF )
{ {
return false; return false;
} }
......
...@@ -134,6 +134,7 @@ SCH_TEXT* SCH_TEXT::GenCopy() ...@@ -134,6 +134,7 @@ SCH_TEXT* SCH_TEXT::GenCopy()
newitem->m_VJustify = m_VJustify; newitem->m_VJustify = m_VJustify;
newitem->m_IsDangling = m_IsDangling; newitem->m_IsDangling = m_IsDangling;
newitem->m_Italic = m_Italic; newitem->m_Italic = m_Italic;
newitem->m_Bold = m_Bold;
newitem->m_SchematicOrientation = m_SchematicOrientation; newitem->m_SchematicOrientation = m_SchematicOrientation;
return newitem; return newitem;
...@@ -242,6 +243,7 @@ wxPoint SCH_GLOBALLABEL::GetSchematicTextOffset() ...@@ -242,6 +243,7 @@ wxPoint SCH_GLOBALLABEL::GetSchematicTextOffset()
break; break;
case NET_OUTPUT: case NET_OUTPUT:
case NET_UNSPECIFIED:
offset += TXTMARGE; offset += TXTMARGE;
break; break;
...@@ -518,7 +520,7 @@ bool SCH_TEXT::Save( FILE* aFile ) const ...@@ -518,7 +520,7 @@ bool SCH_TEXT::Save( FILE* aFile ) const
if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n", if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, m_SchematicOrientation, m_Size.x,
shape, m_Width, shape, (m_Bold?1:0),
CONV_TO_UTF8( text ) ) == EOF ) CONV_TO_UTF8( text ) ) == EOF )
{ {
success = false; success = false;
...@@ -575,7 +577,7 @@ bool SCH_LABEL::Save( FILE* aFile ) const ...@@ -575,7 +577,7 @@ bool SCH_LABEL::Save( FILE* aFile ) const
if( fprintf( aFile, "Text Label %-4d %-4d %-4d %-4d %s %d\n%s\n", if( fprintf( aFile, "Text Label %-4d %-4d %-4d %-4d %s %d\n%s\n",
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, shape, m_Width, m_SchematicOrientation, m_Size.x, shape, (m_Bold?1:0),
CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( m_Text ) ) == EOF )
{ {
success = false; success = false;
...@@ -614,7 +616,7 @@ bool SCH_GLOBALLABEL::Save( FILE* aFile ) const ...@@ -614,7 +616,7 @@ bool SCH_GLOBALLABEL::Save( FILE* aFile ) const
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, m_SchematicOrientation, m_Size.x,
SheetLabelType[m_Shape], SheetLabelType[m_Shape],
shape, m_Width, shape, (m_Bold?1:0),
CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( m_Text ) ) == EOF )
{ {
success = false; success = false;
...@@ -668,7 +670,7 @@ bool SCH_HIERLABEL::Save( FILE* aFile ) const ...@@ -668,7 +670,7 @@ bool SCH_HIERLABEL::Save( FILE* aFile ) const
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_SchematicOrientation, m_Size.x, m_SchematicOrientation, m_Size.x,
SheetLabelType[m_Shape], SheetLabelType[m_Shape],
shape, m_Width, shape, (m_Bold?1:0),
CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( m_Text ) ) == EOF )
{ {
success = false; success = false;
...@@ -774,7 +776,7 @@ EDA_Rect SCH_HIERLABEL::GetBoundingBox() ...@@ -774,7 +776,7 @@ EDA_Rect SCH_HIERLABEL::GetBoundingBox()
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
height = m_Size.y + 2 * TXTMARGE; height = m_Size.y + 2 * TXTMARGE;
length = ( Pitch( width ) * NegableTextLength( m_Text ) ) length = LenSize( m_Text )
+ height // add height for triangular shapes + height // add height for triangular shapes
+ 2 * DANGLING_SYMBOL_SIZE; + 2 * DANGLING_SYMBOL_SIZE;
...@@ -860,7 +862,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, c ...@@ -860,7 +862,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, c
aCorner_list.clear(); aCorner_list.clear();
int symb_len = ( Pitch( width ) * NegableTextLength( m_Text ) ) + (TXTMARGE * 2); int symb_len = LenSize( m_Text ) + (TXTMARGE * 2);
// Create outline shape : 6 points // Create outline shape : 6 points
int x = symb_len + width + 3; int x = symb_len + width + 3;
...@@ -943,7 +945,7 @@ EDA_Rect SCH_GLOBALLABEL::GetBoundingBox() ...@@ -943,7 +945,7 @@ EDA_Rect SCH_GLOBALLABEL::GetBoundingBox()
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
height = ( (m_Size.y * 15) / 10 ) + width + 2 * TXTMARGE; height = ( (m_Size.y * 15) / 10 ) + width + 2 * TXTMARGE;
length = length =
( Pitch( width ) * NegableTextLength( m_Text ) ) // text X size LenSize( m_Text ) // text X size
+ height // add height for triangular shapes (bidirectional) + height // add height for triangular shapes (bidirectional)
+ DANGLING_SYMBOL_SIZE; + DANGLING_SYMBOL_SIZE;
...@@ -993,7 +995,7 @@ EDA_Rect SCH_TEXT::GetBoundingBox() ...@@ -993,7 +995,7 @@ EDA_Rect SCH_TEXT::GetBoundingBox()
x = m_Pos.x; x = m_Pos.x;
y = m_Pos.y; y = m_Pos.y;
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
length = ( Pitch( width ) * NegableTextLength( m_Text ) ); length = LenSize( m_Text );
height = m_Size.y; height = m_Size.y;
dx = dy = 0; dx = dy = 0;
......
...@@ -479,7 +479,7 @@ bool LibDrawText::Save( FILE* ExportFile ) const ...@@ -479,7 +479,7 @@ bool LibDrawText::Save( FILE* ExportFile ) const
fprintf( ExportFile, "T %d %d %d %d %d %d %d %s ", m_Orient, fprintf( ExportFile, "T %d %d %d %d %d %d %d %s ", m_Orient,
m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert, m_Pos.x, m_Pos.y, m_Size.x, m_Attributs, m_Unit, m_Convert,
CONV_TO_UTF8( text )); CONV_TO_UTF8( text ));
fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", m_Width ); fprintf( ExportFile, " %s %d", m_Italic ? "Italic" : "Normal", (m_Bold>0)?1:0 );
fprintf( ExportFile, "\n"); fprintf( ExportFile, "\n");
return true; return true;
...@@ -488,7 +488,7 @@ bool LibDrawText::Save( FILE* ExportFile ) const ...@@ -488,7 +488,7 @@ bool LibDrawText::Save( FILE* ExportFile ) const
bool LibDrawText::Load( char* line, wxString& errorMsg ) bool LibDrawText::Load( char* line, wxString& errorMsg )
{ {
int cnt; int cnt, thickness;
char buf[256]; char buf[256];
char tmp[256]; char tmp[256];
...@@ -497,7 +497,7 @@ bool LibDrawText::Load( char* line, wxString& errorMsg ) ...@@ -497,7 +497,7 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s %s %d", cnt = sscanf( &line[2], "%d %d %d %d %d %d %d %s %s %d",
&m_Orient, &m_Pos.x, &m_Pos.y, &m_Size.x, &m_Attributs, &m_Orient, &m_Pos.x, &m_Pos.y, &m_Size.x, &m_Attributs,
&m_Unit, &m_Convert, buf, tmp, &m_Width ); &m_Unit, &m_Convert, buf, tmp, &thickness );
if( cnt < 8 ) if( cnt < 8 )
{ {
...@@ -510,6 +510,9 @@ bool LibDrawText::Load( char* line, wxString& errorMsg ) ...@@ -510,6 +510,9 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
if ( strnicmp( tmp, "Italic", 6 ) == 0 ) if ( strnicmp( tmp, "Italic", 6 ) == 0 )
m_Italic = true; m_Italic = true;
if (thickness > 0) {
m_Bold = true;
}
/* Convert '~' to spaces. */ /* Convert '~' to spaces. */
m_Text = CONV_FROM_UTF8( buf ); m_Text = CONV_FROM_UTF8( buf );
...@@ -533,6 +536,7 @@ LibDrawText* LibDrawText::GenCopy() ...@@ -533,6 +536,7 @@ LibDrawText* LibDrawText::GenCopy()
newitem->m_Text = m_Text; newitem->m_Text = m_Text;
newitem->m_Width = m_Width; newitem->m_Width = m_Width;
newitem->m_Italic = m_Italic; newitem->m_Italic = m_Italic;
newitem->m_Bold = m_Bold;
newitem->m_HJustify = m_HJustify; newitem->m_HJustify = m_HJustify;
newitem->m_VJustify = m_VJustify; newitem->m_VJustify = m_VJustify;
return newitem; return newitem;
...@@ -565,7 +569,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -565,7 +569,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text, DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
linewidth, m_Italic ); linewidth, m_Italic, m_Bold );
} }
......
...@@ -243,8 +243,7 @@ public: ...@@ -243,8 +243,7 @@ public:
int TextInside, int TextInside,
bool DrawPinNum, bool DrawPinNum,
bool DrawPinNameint, bool DrawPinNameint,
int aWidth, int aWidth);
bool aItalic );
}; };
......
...@@ -507,7 +507,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel() ...@@ -507,7 +507,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
int style = 0; int style = 0;
if( field.m_Italic ) if( field.m_Italic )
style = 1; style = 1;
if( field.m_Width > 1 ) if( field.m_Bold )
style |= 2; style |= 2;
m_StyleRadioBox->SetSelection( style ); m_StyleRadioBox->SetSelection( style );
...@@ -600,9 +600,9 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField() ...@@ -600,9 +600,9 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
field.m_Italic = false; field.m_Italic = false;
if( (style & 2 ) != 0 ) if( (style & 2 ) != 0 )
field.m_Width = field.m_Size.x / 4; field.m_Bold = true;
else else
field.m_Width = 0; field.m_Bold = false;
double value; double value;
......
...@@ -101,7 +101,7 @@ void DialogLabelEditor::init() ...@@ -101,7 +101,7 @@ void DialogLabelEditor::init()
int style = 0; int style = 0;
if( m_CurrentText->m_Italic ) if( m_CurrentText->m_Italic )
style = 1; style = 1;
if( m_CurrentText->m_Width > 1 ) if( m_CurrentText->m_Bold )
style += 2; style += 2;
m_TextStyle->SetSelection( style ); m_TextStyle->SetSelection( style );
......
...@@ -513,7 +513,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel() ...@@ -513,7 +513,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
int style = 0; int style = 0;
if( field.m_Italic ) if( field.m_Italic )
style = 1; style = 1;
if( field.m_Width > 1 ) if( field.m_Bold )
style |= 2; style |= 2;
m_StyleRadioBox->SetSelection( style ); m_StyleRadioBox->SetSelection( style );
...@@ -633,9 +633,9 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField() ...@@ -633,9 +633,9 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
field.m_Italic = false; field.m_Italic = false;
if( (style & 2 ) != 0 ) if( (style & 2 ) != 0 )
field.m_Width = field.m_Size.x / 4; field.m_Bold = true;
else else
field.m_Width = 0; field.m_Bold = false;
double value; double value;
......
...@@ -65,7 +65,7 @@ wxString msg; ...@@ -65,7 +65,7 @@ wxString msg;
int shape = 0; int shape = 0;
if ( m_GraphicText->m_Italic) if ( m_GraphicText->m_Italic)
shape = 1; shape = 1;
if ( m_GraphicText->m_Width > 1) if ( m_GraphicText->m_Bold)
shape |= 2; shape |= 2;
m_TextShapeOpt->SetSelection(shape); m_TextShapeOpt->SetSelection(shape);
...@@ -126,9 +126,9 @@ wxString Line; ...@@ -126,9 +126,9 @@ wxString Line;
m_GraphicText->m_Italic = false; m_GraphicText->m_Italic = false;
if ( (m_TextShapeOpt->GetSelection() & 2 ) != 0 ) if ( (m_TextShapeOpt->GetSelection() & 2 ) != 0 )
m_GraphicText->m_Width = m_GraphicText->m_Size.x / 4; m_GraphicText->m_Bold = true;
else else
m_GraphicText->m_Width = 0; m_GraphicText->m_Bold = false;
} }
Close(); Close();
......
...@@ -61,9 +61,9 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& event ) ...@@ -61,9 +61,9 @@ void DialogLabelEditor::TextPropertiesAccept( wxCommandEvent& event )
m_CurrentText->m_Italic = 0; m_CurrentText->m_Italic = 0;
if ( ( style & 2 ) ) if ( ( style & 2 ) )
m_CurrentText->m_Width = m_CurrentText->m_Size.x / 4; m_CurrentText->m_Bold = true;
else else
m_CurrentText->m_Width = 0; m_CurrentText->m_Bold = false;
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
......
...@@ -200,7 +200,8 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field ) ...@@ -200,7 +200,8 @@ void WinEDA_LibeditFrame::PlaceField( wxDC* DC, LibDrawField* Field )
color, ReturnFieldFullText( Field ), color, ReturnFieldFullText( Field ),
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size, Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth ); Field->m_HJustify, Field->m_VJustify, LineWidth,
Field->m_Italic, Field->m_Bold, false);
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
...@@ -272,7 +273,8 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field ) ...@@ -272,7 +273,8 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field )
color, ReturnFieldFullText( Field ), color, ReturnFieldFullText( Field ),
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size, Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth ); Field->m_HJustify, Field->m_VJustify, LineWidth,
Field->m_Italic, Field->m_Bold, false);
if( !Text.IsEmpty() ) if( !Text.IsEmpty() )
{ {
...@@ -289,7 +291,8 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field ) ...@@ -289,7 +291,8 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field )
color, ReturnFieldFullText( Field ), color, ReturnFieldFullText( Field ),
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size, Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth ); Field->m_HJustify, Field->m_VJustify, LineWidth,
Field->m_Italic, Field->m_Bold, false);
GetScreen()->SetModify(); GetScreen()->SetModify();
...@@ -340,7 +343,8 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) ...@@ -340,7 +343,8 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field )
color, ReturnFieldFullText( Field ), color, ReturnFieldFullText( Field ),
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size, Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth ); Field->m_HJustify, Field->m_VJustify, LineWidth,
Field->m_Italic, Field->m_Bold, false);
if( Field->m_Orient ) if( Field->m_Orient )
Field->m_Orient = 0; Field->m_Orient = 0;
...@@ -354,7 +358,8 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field ) ...@@ -354,7 +358,8 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field )
color, ReturnFieldFullText( Field ), color, ReturnFieldFullText( Field ),
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size, Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth ); Field->m_HJustify, Field->m_VJustify, LineWidth,
Field->m_Italic, Field->m_Bold, false);
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
} }
......
...@@ -35,8 +35,16 @@ static void PlotPinSymbol( const wxPoint& pos, int len, int orient, int Shape ); ...@@ -35,8 +35,16 @@ static void PlotPinSymbol( const wxPoint& pos, int len, int orient, int Shape );
*/ */
void Plume( int plume ) void Plume( int plume )
{ {
if( g_PlotFormat == PLOT_FORMAT_HPGL ) switch( g_PlotFormat )
{
case PLOT_FORMAT_HPGL:
Plume_HPGL( plume ); Plume_HPGL( plume );
break;
case PLOT_FORMAT_POST:
LineTo_PS( wxPoint(0,0), plume );
break;
}
} }
...@@ -175,7 +183,7 @@ void PlotNoConnectStruct( DrawNoConnectStruct* Struct ) ...@@ -175,7 +183,7 @@ void PlotNoConnectStruct( DrawNoConnectStruct* Struct )
Move_Plume( wxPoint( pX + DELTA, pY + DELTA ), 'D' ); Move_Plume( wxPoint( pX + DELTA, pY + DELTA ), 'D' );
Move_Plume( wxPoint( pX + DELTA, pY - DELTA ), 'U' ); Move_Plume( wxPoint( pX + DELTA, pY - DELTA ), 'U' );
Move_Plume( wxPoint( pX - DELTA, pY + DELTA ), 'D' ); Move_Plume( wxPoint( pX - DELTA, pY + DELTA ), 'D' );
Plume( 'U' ); Plume( 'Z' );
} }
...@@ -273,7 +281,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) ...@@ -273,7 +281,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
Text->m_Size, Text->m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
thickness, false, true ); thickness, Text->m_Italic, Text->m_Bold );
} }
break; break;
...@@ -312,7 +320,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) ...@@ -312,7 +320,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
Pin->PlotPinTexts( pos, orient, Pin->PlotPinTexts( pos, orient,
Entry->m_TextInside, Entry->m_TextInside,
Entry->m_DrawPinNum, Entry->m_DrawPinName, Entry->m_DrawPinNum, Entry->m_DrawPinName,
thickness, false ); thickness );
} }
break; break;
...@@ -500,7 +508,7 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem, ...@@ -500,7 +508,7 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
field->m_Size, field->m_Size,
hjustify, vjustify, hjustify, vjustify,
thickness, field->m_Italic, true ); thickness, field->m_Italic, field->m_Bold );
} }
else /* We plt the reference, for a multiple parts per package */ else /* We plt the reference, for a multiple parts per package */
{ {
...@@ -518,7 +526,7 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem, ...@@ -518,7 +526,7 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
PlotGraphicText( g_PlotFormat, textpos, color, Text, PlotGraphicText( g_PlotFormat, textpos, color, Text,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
field->m_Size, hjustify, vjustify, field->m_Size, hjustify, vjustify,
thickness, field->m_Italic ); thickness, field->m_Italic, field->m_Bold );
} }
} }
...@@ -627,7 +635,7 @@ static void PlotPinSymbol( const wxPoint& pos, int len, int orient, int Shape ) ...@@ -627,7 +635,7 @@ static void PlotPinSymbol( const wxPoint& pos, int len, int orient, int Shape )
Move_Plume( wxPoint( x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ), 'D' ); Move_Plume( wxPoint( x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ), 'D' );
} }
} }
Plume( 'U' ); Plume( 'Z' );
} }
...@@ -680,7 +688,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -680,7 +688,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
PlotGraphicText( g_PlotFormat, pos, PlotGraphicText( g_PlotFormat, pos,
color, txt, schText->m_Orient, schText->m_Size, color, txt, schText->m_Orient, schText->m_Size,
schText->m_HJustify, schText->m_VJustify, schText->m_HJustify, schText->m_VJustify,
thickness, schText->m_Italic, true ); thickness, schText->m_Italic, schText->m_Bold );
pos += offset; pos += offset;
} }
...@@ -691,7 +699,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct ) ...@@ -691,7 +699,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
PlotGraphicText( g_PlotFormat, textpos, PlotGraphicText( g_PlotFormat, textpos,
color, schText->m_Text, schText->m_Orient, schText->m_Size, color, schText->m_Text, schText->m_Orient, schText->m_Size,
schText->m_HJustify, schText->m_VJustify, schText->m_HJustify, schText->m_VJustify,
thickness, schText->m_Italic, true ); thickness, schText->m_Italic, schText->m_Bold );
/* Draw graphic symbol for global or hierachical labels */ /* Draw graphic symbol for global or hierachical labels */
if( Struct->Type() == TYPE_SCH_GLOBALLABEL ) if( Struct->Type() == TYPE_SCH_GLOBALLABEL )
...@@ -744,7 +752,7 @@ static void Plot_Hierarchical_PIN_Sheet( Hierarchical_PIN_Sheet_Struct* aHierarc ...@@ -744,7 +752,7 @@ static void Plot_Hierarchical_PIN_Sheet( Hierarchical_PIN_Sheet_Struct* aHierarc
PlotGraphicText( g_PlotFormat, wxPoint( tposx, posy ), txtcolor, PlotGraphicText( g_PlotFormat, wxPoint( tposx, posy ), txtcolor,
aHierarchical_PIN->m_Text, TEXT_ORIENT_HORIZ, wxSize( size, size ), aHierarchical_PIN->m_Text, TEXT_ORIENT_HORIZ, wxSize( size, size ),
side, GR_TEXT_VJUSTIFY_CENTER, side, GR_TEXT_VJUSTIFY_CENTER,
thickness, aHierarchical_PIN->m_Italic, true ); thickness, aHierarchical_PIN->m_Italic, aHierarchical_PIN->m_Bold );
/* Draw the associated graphic symbol */ /* Draw the associated graphic symbol */
aHierarchical_PIN->CreateGraphicShape( Poly, aHierarchical_PIN->m_Pos ); aHierarchical_PIN->CreateGraphicShape( Poly, aHierarchical_PIN->m_Pos );
...@@ -782,7 +790,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct ) ...@@ -782,7 +790,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
Move_Plume( pos, 'D' ); Move_Plume( pos, 'D' );
Move_Plume( Struct->m_Pos, 'D' ); Move_Plume( Struct->m_Pos, 'D' );
Plume( 'U' ); Plume( 'Z' );
/* Draw texts: SheetName */ /* Draw texts: SheetName */
Text = Struct->m_SheetName; Text = Struct->m_SheetName;
...@@ -796,7 +804,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct ) ...@@ -796,7 +804,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
PlotGraphicText( g_PlotFormat, pos, txtcolor, PlotGraphicText( g_PlotFormat, pos, txtcolor,
Text, TEXT_ORIENT_HORIZ, size, Text, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM,
thickness, italic ); thickness, italic, false );
/*Draw texts : FileName */ /*Draw texts : FileName */
Text = Struct->GetFileName(); Text = Struct->GetFileName();
...@@ -810,7 +818,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct ) ...@@ -810,7 +818,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
txtcolor, txtcolor,
Text, TEXT_ORIENT_HORIZ, size, Text, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP,
thickness, italic ); thickness, italic, false );
/* Draw texts : SheetLabel */ /* Draw texts : SheetLabel */
SheetLabelStruct = Struct->m_Label; SheetLabelStruct = Struct->m_Label;
......
...@@ -452,7 +452,6 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, ...@@ -452,7 +452,6 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
DrawList = screen->EEDrawList; DrawList = screen->EEDrawList;
while( DrawList ) /* tracage */ while( DrawList ) /* tracage */
{ {
Plume( 'U' );
layer = LAYER_NOTES; layer = LAYER_NOTES;
switch( DrawList->Type() ) switch( DrawList->Type() )
...@@ -483,6 +482,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, ...@@ -483,6 +482,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
fprintf( PlotOutput, "[50 50] 0 setdash\n" ); fprintf( PlotOutput, "[50 50] 0 setdash\n" );
Move_Plume( StartPos, 'U' ); Move_Plume( StartPos, 'U' );
Move_Plume( EndPos, 'D' ); Move_Plume( EndPos, 'D' );
Plume( 'Z' );
fprintf( PlotOutput, "[] 0 setdash\n" ); fprintf( PlotOutput, "[] 0 setdash\n" );
break; break;
...@@ -491,6 +491,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, ...@@ -491,6 +491,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
fprintf( PlotOutput, "%d setlinewidth\n", g_PlotLine_Width * 3 ); fprintf( PlotOutput, "%d setlinewidth\n", g_PlotLine_Width * 3 );
Move_Plume( StartPos, 'U' ); Move_Plume( StartPos, 'U' );
Move_Plume( EndPos, 'D' ); Move_Plume( EndPos, 'D' );
Plume( 'Z' );
fprintf( PlotOutput, "%d setlinewidth\n", g_PlotLine_Width ); fprintf( PlotOutput, "%d setlinewidth\n", g_PlotLine_Width );
} }
break; break;
...@@ -499,6 +500,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, ...@@ -499,6 +500,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
SetCurrentLineWidth( -1 ); SetCurrentLineWidth( -1 );
Move_Plume( StartPos, 'U' ); Move_Plume( StartPos, 'U' );
Move_Plume( EndPos, 'D' ); Move_Plume( EndPos, 'D' );
Plume( 'Z' );
break; break;
} }
...@@ -554,7 +556,6 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, ...@@ -554,7 +556,6 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
break; break;
} }
Plume( 'U' );
DrawList = DrawList->Next(); DrawList = DrawList->Next();
} }
......
...@@ -79,7 +79,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -79,7 +79,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
if( isdigit( Name3[0] ) ) if( isdigit( Name3[0] ) )
{ {
thickness = atol( Name3 ); thickness = atol( Name3 );
TextStruct->m_Width = thickness; TextStruct->m_Bold = (thickness != 0);
} }
Struct = TextStruct; Struct = TextStruct;
if( stricmp( Name2, "Italic" ) == 0 ) if( stricmp( Name2, "Italic" ) == 0 )
...@@ -94,7 +94,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -94,7 +94,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->SetSchematicTextOrientation( orient ); TextStruct->SetSchematicTextOrientation( orient );
TextStruct->m_Shape = NET_INPUT; TextStruct->m_Shape = NET_INPUT;
TextStruct->m_Width = thickness; TextStruct->m_Bold = (thickness != 0);
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 ) if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
TextStruct->m_Shape = NET_OUTPUT; TextStruct->m_Shape = NET_OUTPUT;
...@@ -117,7 +117,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -117,7 +117,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->SetSchematicTextOrientation( orient ); TextStruct->SetSchematicTextOrientation( orient );
TextStruct->m_Shape = NET_INPUT; TextStruct->m_Shape = NET_INPUT;
TextStruct->m_Width = thickness; TextStruct->m_Bold = (thickness != 0);
if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 ) if( stricmp( Name2, SheetLabelType[NET_OUTPUT] ) == 0 )
TextStruct->m_Shape = NET_OUTPUT; TextStruct->m_Shape = NET_OUTPUT;
...@@ -152,7 +152,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -152,7 +152,7 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
if( isdigit( Name3[0] ) ) if( isdigit( Name3[0] ) )
{ {
thickness = atol( Name3 ); thickness = atol( Name3 );
TextStruct->m_Width = thickness; TextStruct->m_Bold = (thickness != 0);
} }
if( strnicmp( Name2, "Italic", 6 ) == 0 ) if( strnicmp( Name2, "Italic", 6 ) == 0 )
...@@ -759,10 +759,9 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, ...@@ -759,10 +759,9 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
else else
component->GetField( fieldNdx )->m_Italic = false; component->GetField( fieldNdx )->m_Italic = false;
if( Char3[2] == 'B' ) if( Char3[2] == 'B' )
component->GetField( fieldNdx )->m_Width = component->GetField( fieldNdx )->m_Bold = true;
component->GetField( fieldNdx )->m_Size.x / 4;
else else
component->GetField( fieldNdx )->m_Width = 0; component->GetField( fieldNdx )->m_Bold = false;
component->GetField( fieldNdx )->m_HJustify = hjustify; component->GetField( fieldNdx )->m_HJustify = hjustify;
component->GetField( fieldNdx )->m_VJustify = vjustify; component->GetField( fieldNdx )->m_VJustify = vjustify;
......
...@@ -280,6 +280,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d ...@@ -280,6 +280,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d
DrawGraphicText( panel, DC, DrawGraphicText( panel, DC,
pos, (EDA_Colors) g_DCodesColor, Line, pos, (EDA_Colors) g_DCodesColor, Line,
orient, wxSize( width, width ), orient, wxSize( width, width ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
0, false, false, false);
} }
} }
...@@ -496,6 +496,7 @@ public: ...@@ -496,6 +496,7 @@ public:
bool m_Mirror; // Display Normal / mirror bool m_Mirror; // Display Normal / mirror
int m_Attributs; /* flags (visible...) */ int m_Attributs; /* flags (visible...) */
bool m_Italic; /* true to simulate an italic font... */ bool m_Italic; /* true to simulate an italic font... */
bool m_Bold; /* true to use a bold font... */
GRTextHorizJustifyType m_HJustify; /* Horiz Justify */ GRTextHorizJustifyType m_HJustify; /* Horiz Justify */
GRTextVertJustifyType m_VJustify; /* Vertical and Vert Justify */ GRTextVertJustifyType m_VJustify; /* Vertical and Vert Justify */
bool m_MultilineAllowed; /* true to use multiline option, false to use only single line text bool m_MultilineAllowed; /* true to use multiline option, false to use only single line text
...@@ -507,13 +508,6 @@ public: ...@@ -507,13 +508,6 @@ public:
int GetLength() const { return m_Text.Length(); }; int GetLength() const { return m_Text.Length(); };
/**
* Function Pitch
* @return distance between 2 characters
* @param aMinTickness = min segments tickness
*/
int Pitch(int aMinTickness = 0);
/** Function Draw /** Function Draw
* @param aPanel = the current DrawPanel * @param aPanel = the current DrawPanel
* @param aDC = the current Device Context * @param aDC = the current Device Context
...@@ -571,7 +565,7 @@ public: ...@@ -571,7 +565,7 @@ public:
* @param aLine : the line of text to consider. * @param aLine : the line of text to consider.
* For single line text, this parameter is always m_Text * For single line text, this parameter is always m_Text
*/ */
int LenSize(const wxString & aLine); int LenSize(const wxString & aLine) const;
/** Function GetTextBox /** Function GetTextBox
* useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....) * useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....)
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
* @see common.h * @see common.h
*/ */
#ifndef __INCLUDE__DRAWTXT_H__ #ifndef __INCLUDE__DRAWTXT_H__
#define __INCLUDE__DRAWTXT_H__ 1 #define __INCLUDE__DRAWTXT_H__ 1
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
int TextWidth(const wxString& aText, int size_h, bool italic, bool bold );
/** Function NegableTextLength /** Function NegableTextLength
* Return the text length of a negable string, excluding the ~ markers */ * Return the text length of a negable string, excluding the ~ markers */
int NegableTextLength( const wxString& aText ); int NegableTextLength( const wxString& aText );
/** Function DrawGraphicText /** Function DrawGraphicText
* Draw a graphic text (like module texts) * Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas * @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
...@@ -29,6 +29,7 @@ int NegableTextLength( const wxString& aText ); ...@@ -29,6 +29,7 @@ int NegableTextLength( const wxString& aText );
* @param aWidth = line width (pen width) (default = 0) * @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width) * if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font
* @param aNegable = true to enable the ~ char for overbarring * @param aNegable = true to enable the ~ char for overbarring
* @param aCallback() = function called (if non null) to draw each segment. * @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings * used to draw 3D texts or for plotting, NULL for normal drawings
...@@ -42,9 +43,9 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel, ...@@ -42,9 +43,9 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel,
const wxSize &aSize, const wxSize &aSize,
enum GRTextHorizJustifyType aH_justify, enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify, enum GRTextVertJustifyType aV_justify,
int aWidth = 0, int aWidth,
bool aItalic = false, bool aItalic,
bool aNegable = false, bool aBold,
void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL ); void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL );
/** Function PlotGraphicText /** Function PlotGraphicText
...@@ -60,7 +61,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel, ...@@ -60,7 +61,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel,
* @param aWidth = line width (pen width) (default = 0) * @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width) * if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aNegable = true to enable the ~ char for overbarring * @param aBold = true to use a bold font
*/ */
void PlotGraphicText( int aFormat_plot, void PlotGraphicText( int aFormat_plot,
const wxPoint& aPos, const wxPoint& aPos,
...@@ -71,8 +72,8 @@ void PlotGraphicText( int aFormat_plot, ...@@ -71,8 +72,8 @@ void PlotGraphicText( int aFormat_plot,
enum GRTextHorizJustifyType aH_justify, enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify, enum GRTextVertJustifyType aV_justify,
int aWidth, int aWidth,
bool aItalic = false, bool aItalic,
bool aNegable = false ); bool aBold );
#endif /* __INCLUDE__DRAWTXT_H__ */ #endif /* __INCLUDE__DRAWTXT_H__ */
...@@ -30,7 +30,6 @@ static inline bool IsPostScript( int aFormat ) ...@@ -30,7 +30,6 @@ static inline bool IsPostScript( int aFormat )
const int PLOT_MIROIR = 1; const int PLOT_MIROIR = 1;
// Variables used in Common plot functions // Variables used in Common plot functions
extern wxPoint g_Plot_LastPenPosition;
extern wxPoint g_Plot_PlotOffset; extern wxPoint g_Plot_PlotOffset;
extern FILE* g_Plot_PlotOutputFile; extern FILE* g_Plot_PlotOutputFile;
extern double g_Plot_XScale, g_Plot_YScale; extern double g_Plot_XScale, g_Plot_YScale;
......
...@@ -275,16 +275,17 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag ) ...@@ -275,16 +275,17 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
{
TEXTE_PCB* PtText; TEXTE_PCB* PtText;
PtText = (TEXTE_PCB*) item; PtText = (TEXTE_PCB*) item;
if( PtText->GetLength() == 0 ) if( PtText->GetLength() == 0 )
break; break;
ux0 = PtText->m_Pos.x; uy0 = PtText->m_Pos.y; EDA_Rect textbox = PtText->GetTextBox(-1);
ux0 = textbox.GetX(); uy0 = textbox.GetY();
dx = PtText->Pitch() * PtText->GetLength(); dx = textbox.GetWidth();
dy = PtText->m_Size.y + PtText->m_Width; dy = textbox.GetHeight();
/* Put bounding box (rectangle) on matrix */ /* Put bounding box (rectangle) on matrix */
dx /= 2; dx /= 2;
...@@ -306,6 +307,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag ) ...@@ -306,6 +307,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
ux1 + via_marge, uy1 + via_marge, ux1 + via_marge, uy1 + via_marge,
(int) (PtText->m_Orient), (int) (PtText->m_Orient),
masque_layer, VIA_IMPOSSIBLE, WRITE_OR_CELL ); masque_layer, VIA_IMPOSSIBLE, WRITE_OR_CELL );
}
break; break;
default: default:
......
...@@ -466,7 +466,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -466,7 +466,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
DrawGraphicText( panel, DC, tpos, DrawGraphicText( panel, DC, tpos,
WHITE, buffer, t_angle, wxSize( tsize, tsize ), WHITE, buffer, t_angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false, false );
} }
} }
...@@ -487,6 +487,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -487,6 +487,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
tsize = (int) (tsize * 0.8); // reserve room for marges and segments thickness tsize = (int) (tsize * 0.8); // reserve room for marges and segments thickness
DrawGraphicText( panel, DC, tpos, DrawGraphicText( panel, DC, tpos,
WHITE, m_ShortNetname, t_angle, wxSize( tsize, tsize ), WHITE, m_ShortNetname, t_angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7,
false, false );
} }
} }
...@@ -413,7 +413,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const ...@@ -413,7 +413,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const
/* Trace du texte */ /* Trace du texte */
DrawGraphicText( panel, DC, pos, (enum EDA_Colors) color, m_Text, DrawGraphicText( panel, DC, pos, (enum EDA_Colors) color, m_Text,
orient, size, m_HJustify, m_VJustify, width, m_Italic ); orient, size, m_HJustify, m_VJustify, width, m_Italic, m_Bold);
} }
......
...@@ -687,7 +687,8 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -687,7 +687,8 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
tsize = (tsize * 8) / 10; // small reduction to give a better look tsize = (tsize * 8) / 10; // small reduction to give a better look
DrawGraphicText( panel, DC, tpos, DrawGraphicText( panel, DC, tpos,
WHITE, net->GetShortNetname(), angle, wxSize( tsize, tsize ), WHITE, net->GetShortNetname(), angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7,
false, false );
} }
} }
} }
...@@ -838,7 +839,8 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi ...@@ -838,7 +839,8 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
tsize = (tsize * 8) / 10; // small reduction to give a better look, inside via tsize = (tsize * 8) / 10; // small reduction to give a better look, inside via
DrawGraphicText( panel, DC, m_Start, DrawGraphicText( panel, DC, m_Start,
WHITE, net->GetShortNetname(), 0, wxSize( tsize, tsize ), WHITE, net->GetShortNetname(), 0, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7,
false, false);
} }
} }
} }
......
...@@ -315,7 +315,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w ...@@ -315,7 +315,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
msg, msg,
0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)), 0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
TextWidth ); TextWidth, false, false );
break; break;
} }
...@@ -344,7 +344,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w ...@@ -344,7 +344,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
Text, Text,
0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)), 0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
TextWidth ); TextWidth, false, false );
break; break;
} }
......
...@@ -353,7 +353,7 @@ static void PlotTextModule( TEXTE_MODULE* pt_texte, int format_plot ) ...@@ -353,7 +353,7 @@ static void PlotTextModule( TEXTE_MODULE* pt_texte, int format_plot )
pt_texte->m_Text, pt_texte->m_Text,
orient, size, orient, size,
pt_texte->m_HJustify, pt_texte->m_VJustify, pt_texte->m_HJustify, pt_texte->m_VJustify,
thickness, pt_texte->m_Italic, true ); thickness, pt_texte->m_Italic, pt_texte->m_Bold );
} }
...@@ -635,7 +635,7 @@ void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer ) ...@@ -635,7 +635,7 @@ void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer )
txt, txt,
orient, size, orient, size,
pt_texte->m_HJustify, pt_texte->m_VJustify, pt_texte->m_HJustify, pt_texte->m_VJustify,
thickness, pt_texte->m_Italic, true ); thickness, pt_texte->m_Italic, pt_texte->m_Bold );
pos += offset; pos += offset;
} }
...@@ -647,7 +647,7 @@ void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer ) ...@@ -647,7 +647,7 @@ void PlotTextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer )
pt_texte->m_Text, pt_texte->m_Text,
orient, size, orient, size,
pt_texte->m_HJustify, pt_texte->m_VJustify, pt_texte->m_HJustify, pt_texte->m_VJustify,
thickness, pt_texte->m_Italic, true ); thickness, pt_texte->m_Italic, pt_texte->m_Bold );
} }
......
...@@ -564,7 +564,7 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace ) ...@@ -564,7 +564,7 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace )
rayon = diam.x / 2; rayon = diam.x / 2;
if( rayon < 1 ) if( rayon < 1 )
rayon = 1; rayon = 1;
fprintf( dest, "newpath %d %d %d 0 360 arc fill stroke\n", fprintf( dest, "%d %d %d cir1\n",
centre.x, centre.y, rayon ); centre.x, centre.y, rayon );
} }
else else
...@@ -576,7 +576,7 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace ) ...@@ -576,7 +576,7 @@ void trace_1_pastille_RONDE_POST( wxPoint centre, int diametre, int modetrace )
if( rayon < w ) if( rayon < w )
w = rayon; w = rayon;
SetCurrentLineWidthPS( w ); SetCurrentLineWidthPS( w );
fprintf( dest, "newpath %d %d %d 0 360 arc stroke\n", fprintf( dest, "%d %d %d cir0\n",
centre.x, centre.y, rayon ); centre.x, centre.y, rayon );
} }
} }
...@@ -605,12 +605,12 @@ void trace_1_pad_rectangulaire_POST( wxPoint centre, ...@@ -605,12 +605,12 @@ void trace_1_pad_rectangulaire_POST( wxPoint centre,
RotatePoint( &x0, &y0, centre.x, centre.y, orient ); RotatePoint( &x0, &y0, centre.x, centre.y, orient );
RotatePoint( &x1, &y1, centre.x, centre.y, orient ); RotatePoint( &x1, &y1, centre.x, centre.y, orient );
fprintf( dest, "0 setlinewidth 0 setlinecap 0 setlinejoin\n" ); fprintf( dest, "linemode0 " );
ForcePenReinit(); // Force init line width for PlotFilledSegmentPS ForcePenReinit(); // Force init line width for PlotFilledSegmentPS
PlotFilledSegmentPS( wxPoint( x0, y0 ), wxPoint( x1, y1 ), w ); PlotFilledSegmentPS( wxPoint( x0, y0 ), wxPoint( x1, y1 ), w );
ForcePenReinit(); ForcePenReinit();
fprintf( dest, "linemode1 " );
SetCurrentLineWidthPS( 0 ); // Force init line width to default SetCurrentLineWidthPS( 0 ); // Force init line width to default
fprintf( dest, "1 setlinecap 1 setlinejoin\n" );
} }
else else
{ {
...@@ -772,7 +772,5 @@ void trace_1_pad_TRAPEZE_POST( wxPoint centre, wxSize size, wxSize delta, ...@@ -772,7 +772,5 @@ void trace_1_pad_TRAPEZE_POST( wxPoint centre, wxSize size, wxSize delta,
fprintf( dest, "%d %d lineto ", polygone[0].x, polygone[0].y ); fprintf( dest, "%d %d lineto ", polygone[0].x, polygone[0].y );
if( modetrace == FILLED ) fprintf( dest, "poly%d\n", (modetrace == FILLED?1:0) );
fprintf( dest, "fill " );
fprintf( dest, "stroke\n" );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment