plotters rework: add plot fct to use TEXT_ATTRIBUTES class to pass text settings
Old PLOTTER::Text is not (yet) removed, but it use negative text size to mirrored text, which is not really compatible with some plotters (especially PDF). Using TEXT_ATTRIBUTES is much easy and much better, so PLOTTER::PlotText() is added. Note: "old" PLOTTER::Text() is not removed yet.
This commit is contained in:
@@ -853,3 +853,23 @@ void SVG_PLOTTER::Text( const VECTOR2I& aPos,
|
||||
|
||||
fputs( "</g>", m_outputFile );
|
||||
}
|
||||
|
||||
|
||||
void SVG_PLOTTER::PlotText( const VECTOR2I& aPos, const COLOR4D& aColor,
|
||||
const wxString& aText,
|
||||
const TEXT_ATTRIBUTES& aAttributes,
|
||||
KIFONT::FONT* aFont,
|
||||
void* aData )
|
||||
{
|
||||
VECTOR2I size = aAttributes.m_Size;
|
||||
|
||||
if( aAttributes.m_Mirrored )
|
||||
size.x = -size.x;
|
||||
|
||||
SVG_PLOTTER::Text( aPos, aColor, aText, aAttributes.m_Angle, size,
|
||||
aAttributes.m_Halign, aAttributes.m_Valign,
|
||||
aAttributes.m_StrokeWidth,
|
||||
aAttributes.m_Italic, aAttributes.m_Bold,
|
||||
aAttributes.m_Multiline,
|
||||
aFont, aData );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user