Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
42b4cae4
Commit
42b4cae4
authored
May 28, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit hershey patch
parent
8ff28f7b
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
440 additions
and
357 deletions
+440
-357
base_struct.cpp
common/base_struct.cpp
+4
-22
common_plotPS_functions.cpp
common/common_plotPS_functions.cpp
+16
-11
common_plot_functions.cpp
common/common_plot_functions.cpp
+30
-14
drawtxt.cpp
common/drawtxt.cpp
+201
-131
worksheet.cpp
common/worksheet.cpp
+37
-23
class_drawsheet.cpp
eeschema/class_drawsheet.cpp
+2
-2
class_hierarchical_PIN_sheet.cpp
eeschema/class_hierarchical_PIN_sheet.cpp
+1
-1
class_libentry_fields.cpp
eeschema/class_libentry_fields.cpp
+7
-7
class_libentry_fields.h
eeschema/class_libentry_fields.h
+1
-0
class_pin.cpp
eeschema/class_pin.cpp
+26
-36
class_sch_cmp_field.cpp
eeschema/class_sch_cmp_field.cpp
+6
-17
class_text-label.cpp
eeschema/class_text-label.cpp
+10
-8
classes_body_items.cpp
eeschema/classes_body_items.cpp
+8
-4
classes_body_items.h
eeschema/classes_body_items.h
+1
-2
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+3
-3
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+1
-1
dialog_edit_libentry_fields_in_lib.cpp
eeschema/dialog_edit_libentry_fields_in_lib.cpp
+3
-3
edit_graphic_bodyitem_text.cpp
eeschema/edit_graphic_bodyitem_text.cpp
+3
-3
edit_label.cpp
eeschema/edit_label.cpp
+2
-2
libfield.cpp
eeschema/libfield.cpp
+10
-5
plot.cpp
eeschema/plot.cpp
+21
-13
plotps.cpp
eeschema/plotps.cpp
+3
-2
read_from_file_schematic_items_descriptions.cpp
eeschema/read_from_file_schematic_items_descriptions.cpp
+6
-7
trpiste.cpp
gerbview/trpiste.cpp
+2
-1
base_struct.h
include/base_struct.h
+2
-8
drawtxt.h
include/drawtxt.h
+9
-8
plot_common.h
include/plot_common.h
+0
-1
board.cpp
pcbnew/board.cpp
+7
-5
class_pad_draw_functions.cpp
pcbnew/class_pad_draw_functions.cpp
+3
-2
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+1
-1
class_track.cpp
pcbnew/class_track.cpp
+4
-2
gen_drill_report_files.cpp
pcbnew/gen_drill_report_files.cpp
+2
-2
plot_rtn.cpp
pcbnew/plot_rtn.cpp
+3
-3
plotps.cpp
pcbnew/plotps.cpp
+5
-7
No files found.
common/base_struct.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
...
...
common/common_plotPS_functions.cpp
View file @
42b4cae4
...
...
@@ -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
};
...
...
common/common_plot_functions.cpp
View file @
42b4cae4
...
...
@@ -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
...
...
common/drawtxt.cpp
View file @
42b4cae4
...
...
@@ -18,7 +18,9 @@
#endif
#define EDA_DRAWBASE
#include "grfonte.h"
#include "hershey.h"
#define HERSHEY_SIZE 32.0
/* Functions to draw / plot a string.
* texts have only one line.
...
...
@@ -47,6 +49,54 @@ int NegableTextLength( const wxString& aText )
}
static
const
char
*
get_hershey_recipe
(
int
AsciiCode
,
bool
bold
)
{
AsciiCode
&=
0x7F
;
if
(
AsciiCode
<
32
)
AsciiCode
=
32
;
/* Clamp control chars */
AsciiCode
-=
32
;
if
(
bold
)
{
return
hershey_duplex
[
AsciiCode
];
}
else
{
return
hershey_simplex
[
AsciiCode
];
}
}
int
TextWidth
(
const
wxString
&
aText
,
int
size_h
,
bool
italic
,
bool
bold
)
{
int
tally
=
0
;
int
char_count
=
aText
.
length
();
for
(
int
i
=
0
;
i
<
char_count
;
i
++
)
{
int
AsciiCode
=
aText
[
i
];
if
(
AsciiCode
==
'~'
)
/* Skip the negation marks */
{
continue
;
}
const
char
*
ptcar
=
get_hershey_recipe
(
AsciiCode
,
bold
);
/* Get metrics */
int
xsta
=
*
ptcar
++
-
'R'
;
int
xsto
=
*
ptcar
++
-
'R'
;
tally
+=
wxRound
(
size_h
*
(
xsto
-
xsta
)
/
HERSHEY_SIZE
);
}
/* Italic correction, 1/8em */
if
(
italic
)
{
tally
+=
wxRound
(
size_h
*
0.125
);
}
return
tally
;
}
/* Helper function for drawing character polygons */
static
void
DrawGraphicTextPline
(
WinEDA_DrawPanel
*
aPanel
,
...
...
@@ -56,7 +106,7 @@ static void DrawGraphicTextPline(
bool
sketch_mode
,
int
point_count
,
wxPoint
*
coord
,
void
(
*
aCallback
)(
int
x0
,
int
y0
,
int
xf
,
int
yf
)
)
void
(
*
aCallback
)(
int
x0
,
int
y0
,
int
xf
,
int
yf
)
)
{
if
(
aCallback
)
{
...
...
@@ -80,7 +130,33 @@ static void DrawGraphicTextPline(
static
int
overbar_position
(
int
size_v
,
int
thickness
)
{
return
wxRound
(
(
double
)
size_v
*
1.1
+
(
double
)
thickness
);
return
wxRound
(
(
double
)
size_v
*
30.0
/
HERSHEY_SIZE
+
(
double
)
thickness
);
}
static
int
clamp_text_pen_size
(
int
width
,
int
size_h
,
bool
bold
)
{
/* As a rule, pen width should not be >1/8em, otherwise the character
* will be cluttered up in its own fatness */
/* XXX @todo: Should be handled in the UI and gerber plotter too */
int
maxWidth
=
wxRound
(
ABS
(
size_h
)
/
8.0
);
if
(
width
>
maxWidth
)
{
width
=
maxWidth
;
}
/* Special rule for bold text: the width should be at least 1.42 times the
* quantum unit, otherwise the line pairs will be visible! */
if
(
bold
)
{
int
minWidth
=
wxRound
(
ABS
(
size_h
)
*
1.42
/
HERSHEY_SIZE
+
0.5
);
if
(
width
<
minWidth
)
{
width
=
minWidth
;
}
}
return
width
;
}
...
...
@@ -98,7 +174,7 @@ static int overbar_position( int size_v, int thickness )
* @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 a
Negable = true to enable the ~ char for overbarring
* @param a
Bold = true to use a bold font
* @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings
*/
...
...
@@ -114,27 +190,26 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
enum
GRTextVertJustifyType
aV_justify
,
int
aWidth
,
bool
aItalic
,
bool
a
Negable
,
void
(
*
aCallback
)(
int
x0
,
int
y0
,
int
xf
,
int
yf
)
)
bool
a
Bold
,
void
(
*
aCallback
)(
int
x0
,
int
y0
,
int
xf
,
int
yf
)
)
/****************************************************************************************************/
{
int
char_count
,
AsciiCode
;
int
x0
,
y0
;
int
size_h
,
size_v
,
pitch
;
SH_CODE
f_cod
,
plume
=
'U'
;
const
SH_CODE
*
ptcar
;
int
ptr
;
int
dx
,
dy
;
// Draw coordinate for segments to draw. also used in some other calculation
wxPoint
current_char_pos
;
// Draw coordinates for the current char
wxPoint
overbar_pos
;
// Start point for the current overbar
int
overbars
;
// Number of ~ seen
int
char_count
,
AsciiCode
;
int
x0
,
y0
;
int
size_h
,
size_v
;
int
ptr
;
int
dx
,
dy
;
// Draw coordinate for segments to draw. also used in some other calculation
wxPoint
current_char_pos
;
// Draw coordinates for the current char
wxPoint
overbar_pos
;
// Start point for the current overbar
int
overbars
;
// Number of ~ seen
int
overbar_italic_comp
;
// Italic compensation for overbar
#define BUF_SIZE 100
wxPoint
coord
[
BUF_SIZE
+
1
];
// Buffer coordinate used to draw polylines (one char shape)
bool
sketch_mode
=
false
;
bool
italic_reverse
=
false
;
// true for mirrored texts with m_Size.x < 0
wxPoint
coord
[
BUF_SIZE
+
1
];
// Buffer coordinate used to draw polylines (one char shape)
bool
sketch_mode
=
false
;
bool
italic_reverse
=
false
;
// true for mirrored texts with m_Size.x < 0
size_h
=
aSize
.
x
;
size_h
=
aSize
.
x
;
/* PLEASE NOTE: H is for HORIZONTAL not for HEIGHT */
size_v
=
aSize
.
y
;
if
(
aWidth
<
0
)
...
...
@@ -142,35 +217,25 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
aWidth
=
-
aWidth
;
sketch_mode
=
true
;
}
int
thickness
=
aWidth
;
if
(
aSize
.
x
<
0
)
// text is mirrored using size.x < 0 (mirror / Y axis)
if
(
size_h
<
0
)
// text is mirrored using size.x < 0 (mirror / Y axis)
italic_reverse
=
true
;
if
(
aNegable
)
{
char_count
=
NegableTextLength
(
aText
);
}
else
{
char_count
=
aText
.
Len
();
}
aWidth
=
clamp_text_pen_size
(
aWidth
,
size_h
,
aBold
);
char_count
=
NegableTextLength
(
aText
);
if
(
char_count
==
0
)
return
;
pitch
=
(
10
*
size_h
)
/
9
;
// this is the pitch between chars
if
(
pitch
>
0
)
pitch
+=
thickness
;
else
pitch
-=
thickness
;
current_char_pos
=
aPos
;
dx
=
TextWidth
(
aText
,
size_h
,
aItalic
,
aBold
);
dy
=
size_v
;
/* Do not draw the text if out of draw area! */
if
(
aPanel
)
{
int
xm
,
ym
,
ll
,
xc
,
yc
;
int
textsize
=
ABS
(
pitch
);
ll
=
aPanel
->
GetScreen
()
->
Scale
(
textsize
*
char_count
);
ll
=
aPanel
->
GetScreen
()
->
Scale
(
ABS
(
dx
)
);
xc
=
GRMapX
(
current_char_pos
.
x
);
yc
=
GRMapY
(
current_char_pos
.
y
);
...
...
@@ -195,9 +260,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
* this position is the position of the left bottom point of the letter
* this is the same as the text position only for a left and bottom justified text
* In others cases, this position must be calculated from the text position ans size
*/
dx
=
pitch
*
char_count
;
dy
=
size_v
;
/* dx, dy = draw offset between first letter and text center */
*/
switch
(
aH_justify
)
{
...
...
@@ -216,7 +279,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
switch
(
aV_justify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
current_char_pos
.
y
+=
dy
/
2
;
current_char_pos
.
y
+=
dy
/
2
;
break
;
case
GR_TEXT_VJUSTIFY_TOP
:
...
...
@@ -235,7 +298,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
if
(
aPanel
&&
ABS
(
(
aPanel
->
GetScreen
()
->
Scale
(
aSize
.
x
)
)
)
<
3
)
{
/* draw the text as a line always vertically centered */
wxPoint
end
(
current_char_pos
.
x
+
dx
,
current_char_pos
.
y
);
wxPoint
end
(
current_char_pos
.
x
+
dx
,
current_char_pos
.
y
);
RotatePoint
(
&
current_char_pos
,
aPos
,
aOrient
);
RotatePoint
(
&
end
,
aPos
,
aOrient
);
...
...
@@ -244,129 +307,128 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
aCallback
(
current_char_pos
.
x
,
current_char_pos
.
y
,
end
.
x
,
end
.
y
);
else
GRLine
(
&
aPanel
->
m_ClipBox
,
aDC
,
current_char_pos
.
x
,
current_char_pos
.
y
,
end
.
x
,
end
.
y
,
aWidth
,
aColor
);
current_char_pos
.
x
,
current_char_pos
.
y
,
end
.
x
,
end
.
y
,
aWidth
,
aColor
);
return
;
}
if
(
aItalic
)
{
overbar_italic_comp
=
overbar_position
(
size_v
,
aWidth
)
/
8
;
if
(
italic_reverse
)
{
overbar_italic_comp
=
-
overbar_italic_comp
;
}
}
else
{
overbar_italic_comp
=
0
;
};
overbars
=
0
;
ptr
=
0
;
/* ptr = text index */
while
(
ptr
<
char_count
)
{
if
(
a
Negable
)
if
(
a
Text
[
ptr
+
overbars
]
==
'~'
)
{
if
(
aText
[
ptr
+
overbars
]
==
'~'
)
{
/* Found an overbar, adjust the pointers */
overbars
++
;
/* Found an overbar, adjust the pointers */
overbars
++
;
if
(
overbars
%
2
)
{
/* Starting the overbar */
overbar_pos
=
current_char_pos
;
overbar_pos
.
y
-=
overbar_position
(
size_v
,
thickness
);
RotatePoint
(
&
overbar_pos
,
aPos
,
aOrient
);
}
else
{
/* Ending the overbar */
coord
[
0
]
=
overbar_pos
;
overbar_pos
=
current_char_pos
;
overbar_pos
.
y
-=
overbar_position
(
size_v
,
thickness
);
RotatePoint
(
&
overbar_pos
,
aPos
,
aOrient
);
coord
[
1
]
=
overbar_pos
;
/* Plot the overbar segment */
DrawGraphicTextPline
(
aPanel
,
aDC
,
aColor
,
aWidth
,
sketch_mode
,
2
,
coord
,
aCallback
);
}
continue
;
/* Skip ~ processing */
if
(
overbars
%
2
)
{
/* Starting the overbar */
overbar_pos
=
current_char_pos
;
overbar_pos
.
x
+=
overbar_italic_comp
;
overbar_pos
.
y
-=
overbar_position
(
size_v
,
aWidth
);
RotatePoint
(
&
overbar_pos
,
aPos
,
aOrient
);
}
else
{
/* Ending the overbar */
coord
[
0
]
=
overbar_pos
;
overbar_pos
=
current_char_pos
;
overbar_pos
.
x
+=
overbar_italic_comp
;
overbar_pos
.
y
-=
overbar_position
(
size_v
,
aWidth
);
RotatePoint
(
&
overbar_pos
,
aPos
,
aOrient
);
coord
[
1
]
=
overbar_pos
;
/* Plot the overbar segment */
DrawGraphicTextPline
(
aPanel
,
aDC
,
aColor
,
aWidth
,
sketch_mode
,
2
,
coord
,
aCallback
);
}
continue
;
/* Skip ~ processing */
}
AsciiCode
=
aText
.
GetChar
(
ptr
+
overbars
);
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode
&=
0x7FF
;
if
(
AsciiCode
>
0x40F
&&
AsciiCode
<
0x450
)
// big small Cyr
AsciiCode
=
utf8_to_ascii
[
AsciiCode
-
0x410
]
&
0xFF
;
else
AsciiCode
=
AsciiCode
&
0xFF
;
#else
AsciiCode
&=
0xFF
;
#endif
ptcar
=
graphic_fonte_shape
[
AsciiCode
];
/* ptcar pointe la description
* du caractere a dessiner */
int
point_count
;
bool
endcar
;
for
(
point_count
=
0
,
endcar
=
false
;
!
endcar
;
ptcar
++
)
const
char
*
ptcar
=
get_hershey_recipe
(
AsciiCode
,
aBold
);
/* Get metrics */
int
xsta
=
*
ptcar
++
-
'R'
;
int
xsto
=
*
ptcar
++
-
'R'
;
int
point_count
=
0
;
bool
endcar
=
false
;
while
(
!
endcar
)
{
f_cod
=
*
ptcar
;
/* get code n de la forme selectionnee */
switch
(
f_cod
)
int
hc1
,
hc2
;
hc1
=
*
ptcar
++
;
if
(
hc1
)
{
case
'X'
:
endcar
=
true
;
/* fin du caractere */
break
;
hc2
=
*
ptcar
++
;
}
else
{
/* End of character, insert a synthetic pen up */
hc1
=
' '
;
hc2
=
'R'
;
endcar
=
true
;
}
hc1
-=
'R'
;
hc2
-=
'R'
;
/* Do the Hershey decode thing: coordinates values are coded as <value> + 'R' */
case
'U'
:
if
(
point_count
&&
(
plume
==
'D'
)
)
/* Pen up request */
if
(
hc1
==
-
50
&&
hc2
==
0
)
{
if
(
point_count
)
{
if
(
aWidth
<=
1
)
aWidth
=
0
;
DrawGraphicTextPline
(
aPanel
,
aDC
,
aColor
,
aWidth
,
sketch_mode
,
point_count
,
coord
,
aCallback
);
}
plume
=
f_cod
;
point_count
=
0
;
break
;
case
'D'
:
plume
=
f_cod
;
break
;
default:
point_count
=
0
;
}
else
{
int
y
,
k1
,
k2
;
wxPoint
currpoint
;
y
=
k1
=
f_cod
;
/* trace sur axe V */
k1
=
-
(
(
k1
*
size_v
)
/
9
);
ptcar
++
;
f_cod
=
*
ptcar
;
k2
=
f_cod
;
/* trace sur axe H */
k2
=
(
k2
*
size_h
)
/
9
;
hc1
-=
xsta
;
hc2
-=
11
;
/* Align the midpoint */
hc1
=
wxRound
(
hc1
*
size_h
/
HERSHEY_SIZE
);
hc2
=
wxRound
(
hc2
*
size_v
/
HERSHEY_SIZE
);
// To simulate an italic font, add a x offset depending on the y offset
if
(
aItalic
)
k2
-=
italic_reverse
?
-
k1
/
8
:
k1
/
8
;
currpoint
.
x
=
k2
+
current_char_pos
.
x
;
currpoint
.
y
=
k1
+
current_char_pos
.
y
;
hc1
-=
wxRound
(
italic_reverse
?
-
hc2
/
8.0
:
hc2
/
8.0
)
;
currpoint
.
x
=
hc1
+
current_char_pos
.
x
;
currpoint
.
y
=
hc2
+
current_char_pos
.
y
;
RotatePoint
(
&
currpoint
,
aPos
,
aOrient
);
coord
[
point_count
]
=
currpoint
;
if
(
point_count
<
BUF_SIZE
-
1
)
if
(
point_count
<
BUF_SIZE
-
1
)
point_count
++
;
break
;
}
}
/* end switch */
}
/* end draw 1 char */
ptr
++
;
current_char_pos
.
x
+=
pitch
;
// current_char_pos is now the next position
// Apply the advance width
current_char_pos
.
x
+=
wxRound
(
size_h
*
(
xsto
-
xsta
)
/
HERSHEY_SIZE
);
}
if
(
overbars
%
2
)
{
/* Close the last overbar */
coord
[
0
]
=
overbar_pos
;
overbar_pos
=
current_char_pos
;
overbar_pos
.
y
-=
overbar_position
(
size_v
,
thickness
);
coord
[
0
]
=
overbar_pos
;
overbar_pos
=
current_char_pos
;
overbar_pos
.
y
-=
overbar_position
(
size_v
,
aWidth
);
RotatePoint
(
&
overbar_pos
,
aPos
,
aOrient
);
coord
[
1
]
=
overbar_pos
;
/* Plot the overbar segment */
...
...
@@ -384,12 +446,9 @@ static bool s_Plotbegin; // Flag to init plot
/*
* The call back function
*/
/**********************/
static
void
s_Callback_plot
(
int
x0
,
int
y0
,
int
xf
,
int
yf
)
/**********************/
/****************************************************************/
static
void
s_Callback_plot
(
int
x0
,
int
y0
,
int
xf
,
int
yf
)
/****************************************************************/
{
static
wxPoint
PenLastPos
;
wxPoint
pstart
;
...
...
@@ -435,7 +494,7 @@ static void s_Callback_plot( int x0,
* @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 a
Negable = true to enable the ~ char for overbarring
* @param a
Bold = true to use a bold font
*/
/******************************************************************************************/
void
PlotGraphicText
(
int
aFormat_plot
,
...
...
@@ -448,14 +507,24 @@ void PlotGraphicText( int aFormat_plot,
enum
GRTextVertJustifyType
aV_justify
,
int
aWidth
,
bool
aItalic
,
bool
a
Negable
)
bool
a
Bold
)
/******************************************************************************************/
{
if
(
aWidth
>
0
)
{
aWidth
=
clamp_text_pen_size
(
aWidth
,
aSize
.
x
,
aBold
);
}
else
{
aWidth
=
-
clamp_text_pen_size
(
-
aWidth
,
aSize
.
x
,
aBold
);
}
// Initialise the actual function used to plot lines:
switch
(
aFormat_plot
)
{
case
PLOT_FORMAT_POST
:
MovePenFct
=
LineTo_PS
;
SetCurrentLineWidthPS
(
aWidth
);
break
;
case
PLOT_FORMAT_HPGL
:
...
...
@@ -464,6 +533,7 @@ void PlotGraphicText( int aFormat_plot,
case
PLOT_FORMAT_GERBER
:
MovePenFct
=
LineTo_GERBER
;
/* Gerber tool has to be set outside... */
break
;
default:
...
...
@@ -477,7 +547,7 @@ void PlotGraphicText( int aFormat_plot,
DrawGraphicText
(
NULL
,
NULL
,
aPos
,
aColor
,
aText
,
aOrient
,
aSize
,
aH_justify
,
aV_justify
,
aWidth
,
aItalic
,
a
Negable
,
aWidth
,
aItalic
,
a
Bold
,
s_Callback_plot
);
/* end text : pen UP ,no move */
...
...
common/worksheet.cpp
View file @
42b4cae4
...
...
@@ -997,7 +997,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
if
(
WsItem
->
m_Legende
)
msg
=
WsItem
->
m_Legende
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_VERT
,
size
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
width
);
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
width
,
false
,
false
,
false
);
break
;
case
WS_SEGMENT_LU
:
xg
=
Sheet
->
m_LeftMargin
-
WsItem
->
m_Endx
;
...
...
@@ -1044,7 +1045,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
Color
,
Line
,
TEXT_ORIENT_HORIZ
,
size_ref
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
width
,
false
,
false
,
false
);
if
(
ii
<
xg
-
PAS_REF
/
2
)
{
GRLine
(
&
DrawPanel
->
m_ClipBox
,
DC
,
ii
*
scale
,
yg
*
scale
,
...
...
@@ -1055,7 +1056,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
(
yg
-
GRID_REF_W
/
2
)
*
scale
),
Color
,
Line
,
TEXT_ORIENT_HORIZ
,
size_ref
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
width
,
false
,
false
,
false
);
}
/* Trace des reperes selon l'axe Y */
...
...
@@ -1079,7 +1080,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
Color
,
Line
,
TEXT_ORIENT_HORIZ
,
size_ref
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
width
,
false
,
false
,
false
);
if
(
ii
<
yg
-
PAS_REF
/
2
)
{
GRLine
(
&
DrawPanel
->
m_ClipBox
,
DC
,
xg
*
scale
,
ii
*
scale
,
...
...
@@ -1090,7 +1091,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
(
ii
-
gxpas
/
2
)
*
scale
),
Color
,
Line
,
TEXT_ORIENT_HORIZ
,
size_ref
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
width
,
false
,
false
,
false
);
}
#endif
...
...
@@ -1119,7 +1120,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
width
,
false
,
false
,
false
);
break
;
case
WS_SIZESHEET
:
break
;
...
...
@@ -1129,7 +1130,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
<<
screen
->
m_ScreenNumber
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
case
WS_SHEETS
:
if
(
WsItem
->
m_Legende
)
...
...
@@ -1137,7 +1138,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
<<
screen
->
m_NumberOfScreen
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
case
WS_COMPANY_NAME
:
break
;
...
...
@@ -1181,14 +1182,14 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
if
(
WsItem
->
m_Legende
)
msg
=
WsItem
->
m_Legende
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
case
WS_IDENTSHEET_D
:
if
(
WsItem
->
m_Legende
)
msg
=
WsItem
->
m_Legende
;
msg
<<
screen
->
m_ScreenNumber
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
case
WS_LEFT_SEGMENT_D
:
pos
.
y
=
(
refy
-
WsItem
->
m_Posy
)
*
scale
;
...
...
@@ -1221,7 +1222,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
+=
screen
->
m_Date
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
true
,
false
);
break
;
case
WS_REV
:
...
...
@@ -1230,7 +1232,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
+=
screen
->
m_Revision
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
true
,
false
);
break
;
case
WS_KICAD_VERSION
:
...
...
@@ -1240,7 +1243,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
+=
wxT
(
" "
)
+
GetBuildVersion
();
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
case
WS_SIZESHEET
:
...
...
@@ -1249,7 +1253,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
+=
Sheet
->
m_Name
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
...
...
@@ -1259,7 +1264,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
<<
screen
->
m_ScreenNumber
<<
wxT
(
"/"
)
<<
screen
->
m_NumberOfScreen
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
case
WS_FILENAME
:
...
...
@@ -1271,7 +1277,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
<<
fname
<<
wxT
(
"."
)
<<
fext
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
}
break
;
...
...
@@ -1281,7 +1288,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
+=
GetScreenDesc
();
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
break
;
...
...
@@ -1293,7 +1301,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
true
,
false
);
UpperLimit
=
MAX
(
UpperLimit
,
WsItem
->
m_Posy
+
SIZETEXT
);
}
break
;
...
...
@@ -1304,7 +1313,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
msg
+=
screen
->
m_Title
;
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
true
,
false
);
break
;
case
WS_COMMENT1
:
...
...
@@ -1315,7 +1325,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
UpperLimit
=
MAX
(
UpperLimit
,
WsItem
->
m_Posy
+
SIZETEXT
);
}
break
;
...
...
@@ -1328,7 +1339,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
UpperLimit
=
MAX
(
UpperLimit
,
WsItem
->
m_Posy
+
SIZETEXT
);
}
break
;
...
...
@@ -1341,7 +1353,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
UpperLimit
=
MAX
(
UpperLimit
,
WsItem
->
m_Posy
+
SIZETEXT
);
}
break
;
...
...
@@ -1354,7 +1367,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
{
DrawGraphicText
(
DrawPanel
,
DC
,
pos
,
Color
,
msg
,
TEXT_ORIENT_HORIZ
,
size
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
width
,
false
,
false
,
false
);
UpperLimit
=
MAX
(
UpperLimit
,
WsItem
->
m_Posy
+
SIZETEXT
);
}
break
;
...
...
eeschema/class_drawsheet.cpp
View file @
42b4cae4
...
...
@@ -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 */
...
...
eeschema/class_hierarchical_PIN_sheet.cpp
View file @
42b4cae4
...
...
@@ -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
,
tru
e
);
side
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
fals
e
);
}
/* Draw the graphic symbol */
...
...
eeschema/class_libentry_fields.cpp
View file @
42b4cae4
...
...
@@ -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
;
}
...
...
eeschema/class_libentry_fields.h
View file @
42b4cae4
...
...
@@ -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
;
}
...
...
eeschema/class_pin.cpp
View file @
42b4cae4
...
...
@@ -491,13 +491,10 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
x1
+=
m_PinLen
;
break
;
}
float
fPinTextPitch
=
(
PinNameSize
.
x
*
1.1
)
+
LineWidth
;
PinTxtLen
=
NegableTextLength
(
m_PinName
);
PinTxtLen
=
TextWidth
(
m_PinName
,
PinNameSize
.
x
,
false
,
false
)
+
LineWidth
;
if
(
PinTxtLen
==
0
)
DrawPinName
=
FALSE
;
PinTxtLen
=
(
int
)
(
fPinTextPitch
*
PinTxtLen
);
if
(
TextInside
)
/* Draw the text inside, but the pin numbers outside. */
{
...
...
@@ -515,7 +512,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
PinNameSize
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
tru
e
);
false
,
fals
e
);
}
else
// Orient == PIN_LEFT
{
...
...
@@ -526,7 +523,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
PinNameSize
,
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
tru
e
);
false
,
fals
e
);
}
}
...
...
@@ -538,7 +535,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
StringPinNum
,
TEXT_ORIENT_HORIZ
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
);
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
,
false
,
false
,
false
);
}
}
else
/* Its a vertical line. */
...
...
@@ -554,7 +551,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
TEXT_ORIENT_VERT
,
PinNameSize
,
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
tru
e
);
false
,
fals
e
);
if
(
DrawPinNum
)
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
x1
-
TXTMARGE
,
...
...
@@ -562,7 +559,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
StringPinNum
,
TEXT_ORIENT_VERT
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
);
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
,
false
,
false
,
false
);
}
else
/* PIN_UP */
{
...
...
@@ -574,7 +571,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
TEXT_ORIENT_VERT
,
PinNameSize
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
tru
e
);
false
,
fals
e
);
if
(
DrawPinNum
)
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
x1
-
TXTMARGE
,
...
...
@@ -582,7 +579,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
StringPinNum
,
TEXT_ORIENT_VERT
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
);
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
,
false
,
false
,
false
);
}
}
}
...
...
@@ -600,7 +598,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
TEXT_ORIENT_HORIZ
,
PinNameSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
,
false
,
tru
e
);
false
,
fals
e
);
}
if
(
DrawPinNum
)
{
...
...
@@ -611,7 +609,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
TEXT_ORIENT_HORIZ
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_TOP
,
LineWidth
);
LineWidth
,
false
,
false
,
false
);
}
}
else
/* Its a vertical line. */
...
...
@@ -624,7 +622,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
NameColor
,
m_PinName
,
TEXT_ORIENT_VERT
,
PinNameSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
,
false
,
tru
e
);
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
,
false
,
fals
e
);
}
if
(
DrawPinNum
)
...
...
@@ -635,16 +633,12 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
NumColor
,
StringPinNum
,
TEXT_ORIENT_VERT
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_TOP
,
LineWidth
);
GR_TEXT_VJUSTIFY_TOP
,
LineWidth
,
false
,
false
,
false
);
}
}
}
}
extern
void
Move_Plume
(
wxPoint
pos
,
int
plume
);
// see plot.cpp
/*****************************************************************************
* Plot pin number and pin text info, given the pin line coordinates. *
* Same as DrawPinTexts((), but output is the plotter
...
...
@@ -659,7 +653,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
int
TextInside
,
bool
DrawPinNum
,
bool
DrawPinName
,
int
aWidth
,
bool
aItalic
)
int
aWidth
)
{
int
x
,
y
,
x1
,
y1
;
wxString
StringPinNum
;
...
...
@@ -693,13 +687,9 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
x1
+=
m_PinLen
;
break
;
}
float
fPinTextPitch
=
(
PinNameSize
.
x
*
1.1
)
+
aWidth
;
PinTxtLen
=
NegableTextLength
(
m_PinName
);
PinTxtLen
=
TextWidth
(
m_PinName
,
PinNameSize
.
x
,
false
,
false
)
+
aWidth
;
if
(
PinTxtLen
==
0
)
DrawPinName
=
FALSE
;
PinTxtLen
=
(
int
)
(
fPinTextPitch
*
PinTxtLen
);
if
(
TextInside
)
/* Draw the text inside, but the pin numbers outside. */
{
...
...
@@ -716,7 +706,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
PinNameSize
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
aWidth
,
aItalic
,
tru
e
);
aWidth
,
false
,
fals
e
);
}
else
// orient == PIN_LEFT
{
...
...
@@ -727,7 +717,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
PinNameSize
,
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_CENTER
,
aWidth
,
aItalic
,
tru
e
);
aWidth
,
false
,
fals
e
);
}
if
(
DrawPinNum
)
{
...
...
@@ -737,7 +727,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_HORIZ
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
aWidth
,
aItalic
);
aWidth
,
false
,
false
);
}
}
}
...
...
@@ -753,7 +743,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_VERT
,
PinNameSize
,
GR_TEXT_HJUSTIFY_RIGHT
,
GR_TEXT_VJUSTIFY_CENTER
,
aWidth
,
aItalic
,
tru
e
);
aWidth
,
false
,
fals
e
);
if
(
DrawPinNum
)
{
PlotGraphicText
(
g_PlotFormat
,
...
...
@@ -763,7 +753,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_VERT
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
aWidth
,
aItalic
);
aWidth
,
false
,
false
);
}
}
else
/* PIN_UP */
...
...
@@ -776,7 +766,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_VERT
,
PinNameSize
,
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_CENTER
,
aWidth
,
aItalic
,
tru
e
);
aWidth
,
false
,
fals
e
);
if
(
DrawPinNum
)
{
PlotGraphicText
(
g_PlotFormat
,
...
...
@@ -786,7 +776,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_VERT
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
aWidth
,
aItalic
);
aWidth
,
false
,
false
);
}
}
}
...
...
@@ -805,7 +795,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_HORIZ
,
PinNameSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
aWidth
,
aItalic
,
tru
e
);
aWidth
,
false
,
fals
e
);
}
if
(
DrawPinNum
)
{
...
...
@@ -815,7 +805,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_HORIZ
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_TOP
,
aWidth
,
aItalic
);
aWidth
,
false
,
false
);
}
}
else
/* Its a vertical line. */
...
...
@@ -829,7 +819,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_VERT
,
PinNameSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_BOTTOM
,
aWidth
,
aItalic
,
tru
e
);
aWidth
,
false
,
fals
e
);
}
if
(
DrawPinNum
)
...
...
@@ -841,7 +831,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
TEXT_ORIENT_VERT
,
PinNumSize
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_TOP
,
aWidth
,
aItalic
);
aWidth
,
false
,
false
);
}
}
}
...
...
eeschema/class_sch_cmp_field.cpp
View file @
42b4cae4
...
...
@@ -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
;
}
...
...
eeschema/class_text-label.cpp
View file @
42b4cae4
...
...
@@ -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
;
...
...
eeschema/classes_body_items.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
...
...
eeschema/classes_body_items.h
View file @
42b4cae4
...
...
@@ -243,8 +243,7 @@ public:
int
TextInside
,
bool
DrawPinNum
,
bool
DrawPinNameint
,
int
aWidth
,
bool
aItalic
);
int
aWidth
);
};
...
...
eeschema/dialog_edit_component_in_schematic.cpp
View file @
42b4cae4
...
...
@@ -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
;
...
...
eeschema/dialog_edit_label.cpp
View file @
42b4cae4
...
...
@@ -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
);
...
...
eeschema/dialog_edit_libentry_fields_in_lib.cpp
View file @
42b4cae4
...
...
@@ -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
;
...
...
eeschema/edit_graphic_bodyitem_text.cpp
View file @
42b4cae4
...
...
@@ -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
();
...
...
eeschema/edit_label.cpp
View file @
42b4cae4
...
...
@@ -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
();
...
...
eeschema/libfield.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
...
...
eeschema/plot.cpp
View file @
42b4cae4
...
...
@@ -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
;
...
...
eeschema/plotps.cpp
View file @
42b4cae4
...
...
@@ -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
();
}
...
...
eeschema/read_from_file_schematic_items_descriptions.cpp
View file @
42b4cae4
...
...
@@ -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
;
...
...
gerbview/trpiste.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
}
include/base_struct.h
View file @
42b4cae4
...
...
@@ -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....)
...
...
include/drawtxt.h
View file @
42b4cae4
...
...
@@ -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 a
Negable = true to enable the ~ char for overbarring
* @param a
Bold = 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
a
Negable
=
false
);
bool
aItalic
,
bool
a
Bold
);
#endif
/* __INCLUDE__DRAWTXT_H__ */
include/plot_common.h
View file @
42b4cae4
...
...
@@ -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
;
...
...
pcbnew/board.cpp
View file @
42b4cae4
...
...
@@ -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
->
GetLeng
th
();
dy
=
PtText
->
m_Size
.
y
+
PtText
->
m_Width
;
EDA_Rect
textbox
=
PtText
->
GetTextBox
(
-
1
)
;
ux0
=
textbox
.
GetX
();
uy0
=
textbox
.
GetY
();
dx
=
textbox
.
GetWid
th
();
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
:
...
...
pcbnew/class_pad_draw_functions.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
}
pcbnew/class_text_mod.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
...
...
pcbnew/class_track.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
}
}
...
...
pcbnew/gen_drill_report_files.cpp
View file @
42b4cae4
...
...
@@ -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
;
}
...
...
pcbnew/plot_rtn.cpp
View file @
42b4cae4
...
...
@@ -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
);
}
...
...
pcbnew/plotps.cpp
View file @
42b4cae4
...
...
@@ -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
)
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment