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
af9ee9f4
Commit
af9ee9f4
authored
Feb 15, 2013
by
Jacobo Aragunde Perez
Committed by
jean-pierre charras
Feb 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plot dxf format: fix issue for some non latin1 chars.
parent
a379e5d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
common_plotDXF_functions.cpp
common/common_plotDXF_functions.cpp
+21
-1
No files found.
common/common_plotDXF_functions.cpp
View file @
af9ee9f4
...
...
@@ -528,6 +528,25 @@ void DXF_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorner
FinishTo
(
coord
[
0
]
);
}
/**
* Checks if a given string contains non-ASCII characters.
* FIXME: the performance of this code is really poor, but in this case it can be
* acceptable because the plot operation is not called very often.
* @param string String to check
* @return true if it contains some non-ASCII character, false if all characters are
* inside ASCII range (<=255).
*/
bool
containsNonAsciiChars
(
const
wxString
&
string
)
{
for
(
unsigned
i
=
0
;
i
<
string
.
length
();
i
++
)
{
wchar_t
ch
=
string
[
i
];
if
(
ch
>
255
)
return
true
;
}
return
false
;
}
void
DXF_PLOTTER
::
Text
(
const
wxPoint
&
aPos
,
enum
EDA_COLOR_T
aColor
,
const
wxString
&
aText
,
...
...
@@ -539,7 +558,8 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
bool
aItalic
,
bool
aBold
)
{
if
(
textAsLines
)
if
(
textAsLines
||
containsNonAsciiChars
(
aText
)
)
/* output text as graphics */
PLOTTER
::
Text
(
aPos
,
aColor
,
aText
,
aOrient
,
aSize
,
aH_justify
,
aV_justify
,
aWidth
,
aItalic
,
aBold
);
else
...
...
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