Commit 42b4cae4 authored by charras's avatar charras

commit hershey patch

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