Change super/subscript syntax to ^{foo} and _{foo}.
This commit is contained in:
parent
42cd604c3c
commit
2b6089240a
|
@ -115,14 +115,14 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const TEXTE_PCB* aText,
|
|||
|
||||
GRText( nullptr, positions[ii], dummy_color, txt, aText->GetTextAngle(), size,
|
||||
aText->GetHorizJustify(), aText->GetVertJustify(), penWidth,
|
||||
aText->IsItalic(), forceBold, 0, addTextSegmToContainer );
|
||||
aText->IsItalic(), forceBold, addTextSegmToContainer );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GRText( nullptr, aText->GetTextPos(), dummy_color, aText->GetShownText(),
|
||||
aText->GetTextAngle(), size, aText->GetHorizJustify(), aText->GetVertJustify(),
|
||||
penWidth, aText->IsItalic(), forceBold, 0, addTextSegmToContainer );
|
||||
penWidth, aText->IsItalic(), forceBold, addTextSegmToContainer );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo
|
|||
|
||||
GRText( NULL, text->GetTextPos(), BLACK, text->GetShownText(), text->GetDrawRotation(),
|
||||
size, text->GetHorizJustify(), text->GetVertJustify(), penWidth, text->IsItalic(),
|
||||
forceBold, 0, addTextSegmToContainer );
|
||||
forceBold, addTextSegmToContainer );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@ EDA_TEXT_VJUSTIFY_T EDA_TEXT::MapVertJustify( int aVertJustify )
|
|||
}
|
||||
|
||||
|
||||
EDA_TEXT::EDA_TEXT( const wxString& text, int aTextMarkupFlags ) :
|
||||
m_textMarkupFlags( aTextMarkupFlags ),
|
||||
EDA_TEXT::EDA_TEXT( const wxString& text ) :
|
||||
m_text( text ),
|
||||
m_e( 1<<TE_VISIBLE )
|
||||
{
|
||||
|
@ -97,7 +96,6 @@ EDA_TEXT::EDA_TEXT( const wxString& text, int aTextMarkupFlags ) :
|
|||
|
||||
|
||||
EDA_TEXT::EDA_TEXT( const EDA_TEXT& aText ) :
|
||||
m_textMarkupFlags( aText.m_textMarkupFlags ),
|
||||
m_text( aText.m_text ),
|
||||
m_e( aText.m_e )
|
||||
{
|
||||
|
@ -171,14 +169,14 @@ bool EDA_TEXT::Replace( wxFindReplaceData& aSearchData )
|
|||
}
|
||||
|
||||
|
||||
int EDA_TEXT::LenSize( const wxString& aLine, int aThickness, int aMarkupFlags ) const
|
||||
int EDA_TEXT::LenSize( const wxString& aLine, int aThickness ) const
|
||||
{
|
||||
basic_gal.SetFontItalic( IsItalic() );
|
||||
basic_gal.SetFontBold( IsBold() );
|
||||
basic_gal.SetLineWidth( (float) aThickness );
|
||||
basic_gal.SetGlyphSize( VECTOR2D( GetTextSize() ) );
|
||||
|
||||
VECTOR2D tsize = basic_gal.GetTextLineSize( aLine, aMarkupFlags );
|
||||
VECTOR2D tsize = basic_gal.GetTextLineSize( aLine );
|
||||
|
||||
return KiROUND( tsize.x );
|
||||
}
|
||||
|
@ -244,8 +242,7 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
|
|||
const auto& font = basic_gal.GetStrokeFont();
|
||||
VECTOR2D fontSize( GetTextSize() );
|
||||
double penWidth( thickness );
|
||||
int dx = KiROUND( font.ComputeStringBoundaryLimits( text, fontSize, penWidth,
|
||||
m_textMarkupFlags ).x );
|
||||
int dx = KiROUND( font.ComputeStringBoundaryLimits( text, fontSize, penWidth ).x );
|
||||
int dy = GetInterline();
|
||||
|
||||
// Creates bounding box (rectangle) for horizontal, left and top justified text. The
|
||||
|
@ -284,8 +281,7 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
|
|||
for( unsigned ii = 1; ii < strings.GetCount(); ii++ )
|
||||
{
|
||||
text = strings.Item( ii );
|
||||
dx = KiROUND( font.ComputeStringBoundaryLimits( text, fontSize, penWidth,
|
||||
m_textMarkupFlags ).x );
|
||||
dx = KiROUND( font.ComputeStringBoundaryLimits( text, fontSize, penWidth ).x );
|
||||
textsize.x = std::max( textsize.x, dx );
|
||||
textsize.y += dy;
|
||||
}
|
||||
|
@ -465,7 +461,7 @@ void EDA_TEXT::printOneLineOfText( RENDER_SETTINGS* aSettings, const wxPoint& aO
|
|||
size.x = -size.x;
|
||||
|
||||
GRText( DC, aOffset + aPos, aColor, aText, GetTextAngle(), size, GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold(), m_textMarkupFlags );
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -592,14 +588,14 @@ void EDA_TEXT::TransformTextShapeToSegmentList( std::vector<wxPoint>& aCornerBuf
|
|||
{
|
||||
wxString txt = strings_list.Item( ii );
|
||||
GRText( NULL, positions[ii], color, txt, GetTextAngle(), size, GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, 0, addTextSegmToBuffer,
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, addTextSegmToBuffer,
|
||||
&aCornerBuffer );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GRText( NULL, GetTextPos(), color, GetText(), GetTextAngle(), size, GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, 0, addTextSegmToBuffer,
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, addTextSegmToBuffer,
|
||||
&aCornerBuffer );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,12 +169,12 @@ void GAL::ResetTextAttributes()
|
|||
}
|
||||
|
||||
|
||||
VECTOR2D GAL::GetTextLineSize( const UTF8& aText, int aMarkupFlags ) const
|
||||
VECTOR2D GAL::GetTextLineSize( const UTF8& aText ) const
|
||||
{
|
||||
// Compute the X and Y size of a given text.
|
||||
// Because computeTextLineSize expects a one line text,
|
||||
// aText is expected to be only one line text.
|
||||
return strokeFont.computeTextLineSize( aText, aMarkupFlags );
|
||||
return strokeFont.computeTextLineSize( aText );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -185,8 +185,7 @@ BOX2D STROKE_FONT::computeBoundingBox( const GLYPH* aGLYPH, double aGlyphWidth )
|
|||
}
|
||||
|
||||
|
||||
void STROKE_FONT::Draw( const UTF8& aText, const VECTOR2D& aPosition, double aRotationAngle,
|
||||
int markupFlags )
|
||||
void STROKE_FONT::Draw( const UTF8& aText, const VECTOR2D& aPosition, double aRotationAngle )
|
||||
{
|
||||
if( aText.empty() )
|
||||
return;
|
||||
|
@ -251,7 +250,7 @@ void STROKE_FONT::Draw( const UTF8& aText, const VECTOR2D& aPosition, double aRo
|
|||
{
|
||||
size_t length = newlinePos - begin;
|
||||
|
||||
drawSingleLineText( aText.substr( begin, length ), markupFlags );
|
||||
drawSingleLineText( aText.substr( begin, length ) );
|
||||
m_gal->Translate( VECTOR2D( 0.0, lineHeight ) );
|
||||
|
||||
begin = newlinePos + 1;
|
||||
|
@ -260,13 +259,13 @@ void STROKE_FONT::Draw( const UTF8& aText, const VECTOR2D& aPosition, double aRo
|
|||
|
||||
// Draw the last (or the only one) line
|
||||
if( !aText.empty() )
|
||||
drawSingleLineText( aText.substr( begin ), markupFlags );
|
||||
drawSingleLineText( aText.substr( begin ) );
|
||||
|
||||
m_gal->Restore();
|
||||
}
|
||||
|
||||
|
||||
void STROKE_FONT::drawSingleLineText( const UTF8& aText, int markupFlags )
|
||||
void STROKE_FONT::drawSingleLineText( const UTF8& aText )
|
||||
{
|
||||
double xOffset;
|
||||
double yOffset;
|
||||
|
@ -277,7 +276,7 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText, int markupFlags )
|
|||
overbar_italic_comp = -overbar_italic_comp;
|
||||
|
||||
// Compute the text size
|
||||
VECTOR2D textSize = computeTextLineSize( aText, markupFlags );
|
||||
VECTOR2D textSize = computeTextLineSize( aText );
|
||||
double half_thickness = m_gal->GetLineWidth()/2;
|
||||
|
||||
// Context needs to be saved before any transformations
|
||||
|
@ -329,6 +328,7 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText, int markupFlags )
|
|||
// overlap.
|
||||
bool last_had_overbar = false;
|
||||
bool in_overbar = false;
|
||||
bool in_super_or_subscript = false;
|
||||
VECTOR2D glyphSize = baseGlyphSize;
|
||||
|
||||
yOffset = 0;
|
||||
|
@ -379,43 +379,40 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText, int markupFlags )
|
|||
in_overbar = !in_overbar;
|
||||
}
|
||||
}
|
||||
else if( *chIt == '^' && ( markupFlags & ENABLE_SUPERSCRIPT_MARKUP ) )
|
||||
else if( *chIt == '^' )
|
||||
{
|
||||
if( ++chIt == end )
|
||||
break;
|
||||
auto lookahead = chIt;
|
||||
|
||||
if( *chIt == '^' )
|
||||
if( ++lookahead != end && *lookahead == '{' )
|
||||
{
|
||||
// double ^ is really a ^ so go ahead and process the second one
|
||||
}
|
||||
else
|
||||
{
|
||||
// single ^ starts a superscript
|
||||
// process superscript
|
||||
chIt = lookahead;
|
||||
in_super_or_subscript = true;
|
||||
glyphSize = baseGlyphSize * 0.8;
|
||||
yOffset = -baseGlyphSize.y * 0.3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if( *chIt == '#' && ( markupFlags & ENABLE_SUBSCRIPT_MARKUP ) )
|
||||
else if( *chIt == '_' )
|
||||
{
|
||||
if( ++chIt == end )
|
||||
break;
|
||||
auto lookahead = chIt;
|
||||
|
||||
if( *chIt == '#' )
|
||||
if( ++lookahead != end && *lookahead == '{' )
|
||||
{
|
||||
// double # is really a # so go ahead and process the second one
|
||||
}
|
||||
else
|
||||
{
|
||||
// single _ starts a subscript
|
||||
// process subscript
|
||||
chIt = lookahead;
|
||||
in_super_or_subscript = true;
|
||||
glyphSize = baseGlyphSize * 0.8;
|
||||
yOffset = baseGlyphSize.y * 0.1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if( *chIt == ' ' )
|
||||
else if( *chIt == '}' && in_super_or_subscript )
|
||||
{
|
||||
// space ends a super- or subscript
|
||||
in_super_or_subscript = false;
|
||||
glyphSize = baseGlyphSize;
|
||||
yOffset = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Index into bounding boxes table
|
||||
|
@ -505,15 +502,14 @@ double STROKE_FONT::computeOverbarVerticalPosition() const
|
|||
}
|
||||
|
||||
|
||||
VECTOR2D STROKE_FONT::computeTextLineSize( const UTF8& aText, int aMarkupFlags ) const
|
||||
VECTOR2D STROKE_FONT::computeTextLineSize( const UTF8& aText ) const
|
||||
{
|
||||
return ComputeStringBoundaryLimits( aText, m_gal->GetGlyphSize(), m_gal->GetLineWidth(),
|
||||
aMarkupFlags );
|
||||
return ComputeStringBoundaryLimits( aText, m_gal->GetGlyphSize(), m_gal->GetLineWidth() );
|
||||
}
|
||||
|
||||
|
||||
VECTOR2D STROKE_FONT::ComputeStringBoundaryLimits( const UTF8& aText, const VECTOR2D& aGlyphSize,
|
||||
double aGlyphThickness, int markupFlags ) const
|
||||
double aGlyphThickness ) const
|
||||
{
|
||||
VECTOR2D string_bbox;
|
||||
int line_count = 1;
|
||||
|
@ -521,6 +517,7 @@ VECTOR2D STROKE_FONT::ComputeStringBoundaryLimits( const UTF8& aText, const VECT
|
|||
|
||||
double curScale = 1.0;
|
||||
bool in_overbar = false;
|
||||
bool in_super_or_subscript = false;
|
||||
|
||||
for( UTF8::uni_iter it = aText.ubegin(), end = aText.uend(); it < end; ++it )
|
||||
{
|
||||
|
@ -572,40 +569,24 @@ VECTOR2D STROKE_FONT::ComputeStringBoundaryLimits( const UTF8& aText, const VECT
|
|||
in_overbar = !in_overbar;
|
||||
}
|
||||
}
|
||||
else if( *it == '^' && ( markupFlags & ENABLE_SUPERSCRIPT_MARKUP ) )
|
||||
else if( *it == '^' || *it == '_' )
|
||||
{
|
||||
if( ++it == end )
|
||||
break;
|
||||
auto lookahead = it;
|
||||
|
||||
if( *it == '^' )
|
||||
if( ++lookahead != end && *lookahead == '{' )
|
||||
{
|
||||
// double ^ is really a ^ so go ahead and process the second one
|
||||
}
|
||||
else
|
||||
{
|
||||
// single ^ starts a superscript
|
||||
// process superscript
|
||||
it = lookahead;
|
||||
in_super_or_subscript = true;
|
||||
curScale = 0.8;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if( *it == '#' && ( markupFlags & ENABLE_SUBSCRIPT_MARKUP ) )
|
||||
else if( *it == '}' && in_super_or_subscript )
|
||||
{
|
||||
if( ++it == end )
|
||||
break;
|
||||
|
||||
if( *it == '#' )
|
||||
{
|
||||
// double # is really a # so go ahead and process the second one
|
||||
}
|
||||
else
|
||||
{
|
||||
// single _ starts a subscript
|
||||
curScale = 0.8;
|
||||
}
|
||||
}
|
||||
else if( *it == ' ' )
|
||||
{
|
||||
// space ends a super- or subscript
|
||||
in_super_or_subscript = false;
|
||||
curScale = 1.0;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Index in the bounding boxes table
|
||||
|
|
|
@ -128,7 +128,7 @@ int GraphicTextWidth( const wxString& aText, const wxSize& aSize, bool aItalic,
|
|||
void GRText( wxDC* aDC, const wxPoint& aPos, COLOR4D aColor, const wxString& aText,
|
||||
double aOrient, const wxSize& aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify,
|
||||
enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold,
|
||||
int aMarkupFlags, void (* aCallback)( int x0, int y0, int xf, int yf, void* aData ),
|
||||
void (* aCallback)( int x0, int y0, int xf, int yf, void* aData ),
|
||||
void* aCallbackData, PLOTTER* aPlotter )
|
||||
{
|
||||
bool fill_mode = true;
|
||||
|
@ -166,14 +166,14 @@ void GRText( wxDC* aDC, const wxPoint& aPos, COLOR4D aColor, const wxString& aTe
|
|||
basic_gal.m_Color = aColor;
|
||||
basic_gal.SetClipBox( nullptr );
|
||||
|
||||
basic_gal.StrokeText( aText, VECTOR2D( aPos ), aOrient * M_PI/1800, aMarkupFlags );
|
||||
basic_gal.StrokeText( aText, VECTOR2D( aPos ), aOrient * M_PI/1800 );
|
||||
}
|
||||
|
||||
|
||||
void GRHaloText( wxDC * aDC, const wxPoint &aPos, COLOR4D aBgColor, COLOR4D aColor1,
|
||||
COLOR4D aColor2, const wxString &aText, double aOrient, const wxSize &aSize,
|
||||
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
|
||||
int aWidth, bool aItalic, bool aBold, int aMarkupFlags,
|
||||
int aWidth, bool aItalic, bool aBold,
|
||||
void (*aCallback)( int x0, int y0, int xf, int yf, void* aData ),
|
||||
void* aCallbackData, PLOTTER * aPlotter )
|
||||
{
|
||||
|
@ -188,11 +188,11 @@ void GRHaloText( wxDC * aDC, const wxPoint &aPos, COLOR4D aBgColor, COLOR4D aCol
|
|||
|
||||
// Draw the background
|
||||
GRText( aDC, aPos, aColor1, aText, aOrient, aSize, aH_justify, aV_justify, aWidth, aItalic,
|
||||
aBold, aMarkupFlags, aCallback, aCallbackData, aPlotter );
|
||||
aBold, aCallback, aCallbackData, aPlotter );
|
||||
|
||||
// Draw the text
|
||||
GRText( aDC, aPos, aColor2, aText, aOrient, aSize, aH_justify, aV_justify, aWidth/4, aItalic,
|
||||
aBold, aMarkupFlags, aCallback, aCallbackData, aPlotter );
|
||||
aBold, aCallback, aCallbackData, aPlotter );
|
||||
}
|
||||
|
||||
|
||||
|
@ -223,12 +223,11 @@ void PLOTTER::Text( const wxPoint& aPos,
|
|||
int aPenWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed,
|
||||
void* aData )
|
||||
{
|
||||
SetColor( aColor );
|
||||
|
||||
GRText( NULL, aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aPenWidth,
|
||||
aItalic, aBold, aTextMarkupFlags, nullptr, nullptr, this );
|
||||
aItalic, aBold, nullptr, nullptr, this );
|
||||
}
|
||||
|
|
|
@ -870,7 +870,6 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed,
|
||||
void* aData )
|
||||
{
|
||||
|
@ -878,13 +877,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
|
|||
if( aMultilineAllowed && !aText.Contains( wxT( "\n" ) ) )
|
||||
aMultilineAllowed = false; // the text has only one line.
|
||||
|
||||
bool processSuperSub = false;
|
||||
|
||||
if( ( aTextMarkupFlags & ENABLE_SUBSCRIPT_MARKUP ) && aText.Contains( wxT( "#" ) ) )
|
||||
processSuperSub = true;
|
||||
|
||||
if( ( aTextMarkupFlags & ENABLE_SUPERSCRIPT_MARKUP ) && aText.Contains( wxT( "^" ) ) )
|
||||
processSuperSub = true;
|
||||
bool processSuperSub = aText.Contains( wxT( "^{" ) ) || aText.Contains( wxT( "_{" ) );
|
||||
|
||||
if( m_textAsLines || containsNonAsciiChars( aText ) || aMultilineAllowed || processSuperSub )
|
||||
{
|
||||
|
@ -892,7 +885,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos,
|
|||
// Perhaps multiline texts could be handled as DXF text entity
|
||||
// but I do not want spend time about this (JPC)
|
||||
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
|
||||
aWidth, aItalic, aBold, aTextMarkupFlags, aMultilineAllowed );
|
||||
aWidth, aItalic, aBold, aMultilineAllowed );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1164,9 +1164,9 @@ void GERBER_PLOTTER::FlashRegularPolygon( const wxPoint& aShapePos,
|
|||
|
||||
void GERBER_PLOTTER::Text( const wxPoint& aPos, const COLOR4D aColor,
|
||||
const wxString& aText, double aOrient, const wxSize& aSize,
|
||||
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
|
||||
int aWidth, bool aItalic, bool aBold, int aTextMarkupFlags,
|
||||
bool aMultilineAllowed, void* aData )
|
||||
enum EDA_TEXT_HJUSTIFY_T aH_justify,
|
||||
enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic,
|
||||
bool aBold, bool aMultilineAllowed, void* aData )
|
||||
{
|
||||
GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ void GERBER_PLOTTER::Text( const wxPoint& aPos, const COLOR4D aColor,
|
|||
formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
|
||||
|
||||
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aWidth, aItalic,
|
||||
aBold, aTextMarkupFlags, aMultilineAllowed, aData );
|
||||
aBold, aMultilineAllowed, aData );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -804,7 +804,6 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed,
|
||||
void* aData )
|
||||
{
|
||||
|
@ -880,7 +879,7 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
|
|||
if( !use_native_font )
|
||||
{
|
||||
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify, aWidth,
|
||||
aItalic, aBold, aTextMarkupFlags, aMultilineAllowed );
|
||||
aItalic, aBold, aMultilineAllowed );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -974,7 +974,6 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed,
|
||||
void* aData )
|
||||
{
|
||||
|
@ -985,12 +984,7 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
|
|||
if( aMultilineAllowed && !aText.Contains( wxT( "\n" ) ) )
|
||||
aMultilineAllowed = false; // the text has only one line.
|
||||
|
||||
bool processSuperSub = false;
|
||||
|
||||
if( ( aTextMarkupFlags & ENABLE_SUBSCRIPT_MARKUP ) && aText.Contains( wxT( "#" ) ) )
|
||||
processSuperSub = true;
|
||||
|
||||
if( ( aTextMarkupFlags & ENABLE_SUPERSCRIPT_MARKUP ) && aText.Contains( wxT( "^" ) ) )
|
||||
bool processSuperSub = aText.Contains( wxT( "^{" ) ) || aText.Contains( wxT( "_{" ) );
|
||||
processSuperSub = true;
|
||||
|
||||
// Draw the native postscript text (if requested)
|
||||
|
@ -1054,7 +1048,7 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
|
|||
if( !use_native )
|
||||
{
|
||||
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
|
||||
aWidth, aItalic, aBold, aTextMarkupFlags, aMultilineAllowed );
|
||||
aWidth, aItalic, aBold, aMultilineAllowed );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -756,7 +756,6 @@ void SVG_PLOTTER::Text( const wxPoint& aPos,
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed,
|
||||
void* aData )
|
||||
{
|
||||
|
@ -826,6 +825,6 @@ void SVG_PLOTTER::Text( const wxPoint& aPos,
|
|||
"<g class=\"stroked-text\"><desc>%s</desc>\n",
|
||||
TO_UTF8( XmlEsc( aText ) ) );
|
||||
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
|
||||
aWidth, aItalic, aBold, aTextMarkupFlags, aMultilineAllowed );
|
||||
aWidth, aItalic, aBold, aMultilineAllowed );
|
||||
fputs( "</g>", outputFile );
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ void PlotWorkSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BLOCK
|
|||
plotter->Text( text->GetTextPos(), plotColor, text->GetShownText(),
|
||||
text->GetTextAngle(), text->GetTextSize(), text->GetHorizJustify(),
|
||||
text->GetVertJustify(), penWidth, text->IsItalic(), text->IsBold(),
|
||||
text->GetTextMarkupFlags(), text->IsMultilineAllowed() );
|
||||
text->IsMultilineAllowed() );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ struct PART_DRAW_OPTIONS
|
|||
bool draw_visible_fields; // Whether to draw "visible" fields
|
||||
bool draw_hidden_fields; // Whether to draw "hidden" fields
|
||||
bool show_elec_type; // Whether to show the pin electrical type
|
||||
int text_markup_flags; // Whether to process various text markups
|
||||
|
||||
PART_DRAW_OPTIONS()
|
||||
{
|
||||
|
@ -77,7 +76,6 @@ struct PART_DRAW_OPTIONS
|
|||
draw_visible_fields = true;
|
||||
draw_hidden_fields = true;
|
||||
show_elec_type = false;
|
||||
text_markup_flags = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -160,8 +160,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow()
|
|||
{
|
||||
if( defined.count( templateFieldname.m_Name ) <= 0 )
|
||||
{
|
||||
SCH_FIELD field( wxPoint( 0, 0 ), -1, m_cmp, templateFieldname.m_Name,
|
||||
GetParent()->GetTextMarkupFlags() );
|
||||
SCH_FIELD field( wxPoint( 0, 0 ), -1, m_cmp, templateFieldname.m_Name );
|
||||
field.SetVisible( templateFieldname.m_Visible );
|
||||
m_fields->push_back( field );
|
||||
}
|
||||
|
@ -532,8 +531,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnAddField( wxCommandEvent& event )
|
|||
|
||||
int fieldID = m_fields->size();
|
||||
SCH_FIELD newField( wxPoint( 0, 0 ), fieldID, m_cmp,
|
||||
TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldID ),
|
||||
GetParent()->GetTextMarkupFlags() );
|
||||
TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldID ) );
|
||||
|
||||
newField.SetTextAngle( m_fields->at( REFERENCE ).GetTextAngle() );
|
||||
|
||||
|
@ -664,8 +662,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary( wxCommandEvent
|
|||
{
|
||||
if( defined.count( templateFieldname.m_Name ) <= 0 )
|
||||
{
|
||||
SCH_FIELD field( wxPoint( 0, 0 ), -1, m_cmp, templateFieldname.m_Name,
|
||||
GetParent()->GetTextMarkupFlags() );
|
||||
SCH_FIELD field( wxPoint( 0, 0 ), -1, m_cmp, templateFieldname.m_Name );
|
||||
field.SetVisible( templateFieldname.m_Visible );
|
||||
m_fields->push_back( field );
|
||||
}
|
||||
|
|
|
@ -608,8 +608,7 @@ public:
|
|||
if( !destField && !srcValue.IsEmpty() )
|
||||
{
|
||||
const auto compOrigin = comp.GetPosition();
|
||||
destField = comp.AddField( SCH_FIELD( compOrigin, -1, &comp, srcName,
|
||||
m_frame->GetTextMarkupFlags() ) );
|
||||
destField = comp.AddField( SCH_FIELD( compOrigin, -1, &comp, srcName ) );
|
||||
}
|
||||
|
||||
if( !destField )
|
||||
|
|
|
@ -188,7 +188,6 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
|
|||
|
||||
PART_DRAW_OPTIONS opts;
|
||||
opts.draw_hidden_fields = true;
|
||||
opts.text_markup_flags = libframe->GetTextMarkupFlags();
|
||||
|
||||
RENDER_SETTINGS* renderSettings = libframe->GetRenderSettings();
|
||||
renderSettings->SetPrintDC( &dc );
|
||||
|
|
|
@ -562,8 +562,7 @@ void DIALOG_SCH_SHEET_PROPS::OnAddField( wxCommandEvent& event )
|
|||
|
||||
int fieldID = m_fields->size();
|
||||
SCH_FIELD newField( wxPoint( 0, 0 ), fieldID, m_sheet,
|
||||
SCH_SHEET::GetDefaultFieldName( fieldID ),
|
||||
m_frame->GetTextMarkupFlags() );
|
||||
SCH_SHEET::GetDefaultFieldName( fieldID ) );
|
||||
|
||||
newField.SetTextAngle( m_fields->at( SHEETNAME ).GetTextAngle() );
|
||||
|
||||
|
|
|
@ -233,8 +233,7 @@ void DIALOG_UPDATE_FIELDS::updateFields( SCH_COMPONENT* aComponent )
|
|||
else
|
||||
{
|
||||
// Missing field, it has to be added to the component
|
||||
SCH_FIELD newField( wxPoint( 0, 0 ), newFields.size(), aComponent, fieldName,
|
||||
m_frame->GetTextMarkupFlags() );
|
||||
SCH_FIELD newField( wxPoint( 0, 0 ), newFields.size(), aComponent, fieldName );
|
||||
|
||||
newField.ImportValues( *libField );
|
||||
newField.SetText( libField->GetText() );
|
||||
|
|
|
@ -38,9 +38,6 @@ PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aWindow, SCH_EDIT_FRAM
|
|||
m_wireWidth( aFrame, m_wireWidthLabel, m_wireWidthCtrl, m_wireWidthUnits, true ),
|
||||
m_junctionSize( aFrame, m_jctSizeLabel, m_jctSizeCtrl, m_jctSizeUnits, true )
|
||||
{
|
||||
wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
||||
infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
|
||||
m_superSubHint->SetFont( infoFont );
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,9 +72,6 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow()
|
|||
wxString offsetRatio = wxString::Format( "%f", m_frame->GetTextOffsetRatio() * 100.0 );
|
||||
m_textOffsetRatioCtrl->SetValue( offsetRatio );
|
||||
|
||||
int superSubFlags = ENABLE_SUBSCRIPT_MARKUP | ENABLE_SUPERSCRIPT_MARKUP;
|
||||
m_checkSuperSub->SetValue( m_frame->GetTextMarkupFlags() & superSubFlags );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -117,21 +111,11 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
|
|||
msg.ToDouble( &dtmp );
|
||||
m_frame->SetTextOffsetRatio( dtmp / 100.0 );
|
||||
|
||||
int superSubFlags = ENABLE_SUBSCRIPT_MARKUP | ENABLE_SUPERSCRIPT_MARKUP;
|
||||
|
||||
if( m_checkSuperSub->GetValue() )
|
||||
m_frame->SetTextMarkupFlags( m_frame->GetTextMarkupFlags() | superSubFlags );
|
||||
else
|
||||
m_frame->SetTextMarkupFlags( m_frame->GetTextMarkupFlags() & ~superSubFlags );
|
||||
|
||||
m_frame->GetRenderSettings()->SetDefaultPenWidth( m_frame->GetDefaultLineWidth() );
|
||||
m_frame->GetRenderSettings()->m_DefaultWireThickness = m_frame->GetDefaultWireThickness();
|
||||
m_frame->GetRenderSettings()->m_DefaultBusThickness = m_frame->GetDefaultBusThickness();
|
||||
m_frame->GetRenderSettings()->m_TextOffsetRatio = m_frame->GetTextOffsetRatio();
|
||||
|
||||
SCH_SCREENS schematic;
|
||||
schematic.UpdateTextMarkupFlags( m_frame->GetTextMarkupFlags() );
|
||||
|
||||
m_frame->GetCanvas()->GetView()->MarkDirty();
|
||||
m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
|
|
@ -75,15 +75,6 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi
|
|||
|
||||
sbSizer4->Add( fgSizer2, 1, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
m_checkSuperSub = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Enable superscript/subscript markup"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkSuperSub->SetToolTip( _("Use '^' for superscript and '#' for subscript") );
|
||||
|
||||
sbSizer4->Add( m_checkSuperSub, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_superSubHint = new wxStaticText( sbSizer4->GetStaticBox(), wxID_ANY, _("(preceed superscript text with ^; subscript text with #)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_superSubHint->Wrap( -1 );
|
||||
sbSizer4->Add( m_superSubHint, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bLeftColumn->Add( sbSizer4, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
|
|
@ -615,131 +615,6 @@
|
|||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Enable superscript/subscript markup</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_checkSuperSub</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Use '^' for superscript and '#' for subscript</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">(preceed superscript text with ^; subscript text with #)</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_superSubHint</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -41,8 +40,6 @@ class PANEL_SETUP_FORMATTING_BASE : public wxPanel
|
|||
wxStaticText* m_textOffsetRatioLabel;
|
||||
wxTextCtrl* m_textOffsetRatioCtrl;
|
||||
wxStaticText* m_offsetRatioUnits;
|
||||
wxCheckBox* m_checkSuperSub;
|
||||
wxStaticText* m_superSubHint;
|
||||
wxStaticText* m_lineWidthLabel;
|
||||
wxTextCtrl* m_lineWidthCtrl;
|
||||
wxStaticText* m_lineWidthUnits;
|
||||
|
|
|
@ -62,27 +62,26 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( int aType )
|
|||
{
|
||||
wxPoint cursorPos = (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
SCH_TEXT* textItem = nullptr;
|
||||
int markupFlags = GetTextMarkupFlags();
|
||||
|
||||
s_queuedTexts.clear();
|
||||
|
||||
switch( aType )
|
||||
{
|
||||
case LAYER_NOTES:
|
||||
textItem = new SCH_TEXT( cursorPos, wxEmptyString, SCH_TEXT_T, markupFlags );
|
||||
textItem = new SCH_TEXT( cursorPos );
|
||||
break;
|
||||
|
||||
case LAYER_LOCLABEL:
|
||||
textItem = new SCH_LABEL( cursorPos, wxEmptyString, markupFlags );
|
||||
textItem = new SCH_LABEL( cursorPos );
|
||||
break;
|
||||
|
||||
case LAYER_HIERLABEL:
|
||||
textItem = new SCH_HIERLABEL( cursorPos, wxEmptyString, SCH_HIER_LABEL_T, markupFlags );
|
||||
textItem = new SCH_HIERLABEL( cursorPos );
|
||||
textItem->SetShape( lastGlobalLabelShape );
|
||||
break;
|
||||
|
||||
case LAYER_GLOBLABEL:
|
||||
textItem = new SCH_GLOBALLABEL( cursorPos, wxEmptyString, markupFlags );
|
||||
textItem = new SCH_GLOBALLABEL( cursorPos );
|
||||
textItem->SetShape( lastGlobalLabelShape );
|
||||
break;
|
||||
|
||||
|
@ -200,7 +199,6 @@ void SCH_EDIT_FRAME::ConvertTextType( SCH_TEXT* aText, KICAD_T aNewType )
|
|||
const wxPoint& position = aText->GetPosition();
|
||||
LABEL_SPIN_STYLE orientation = aText->GetLabelSpinStyle();
|
||||
wxString txt = UnescapeString( aText->GetText() );
|
||||
int markupFlags = GetTextMarkupFlags();
|
||||
|
||||
// There can be characters in a SCH_TEXT object that can break labels so we have to
|
||||
// fix them here.
|
||||
|
@ -218,18 +216,11 @@ void SCH_EDIT_FRAME::ConvertTextType( SCH_TEXT* aText, KICAD_T aNewType )
|
|||
|
||||
switch( aNewType )
|
||||
{
|
||||
case SCH_LABEL_T:
|
||||
newtext = new SCH_LABEL( position, txt, markupFlags );
|
||||
break;
|
||||
case SCH_GLOBAL_LABEL_T:
|
||||
newtext = new SCH_GLOBALLABEL( position, txt, markupFlags );
|
||||
break;
|
||||
case SCH_HIER_LABEL_T:
|
||||
newtext = new SCH_HIERLABEL( position, txt, SCH_HIER_LABEL_T, markupFlags );
|
||||
break;
|
||||
case SCH_TEXT_T:
|
||||
newtext = new SCH_TEXT( position, txt, SCH_TEXT_T, markupFlags );
|
||||
break;
|
||||
case SCH_LABEL_T: newtext = new SCH_LABEL( position, txt ); break;
|
||||
case SCH_GLOBAL_LABEL_T: newtext = new SCH_GLOBALLABEL( position, txt ); break;
|
||||
case SCH_HIER_LABEL_T: newtext = new SCH_HIERLABEL( position, txt ); break;
|
||||
case SCH_TEXT_T: newtext = new SCH_TEXT( position, txt ); break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxString::Format( "Invalid text type: %d.", aNewType ) );
|
||||
return;
|
||||
|
|
|
@ -267,8 +267,6 @@ void SCH_EDIT_FRAME::AddFormattingParameters( std::vector<PARAM_CFG*>& params )
|
|||
&m_textOffsetRatio,
|
||||
(double) TXT_MARGIN / DEFAULT_SIZE_TEXT,
|
||||
-200.0, 200.0 ) );
|
||||
params.push_back( new PARAM_CFG_INT( wxT( "TextMarkupFlags" ),
|
||||
&m_textMarkupFlags, 0 ) );
|
||||
params.push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "LineThickness" ),
|
||||
&m_defaultLineWidth,
|
||||
Mils2iu( appSettings->m_Drawing.default_line_thickness ),
|
||||
|
|
|
@ -326,7 +326,6 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
|||
ret &= fromLegacyString( aCfg, "FieldNames", "drawing.field_names" );
|
||||
ret &= fromLegacy<bool>( aCfg, "HorizVertLinesOnly", "drawing.hv_lines_only" );
|
||||
ret &= fromLegacy<int>( aCfg, "RepeatLabelIncrement", "drawing.repeat_label_increment" );
|
||||
ret &= fromLegacy<int>( aCfg, "TextMarkupFlags", "drawing.text_markup_flags" );
|
||||
|
||||
ret &= fromLegacy<bool>( aCfg, "DragActionIsMove", "input.drag_is_move" );
|
||||
|
||||
|
|
|
@ -407,7 +407,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
}
|
||||
|
||||
schematic.UpdateSymbolLinks( true ); // Update all symbol library links for all sheets.
|
||||
schematic.UpdateTextMarkupFlags( GetTextMarkupFlags() );
|
||||
|
||||
g_ConnectionGraph->Reset();
|
||||
RecalculateConnections( GLOBAL_CLEANUP );
|
||||
|
@ -684,7 +683,6 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
|
|||
UpdateFileHistory( aFileName );
|
||||
SCH_SCREENS schematic;
|
||||
schematic.UpdateSymbolLinks(); // Update all symbol library links for all sheets.
|
||||
schematic.UpdateTextMarkupFlags( GetTextMarkupFlags() );
|
||||
|
||||
GetScreen()->m_Initialized = true;
|
||||
SCH_SCREENS allScreens;
|
||||
|
|
|
@ -115,7 +115,7 @@ void LIB_FIELD::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void*
|
|||
wxString text = aData ? *static_cast<wxString*>( aData ) : GetText();
|
||||
|
||||
GRText( DC, text_pos, color, text, GetTextAngle(), GetTextSize(), GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold(), m_textMarkupFlags );
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -289,10 +289,8 @@ void LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
|||
|
||||
int penWidth = std::max( GetPenWidth(),aPlotter->RenderSettings()->GetDefaultPenWidth() );
|
||||
|
||||
// NOTE: do NOT use m_textMarkupFlags; those are from the library, not the schematic
|
||||
|
||||
aPlotter->Text( textpos, color, GetShownText(), orient, GetTextSize(), hjustify, vjustify,
|
||||
penWidth, IsItalic(), IsBold(), aPlotter->GetTextMarkupFlags() );
|
||||
penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -563,7 +563,6 @@ void LIB_PIN::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* a
|
|||
PART_DRAW_OPTIONS* opts = (PART_DRAW_OPTIONS*) aData;
|
||||
bool drawHiddenFields = opts ? opts->draw_hidden_fields : false;
|
||||
bool showPinType = opts ? opts->show_elec_type : false;
|
||||
int textMarkupFlags = opts ? opts->text_markup_flags : 0;
|
||||
|
||||
LIB_PART* part = GetParent();
|
||||
|
||||
|
@ -578,7 +577,7 @@ void LIB_PIN::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* a
|
|||
PrintPinSymbol( aSettings, pos1, orient );
|
||||
|
||||
PrintPinTexts( aSettings, pos1, orient, part->GetPinNameOffset(), part->ShowPinNumbers(),
|
||||
part->ShowPinNames(), textMarkupFlags );
|
||||
part->ShowPinNames() );
|
||||
|
||||
if( showPinType )
|
||||
PrintPinElectricalTypeName( aSettings, pos1, orient );
|
||||
|
@ -696,7 +695,7 @@ void LIB_PIN::PrintPinSymbol( RENDER_SETTINGS* aSettings, const wxPoint& aPos, i
|
|||
|
||||
|
||||
void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int orient,
|
||||
int TextInside, bool DrawPinNum, bool DrawPinName, int aMarkupFlags )
|
||||
int TextInside, bool DrawPinNum, bool DrawPinName )
|
||||
{
|
||||
if( !DrawPinName && !DrawPinNum )
|
||||
return;
|
||||
|
@ -744,14 +743,14 @@ void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int o
|
|||
x = x1 + TextInside;
|
||||
GRText( DC, wxPoint( x, y1 ), NameColor, m_name, TEXT_ANGLE_HORIZ,
|
||||
PinNameSize, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
else // Orient == PIN_LEFT
|
||||
{
|
||||
x = x1 - TextInside;
|
||||
GRText( DC, wxPoint( x, y1 ), NameColor, m_name, TEXT_ANGLE_HORIZ,
|
||||
PinNameSize, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -759,7 +758,7 @@ void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int o
|
|||
{
|
||||
GRText( DC, wxPoint( (x1 + pin_pos.x) / 2, y1 - num_offset ), NumColor, m_number,
|
||||
TEXT_ANGLE_HORIZ, PinNumSize, GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false, aMarkupFlags );
|
||||
GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
else /* Its a vertical line. */
|
||||
|
@ -772,12 +771,12 @@ void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int o
|
|||
if( DrawPinName )
|
||||
GRText( DC, wxPoint( x1, y ), NameColor, m_name, TEXT_ANGLE_VERT, PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false,
|
||||
false, aMarkupFlags );
|
||||
false );
|
||||
|
||||
if( DrawPinNum )
|
||||
GRText( DC, wxPoint( x1 - num_offset, (y1 + pin_pos.y) / 2 ), NumColor,
|
||||
m_number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false, aMarkupFlags );
|
||||
GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false );
|
||||
}
|
||||
else /* PIN_UP */
|
||||
{
|
||||
|
@ -786,12 +785,12 @@ void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int o
|
|||
if( DrawPinName )
|
||||
GRText( DC, wxPoint( x1, y ), NameColor, m_name, TEXT_ANGLE_VERT, PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false,
|
||||
false, aMarkupFlags );
|
||||
false );
|
||||
|
||||
if( DrawPinNum )
|
||||
GRText( DC, wxPoint( x1 - num_offset, (y1 + pin_pos.y) / 2 ), NumColor,
|
||||
m_number, TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false, aMarkupFlags );
|
||||
GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -805,14 +804,14 @@ void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int o
|
|||
x = (x1 + pin_pos.x) / 2;
|
||||
GRText( DC, wxPoint( x, y1 - name_offset ), NameColor, m_name, TEXT_ANGLE_HORIZ,
|
||||
PinNameSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
if( DrawPinNum )
|
||||
{
|
||||
x = (x1 + pin_pos.x) / 2;
|
||||
GRText( DC, wxPoint( x, y1 + num_offset ), NumColor, m_number, TEXT_ANGLE_HORIZ,
|
||||
PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, numPenWidth,
|
||||
false, false, aMarkupFlags );
|
||||
false, false );
|
||||
}
|
||||
}
|
||||
else /* Its a vertical line. */
|
||||
|
@ -822,14 +821,14 @@ void LIB_PIN::PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& pin_pos, int o
|
|||
y = (y1 + pin_pos.y) / 2;
|
||||
GRText( DC, wxPoint( x1 - name_offset, y ), NameColor, m_name, TEXT_ANGLE_VERT,
|
||||
PinNameSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
|
||||
if( DrawPinNum )
|
||||
{
|
||||
GRText( DC, wxPoint( x1 + num_offset, (y1 + pin_pos.y) / 2 ), NumColor, m_number,
|
||||
TEXT_ANGLE_VERT, PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP,
|
||||
numPenWidth, false, false, aMarkupFlags );
|
||||
numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1018,7 +1017,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
|
||||
|
||||
void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int TextInside,
|
||||
bool DrawPinNum, bool DrawPinName, int aMarkupFlags )
|
||||
bool DrawPinNum, bool DrawPinName )
|
||||
{
|
||||
if( m_name.IsEmpty() || m_name == wxT( "~" ) )
|
||||
DrawPinName = false;
|
||||
|
@ -1072,7 +1071,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_LEFT,
|
||||
GR_TEXT_VJUSTIFY_CENTER,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
else // orient == PIN_LEFT
|
||||
{
|
||||
|
@ -1084,7 +1083,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_RIGHT,
|
||||
GR_TEXT_VJUSTIFY_CENTER,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
}
|
||||
if( DrawPinNum )
|
||||
|
@ -1095,7 +1094,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_HORIZ, PinNumSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
numPenWidth, false, false, aMarkupFlags );
|
||||
numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
else /* Its a vertical line. */
|
||||
|
@ -1110,7 +1109,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_VERT, PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_RIGHT,
|
||||
GR_TEXT_VJUSTIFY_CENTER,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
|
||||
if( DrawPinNum )
|
||||
{
|
||||
|
@ -1120,7 +1119,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_VERT, PinNumSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
numPenWidth, false, false, aMarkupFlags );
|
||||
numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
else /* PIN_UP */
|
||||
|
@ -1133,7 +1132,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_VERT, PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_LEFT,
|
||||
GR_TEXT_VJUSTIFY_CENTER,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
|
||||
if( DrawPinNum )
|
||||
{
|
||||
|
@ -1143,7 +1142,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_VERT, PinNumSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
numPenWidth, false, false, aMarkupFlags );
|
||||
numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1161,7 +1160,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_HORIZ, PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
|
||||
if( DrawPinNum )
|
||||
|
@ -1172,7 +1171,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_HORIZ, PinNumSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_TOP,
|
||||
numPenWidth, false, false, aMarkupFlags );
|
||||
numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
else /* Its a vertical line. */
|
||||
|
@ -1185,7 +1184,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_VERT, PinNameSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_BOTTOM,
|
||||
namePenWidth, false, false, aMarkupFlags );
|
||||
namePenWidth, false, false );
|
||||
}
|
||||
|
||||
if( DrawPinNum )
|
||||
|
@ -1196,7 +1195,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter, wxPoint& pin_pos, int orient, int
|
|||
TEXT_ANGLE_VERT, PinNumSize,
|
||||
GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_TOP,
|
||||
numPenWidth, false, false, aMarkupFlags );
|
||||
numPenWidth, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1394,8 +1393,7 @@ void LIB_PIN::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
|
|||
|
||||
PlotSymbol( plotter, pos, orient );
|
||||
PlotPinTexts( plotter, pos, orient, GetParent()->GetPinNameOffset(),
|
||||
GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames(),
|
||||
plotter->GetTextMarkupFlags() );
|
||||
GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -78,9 +78,7 @@ class LIB_PIN : public LIB_ITEM
|
|||
wxString m_number;
|
||||
int m_numTextSize; // Pin num and Pin name sizes
|
||||
int m_nameTextSize;
|
||||
int m_textMarkupFlags; // Set of TEXT_MARKUP_FLAGS indicating which markup
|
||||
// features are to be processed within the pin name
|
||||
// and number.
|
||||
|
||||
/**
|
||||
* Print a pin, with or without the pin texts
|
||||
*
|
||||
|
@ -373,7 +371,7 @@ public:
|
|||
* Pin Name: substring between '~' is negated
|
||||
*/
|
||||
void PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& aPosition, int aOrientation,
|
||||
int TextInside, bool DrawPinNum, bool DrawPinName, int aMarkupFlags );
|
||||
int TextInside, bool DrawPinNum, bool DrawPinName );
|
||||
|
||||
/**
|
||||
* Draw the electrical type text of the pin (only for the footprint editor)
|
||||
|
@ -389,7 +387,7 @@ public:
|
|||
* the opposite direction to x2,y2), otherwise all is drawn outside.
|
||||
*/
|
||||
void PlotPinTexts( PLOTTER *aPlotter, wxPoint& aPosition, int aOrientation,
|
||||
int aTextInside, bool aDrawPinNum, bool aDrawPinName, int aMarkupFlags );
|
||||
int aTextInside, bool aDrawPinNum, bool aDrawPinName );
|
||||
|
||||
void PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrientation );
|
||||
|
||||
|
@ -449,9 +447,6 @@ public:
|
|||
int GetWidth() const override { return m_width; }
|
||||
void SetWidth( int aWidth ) override;
|
||||
|
||||
int GetTextMarkupFlags() const { return m_textMarkupFlags; }
|
||||
void SetTextMarkupFlags( int aFlags ) { m_textMarkupFlags = aFlags; }
|
||||
|
||||
BITMAP_DEF GetMenuImage() const override;
|
||||
|
||||
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
#include <default_values.h> // For some default values
|
||||
|
||||
|
||||
LIB_TEXT::LIB_TEXT( LIB_PART* aParent, int aMarkupFlags ) :
|
||||
LIB_TEXT::LIB_TEXT( LIB_PART* aParent ) :
|
||||
LIB_ITEM( LIB_TEXT_T, aParent ),
|
||||
EDA_TEXT( wxEmptyString, aMarkupFlags )
|
||||
EDA_TEXT( wxEmptyString )
|
||||
{
|
||||
SetTextSize( wxSize( Mils2iu( DEFAULT_TEXT_SIZE ), Mils2iu( DEFAULT_TEXT_SIZE ) ) );
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ bool LIB_TEXT::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
|||
|
||||
EDA_ITEM* LIB_TEXT::Clone() const
|
||||
{
|
||||
LIB_TEXT* newitem = new LIB_TEXT( nullptr, GetTextMarkupFlags() );
|
||||
LIB_TEXT* newitem = new LIB_TEXT( nullptr );
|
||||
|
||||
newitem->m_Unit = m_Unit;
|
||||
newitem->m_Convert = m_Convert;
|
||||
|
@ -290,11 +290,9 @@ void LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
|
|||
int penWidth = std::max( GetEffectiveTextPenWidth(),
|
||||
plotter->RenderSettings()->GetDefaultPenWidth() );
|
||||
|
||||
// NOTE: do NOT use m_textMarkupFlags; those are from the library, not the schematic
|
||||
|
||||
plotter->Text( pos, color, GetText(), t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT, GetTextSize(),
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, penWidth, IsItalic(),
|
||||
IsBold(), plotter->GetTextMarkupFlags() );
|
||||
IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -345,7 +343,7 @@ void LIB_TEXT::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void*
|
|||
txtpos = aTransform.TransformCoordinate( txtpos ) + aOffset;
|
||||
|
||||
GRText( DC, txtpos, color, GetShownText(), orient, GetTextSize(), GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_CENTER, penWidth, IsItalic(), IsBold(), m_textMarkupFlags );
|
||||
GR_TEXT_VJUSTIFY_CENTER, penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class LIB_TEXT : public LIB_ITEM, public EDA_TEXT
|
|||
const TRANSFORM& aTransform ) override;
|
||||
|
||||
public:
|
||||
LIB_TEXT( LIB_PART* aParent, int aMarkupFlags = 0 );
|
||||
LIB_TEXT( LIB_PART* aParent );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
|
|
|
@ -777,30 +777,6 @@ void LIB_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen )
|
|||
|
||||
void LIB_EDIT_FRAME::RebuildView()
|
||||
{
|
||||
if( m_my_part )
|
||||
{
|
||||
for( LIB_ITEM& item : m_my_part->GetDrawItems() )
|
||||
{
|
||||
switch( item.Type() )
|
||||
{
|
||||
case LIB_FIELD_T:
|
||||
static_cast<LIB_FIELD*>( &item )->SetTextMarkupFlags( m_textMarkupFlags );
|
||||
break;
|
||||
|
||||
case LIB_TEXT_T:
|
||||
static_cast<LIB_TEXT*>( &item )->SetTextMarkupFlags( m_textMarkupFlags );
|
||||
break;
|
||||
|
||||
case LIB_PIN_T:
|
||||
static_cast<LIB_PIN*>( &item )->SetTextMarkupFlags( m_textMarkupFlags );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetRenderSettings()->m_ShowUnit = m_unit;
|
||||
GetRenderSettings()->m_ShowConvert = m_convert;
|
||||
GetRenderSettings()->m_ShowDisabled = m_my_part && m_my_part->IsAlias();
|
||||
|
|
|
@ -41,7 +41,6 @@ void LIB_EDIT_FRAME::SVG_PlotComponent( const wxString& aFullFileName )
|
|||
plotter->SetRenderSettings( &renderSettings );
|
||||
plotter->SetPageSettings( pageInfo );
|
||||
plotter->SetColorMode( true );
|
||||
plotter->SetTextMarkupFlags( GetTextMarkupFlags() );
|
||||
|
||||
wxPoint plot_offset;
|
||||
const double scale = 1.0;
|
||||
|
|
|
@ -574,7 +574,6 @@ bool SCH_EDIT_FRAME::rescueProject( RESCUER& aRescuer, bool aRunningOnDemand )
|
|||
SCH_SCREENS schematic;
|
||||
|
||||
schematic.UpdateSymbolLinks( true );
|
||||
schematic.UpdateTextMarkupFlags( GetTextMarkupFlags() );
|
||||
|
||||
g_ConnectionGraph->Reset();
|
||||
RecalculateConnections( GLOBAL_CLEANUP );
|
||||
|
|
|
@ -88,7 +88,6 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aWindo
|
|||
m_defaultBusThickness( DEFAULT_BUS_THICKNESS * IU_PER_MILS ),
|
||||
m_defaultTextSize( DEFAULT_TEXT_SIZE * IU_PER_MILS ),
|
||||
m_textOffsetRatio( 0.08 ),
|
||||
m_textMarkupFlags( 0 ),
|
||||
m_showPinElectricalTypeName( false )
|
||||
{
|
||||
createCanvas();
|
||||
|
|
|
@ -93,7 +93,6 @@ protected:
|
|||
int m_defaultBusThickness;
|
||||
int m_defaultTextSize;
|
||||
double m_textOffsetRatio;
|
||||
int m_textMarkupFlags;
|
||||
|
||||
TEMPLATES m_templateFieldNames;
|
||||
|
||||
|
@ -147,9 +146,6 @@ public:
|
|||
double GetTextOffsetRatio() const { return m_textOffsetRatio; }
|
||||
void SetTextOffsetRatio( double aRatio ) { m_textOffsetRatio = aRatio; }
|
||||
|
||||
int GetTextMarkupFlags() const { return m_textMarkupFlags; }
|
||||
void SetTextMarkupFlags( int aFlags ) { m_textMarkupFlags = aFlags; }
|
||||
|
||||
/**
|
||||
* Function GetZoomLevelIndicator
|
||||
* returns a human readable value which can be displayed as zoom
|
||||
|
|
|
@ -535,7 +535,6 @@ void SCH_COMPONENT::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset )
|
|||
opts.transform = m_transform;
|
||||
opts.draw_visible_fields = false;
|
||||
opts.draw_hidden_fields = false;
|
||||
opts.text_markup_flags = m_Fields[0].GetTextMarkupFlags();
|
||||
|
||||
if( m_part )
|
||||
{
|
||||
|
@ -822,8 +821,7 @@ void SCH_COMPONENT::UpdateFields( bool aResetStyle, bool aResetRef )
|
|||
if( !schField )
|
||||
{
|
||||
wxString fieldName = libField.GetCanonicalName();
|
||||
SCH_FIELD newField( wxPoint( 0, 0), GetFieldCount(), this, fieldName,
|
||||
GetField( REFERENCE )->GetTextMarkupFlags() );
|
||||
SCH_FIELD newField( wxPoint( 0, 0), GetFieldCount(), this, fieldName );
|
||||
schField = AddField( newField );
|
||||
}
|
||||
}
|
||||
|
@ -1828,9 +1826,6 @@ void SCH_COMPONENT::Plot( PLOTTER* aPlotter )
|
|||
TRANSFORM temp = GetTransform();
|
||||
aPlotter->StartBlock( nullptr );
|
||||
|
||||
// A cheater since we don't want to modify the various LIB_ITEMs' m_textMarkupFlags
|
||||
aPlotter->SetTextMarkupFlags( m_Fields[0].GetTextMarkupFlags() );
|
||||
|
||||
m_part->Plot( aPlotter, GetUnit(), GetConvert(), m_Pos, temp );
|
||||
|
||||
for( SCH_FIELD field : m_Fields )
|
||||
|
|
|
@ -48,10 +48,10 @@
|
|||
#include <trace_helpers.h>
|
||||
|
||||
|
||||
SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_ITEM* aParent, const wxString& aName,
|
||||
int aMarkupFlags ) :
|
||||
SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_ITEM* aParent,
|
||||
const wxString& aName ) :
|
||||
SCH_ITEM( aParent, SCH_FIELD_T ),
|
||||
EDA_TEXT( wxEmptyString, aMarkupFlags )
|
||||
EDA_TEXT( wxEmptyString )
|
||||
{
|
||||
SetTextPos( aPos );
|
||||
m_id = aFieldId;
|
||||
|
@ -178,7 +178,7 @@ void SCH_FIELD::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset )
|
|||
textpos = boundaryBox.Centre() + aOffset;
|
||||
|
||||
GRText( DC, textpos, color, GetShownText(), orient, GetTextSize(), GR_TEXT_HJUSTIFY_CENTER,
|
||||
GR_TEXT_VJUSTIFY_CENTER, penWidth, IsItalic(), IsBold(), m_textMarkupFlags );
|
||||
GR_TEXT_VJUSTIFY_CENTER, penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -525,7 +525,7 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter )
|
|||
wxPoint textpos = BoundaryBox.Centre();
|
||||
|
||||
aPlotter->Text( textpos, color, GetShownText(), orient, GetTextSize(), hjustify, vjustify,
|
||||
penWidth, IsItalic(), IsBold(), m_textMarkupFlags );
|
||||
penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class SCH_FIELD : public SCH_ITEM, public EDA_TEXT
|
|||
|
||||
public:
|
||||
SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_ITEM* aParent,
|
||||
const wxString& aName = wxEmptyString, int aMarkupFlags = 0 );
|
||||
const wxString& aName = wxEmptyString );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
|
|
|
@ -370,10 +370,9 @@ float SCH_PAINTER::getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows
|
|||
}
|
||||
|
||||
|
||||
void SCH_PAINTER::strokeText( const wxString& aText, const VECTOR2D& aPosition, double aAngle,
|
||||
int aTextMarkupFlags )
|
||||
void SCH_PAINTER::strokeText( const wxString& aText, const VECTOR2D& aPosition, double aAngle )
|
||||
{
|
||||
m_gal->StrokeText( aText, aPosition, aAngle, aTextMarkupFlags );
|
||||
m_gal->StrokeText( aText, aPosition, aAngle );
|
||||
}
|
||||
|
||||
|
||||
|
@ -632,7 +631,7 @@ void SCH_PAINTER::draw( LIB_FIELD *aField, int aLayer )
|
|||
|
||||
double orient = aField->GetTextAngleRadians();
|
||||
|
||||
strokeText( aField->GetText(), pos, orient, aField->GetTextMarkupFlags() );
|
||||
strokeText( aField->GetText(), pos, orient );
|
||||
}
|
||||
|
||||
// Draw the umbilical line
|
||||
|
@ -679,7 +678,7 @@ void SCH_PAINTER::draw( LIB_TEXT *aText, int aLayer )
|
|||
m_gal->SetGlyphSize( VECTOR2D( aText->GetTextSize() ) );
|
||||
m_gal->SetFontBold( aText->IsBold() );
|
||||
m_gal->SetFontItalic( aText->IsItalic() );
|
||||
strokeText( aText->GetText(), pos, orient, aText->GetTextMarkupFlags() );
|
||||
strokeText( aText->GetText(), pos, orient );
|
||||
}
|
||||
|
||||
|
||||
|
@ -714,7 +713,6 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
|
|||
return;
|
||||
|
||||
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
|
||||
int flags = aPin->GetTextMarkupFlags();
|
||||
|
||||
if( drawingShadows && !aPin->IsSelected() )
|
||||
return;
|
||||
|
@ -988,28 +986,28 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
|
|||
SET_DC( INSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( -insideOffset - len, 0 ), 0, flags );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( -insideOffset - len, 0 ), 0 );
|
||||
}
|
||||
if( size[OUTSIDE] )
|
||||
{
|
||||
SET_DC( OUTSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( outsideOffset, 0 ), 0, flags );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( outsideOffset, 0 ), 0 );
|
||||
}
|
||||
if( size[ABOVE] )
|
||||
{
|
||||
SET_DC( ABOVE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( -len / 2.0, -aboveOffset ), 0, flags );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( -len / 2.0, -aboveOffset ), 0 );
|
||||
}
|
||||
if( size[BELOW] )
|
||||
{
|
||||
SET_DC( BELOW );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_TOP );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( -len / 2.0, belowOffset ), 0, flags );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( -len / 2.0, belowOffset ), 0 );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1020,28 +1018,28 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
|
|||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( insideOffset + len, 0 ), 0, flags );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( insideOffset + len, 0 ), 0 );
|
||||
}
|
||||
if( size[OUTSIDE] )
|
||||
{
|
||||
SET_DC( OUTSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( -outsideOffset, 0 ), 0, flags );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( -outsideOffset, 0 ), 0 );
|
||||
}
|
||||
if( size[ABOVE] )
|
||||
{
|
||||
SET_DC( ABOVE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( len / 2.0, -aboveOffset ), 0, flags );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( len / 2.0, -aboveOffset ), 0 );
|
||||
}
|
||||
if( size[BELOW] )
|
||||
{
|
||||
SET_DC( BELOW );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_TOP );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( len / 2.0, belowOffset ), 0, flags );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( len / 2.0, belowOffset ), 0 );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1051,28 +1049,28 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
|
|||
SET_DC( INSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( 0, insideOffset + len ), M_PI / 2, flags );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( 0, insideOffset + len ), M_PI / 2 );
|
||||
}
|
||||
if( size[OUTSIDE] )
|
||||
{
|
||||
SET_DC( OUTSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( 0, -outsideOffset ), M_PI / 2, flags );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( 0, -outsideOffset ), M_PI / 2 );
|
||||
}
|
||||
if( size[ABOVE] )
|
||||
{
|
||||
SET_DC( ABOVE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( -aboveOffset, len / 2.0 ), M_PI / 2, flags );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( -aboveOffset, len / 2.0 ), M_PI / 2 );
|
||||
}
|
||||
if( size[BELOW] )
|
||||
{
|
||||
SET_DC( BELOW );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_TOP );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( belowOffset, len / 2.0 ), M_PI / 2, flags );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( belowOffset, len / 2.0 ), M_PI / 2 );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1082,28 +1080,28 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
|
|||
SET_DC( INSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( 0, -insideOffset - len ), M_PI / 2, flags );
|
||||
strokeText( text[INSIDE], pos + VECTOR2D( 0, -insideOffset - len ), M_PI / 2 );
|
||||
}
|
||||
if( size[OUTSIDE] )
|
||||
{
|
||||
SET_DC( OUTSIDE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( 0, outsideOffset ), M_PI / 2, flags );
|
||||
strokeText( text[OUTSIDE], pos + VECTOR2D( 0, outsideOffset ), M_PI / 2 );
|
||||
}
|
||||
if( size[ABOVE] )
|
||||
{
|
||||
SET_DC( ABOVE );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( -aboveOffset, -len / 2.0 ), M_PI / 2, flags );
|
||||
strokeText( text[ABOVE], pos + VECTOR2D( -aboveOffset, -len / 2.0 ), M_PI / 2 );
|
||||
}
|
||||
if( size[BELOW] )
|
||||
{
|
||||
SET_DC( BELOW );
|
||||
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
|
||||
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_TOP );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( belowOffset, -len / 2.0 ), M_PI / 2, flags );
|
||||
strokeText( text[BELOW], pos + VECTOR2D( belowOffset, -len / 2.0 ), M_PI / 2 );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1316,8 +1314,7 @@ void SCH_PAINTER::draw( SCH_TEXT *aText, int aLayer )
|
|||
|
||||
if( !shownText.IsEmpty() )
|
||||
{
|
||||
strokeText( shownText, text_offset, aText->GetTextAngleRadians(),
|
||||
aText->GetTextMarkupFlags() );
|
||||
strokeText( shownText, text_offset, aText->GetTextAngleRadians() );
|
||||
}
|
||||
|
||||
if( aText->IsDangling() )
|
||||
|
@ -1405,7 +1402,6 @@ void SCH_PAINTER::draw( SCH_COMPONENT *aComp, int aLayer )
|
|||
|
||||
tempPin->ClearFlags();
|
||||
tempPin->SetFlags( compPin->GetFlags() ); // SELECTED, HIGHLIGHTED, BRIGHTENED
|
||||
tempPin->SetTextMarkupFlags( compPin->GetTextMarkupFlags() );
|
||||
|
||||
if( compPin->IsDangling() )
|
||||
tempPin->SetFlags( IS_DANGLING );
|
||||
|
@ -1499,8 +1495,7 @@ void SCH_PAINTER::draw( SCH_FIELD *aField, int aLayer )
|
|||
m_gal->SetTextMirrored( aField->IsMirrored() );
|
||||
m_gal->SetLineWidth( getTextThickness( aField, drawingShadows ) );
|
||||
|
||||
strokeText( aField->GetShownText(), textpos, orient == TEXT_ANGLE_VERT ? M_PI / 2 : 0,
|
||||
aField->GetTextMarkupFlags() );
|
||||
strokeText( aField->GetShownText(), textpos, orient == TEXT_ANGLE_VERT ? M_PI / 2 : 0 );
|
||||
}
|
||||
|
||||
// Draw the umbilical line
|
||||
|
|
|
@ -183,8 +183,7 @@ private:
|
|||
void fillIfSelection( int aLayer );
|
||||
|
||||
void triLine ( const VECTOR2D &a, const VECTOR2D &b, const VECTOR2D &c );
|
||||
void strokeText( const wxString& aText, const VECTOR2D& aPosition, double aRotationAngle,
|
||||
int aTextMarkupFlags );
|
||||
void strokeText( const wxString& aText, const VECTOR2D& aPosition, double aRotationAngle );
|
||||
|
||||
SCH_RENDER_SETTINGS m_schSettings;
|
||||
};
|
||||
|
|
|
@ -39,10 +39,6 @@ class SCH_PIN : public SCH_ITEM
|
|||
wxPoint m_position;
|
||||
bool m_isDangling;
|
||||
|
||||
int m_textMarkupFlags; // Set of TEXT_MARKUP_FLAGS indicating which markup
|
||||
// features are to be processed within the pin name
|
||||
// and number.
|
||||
|
||||
/// The name that this pin connection will drive onto a net
|
||||
std::mutex m_netmap_mutex;
|
||||
std::map<const SCH_SHEET_PATH, wxString> m_net_name_map;
|
||||
|
@ -89,9 +85,6 @@ public:
|
|||
const EDA_RECT GetBoundingBox() const override;
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
||||
int GetTextMarkupFlags() const { return m_textMarkupFlags; }
|
||||
void SetTextMarkupFlags( int aFlags ) { m_textMarkupFlags = aFlags; }
|
||||
|
||||
bool IsDangling() const override { return m_isDangling; }
|
||||
void SetIsDangling( bool isDangling ) { m_isDangling = isDangling; }
|
||||
|
||||
|
|
|
@ -521,43 +521,6 @@ void SCH_SCREEN::UpdateSymbolLinks( bool aForce )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SCREEN::UpdateTextMarkupFlags( int aMarkupFlags )
|
||||
{
|
||||
for( SCH_ITEM* aItem : Items() )
|
||||
{
|
||||
switch( aItem->Type() )
|
||||
{
|
||||
case SCH_TEXT_T:
|
||||
case SCH_LABEL_T:
|
||||
case SCH_HIER_LABEL_T:
|
||||
case SCH_GLOBAL_LABEL_T:
|
||||
case SCH_SHEET_PIN_T:
|
||||
static_cast<SCH_TEXT*>( aItem )->SetTextMarkupFlags( aMarkupFlags );
|
||||
break;
|
||||
|
||||
case SCH_COMPONENT_T:
|
||||
for( SCH_FIELD& field : static_cast<SCH_COMPONENT*>( aItem )->GetFields() )
|
||||
field.SetTextMarkupFlags( aMarkupFlags );
|
||||
|
||||
break;
|
||||
|
||||
case SCH_PIN_T:
|
||||
static_cast<SCH_PIN*>( aItem )->SetTextMarkupFlags( aMarkupFlags );
|
||||
break;
|
||||
|
||||
case SCH_SHEET_T:
|
||||
for( SCH_FIELD& field : static_cast<SCH_SHEET*>( aItem )->GetFields() )
|
||||
field.SetTextMarkupFlags( aMarkupFlags );
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREEN::Print( RENDER_SETTINGS* aSettings )
|
||||
{
|
||||
// Ensure links are up to date, even if a library was reloaded for some reason:
|
||||
|
@ -1189,13 +1152,6 @@ void SCH_SCREENS::UpdateSymbolLinks( bool aForce )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SCREENS::UpdateTextMarkupFlags( int aMarkupFlags )
|
||||
{
|
||||
for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
|
||||
screen->UpdateTextMarkupFlags( aMarkupFlags );
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREENS::TestDanglingEnds()
|
||||
{
|
||||
std::vector<SCH_SCREEN*> screens;
|
||||
|
|
|
@ -235,8 +235,6 @@ public:
|
|||
*/
|
||||
void UpdateSymbolLinks( bool aForce = false );
|
||||
|
||||
void UpdateTextMarkupFlags( int aMarkupFlags );
|
||||
|
||||
/**
|
||||
* Print all the items in the screen to \a aDC.
|
||||
*
|
||||
|
@ -556,8 +554,6 @@ public:
|
|||
*/
|
||||
void UpdateSymbolLinks( bool aForce = false );
|
||||
|
||||
void UpdateTextMarkupFlags( int aMarkupFlags );
|
||||
|
||||
void TestDanglingEnds();
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,9 +96,9 @@ static int* TemplateShape[5][4] =
|
|||
};
|
||||
|
||||
|
||||
SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType, int aMarkupFlags ) :
|
||||
SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
|
||||
SCH_ITEM( NULL, aType ),
|
||||
EDA_TEXT( text, aMarkupFlags ),
|
||||
EDA_TEXT( text ),
|
||||
m_shape( PINSHEETLABEL_SHAPE::PS_INPUT ),
|
||||
m_isDangling( false ),
|
||||
m_connectionType( CONNECTION_TYPE::NONE ),
|
||||
|
@ -603,7 +603,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
|
|||
wxPoint textpos = positions[ii] + GetSchematicTextOffset( aPlotter->RenderSettings() );
|
||||
wxString& txt = strings_list.Item( ii );
|
||||
aPlotter->Text( textpos, color, txt, GetTextAngle(), GetTextSize(), GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold(), m_textMarkupFlags );
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -611,8 +611,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
|
|||
wxPoint textpos = GetTextPos() + GetSchematicTextOffset( aPlotter->RenderSettings() );
|
||||
|
||||
aPlotter->Text( textpos, color, GetShownText(), GetTextAngle(), GetTextSize(),
|
||||
GetHorizJustify(), GetVertJustify(), penWidth, IsItalic(), IsBold(),
|
||||
m_textMarkupFlags );
|
||||
GetHorizJustify(), GetVertJustify(), penWidth, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
// Draw graphic symbol for global or hierarchical labels
|
||||
|
@ -703,8 +702,8 @@ void SCH_TEXT::Show( int nestLevel, std::ostream& os ) const
|
|||
#endif
|
||||
|
||||
|
||||
SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text, int aMarkupFlags )
|
||||
: SCH_TEXT( pos, text, SCH_LABEL_T, aMarkupFlags )
|
||||
SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text )
|
||||
: SCH_TEXT( pos, text, SCH_LABEL_T )
|
||||
{
|
||||
m_Layer = LAYER_LOCLABEL;
|
||||
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
|
||||
|
@ -796,8 +795,8 @@ BITMAP_DEF SCH_LABEL::GetMenuImage() const
|
|||
}
|
||||
|
||||
|
||||
SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text, int aMarkupFlags )
|
||||
: SCH_TEXT( pos, text, SCH_GLOBAL_LABEL_T, aMarkupFlags )
|
||||
SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text )
|
||||
: SCH_TEXT( pos, text, SCH_GLOBAL_LABEL_T )
|
||||
{
|
||||
m_Layer = LAYER_GLOBLABEL;
|
||||
m_shape = PINSHEETLABEL_SHAPE::PS_BIDI;
|
||||
|
@ -905,7 +904,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( RENDER_SETTINGS* aRenderSettings,
|
|||
int margin = GetTextOffset( aRenderSettings );
|
||||
int halfSize = ( GetTextHeight() / 2 ) + margin;
|
||||
int linewidth = GetPenWidth();
|
||||
int symb_len = LenSize( GetShownText(), linewidth, m_textMarkupFlags ) + 2 * margin;
|
||||
int symb_len = LenSize( GetShownText(), linewidth ) + 2 * margin;
|
||||
|
||||
int x = symb_len + linewidth + 3;
|
||||
int y = halfSize;
|
||||
|
@ -982,7 +981,7 @@ const EDA_RECT SCH_GLOBALLABEL::GetBoundingBox() const
|
|||
int margin = Mils2iu( TXT_MARGIN );
|
||||
|
||||
int height = ( (GetTextHeight() * 15) / 10 ) + penWidth + 2 * margin;
|
||||
int length = LenSize( GetShownText(), penWidth, m_textMarkupFlags )
|
||||
int length = LenSize( GetShownText(), penWidth )
|
||||
+ height // add height for triangular shapes
|
||||
+ 2 * margin;
|
||||
|
||||
|
@ -1038,9 +1037,8 @@ BITMAP_DEF SCH_GLOBALLABEL::GetMenuImage() const
|
|||
}
|
||||
|
||||
|
||||
SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text, KICAD_T aType,
|
||||
int aMarkupFlags )
|
||||
: SCH_TEXT( pos, text, aType, aMarkupFlags )
|
||||
SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text, KICAD_T aType )
|
||||
: SCH_TEXT( pos, text, aType )
|
||||
{
|
||||
m_Layer = LAYER_HIERLABEL;
|
||||
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
|
||||
|
@ -1150,7 +1148,7 @@ const EDA_RECT SCH_HIERLABEL::GetBoundingBox() const
|
|||
int y = GetTextPos().y;
|
||||
|
||||
int height = GetTextHeight() + penWidth + 2 * margin;
|
||||
int length = LenSize( GetShownText(), penWidth, m_textMarkupFlags )
|
||||
int length = LenSize( GetShownText(), penWidth )
|
||||
+ height // add height for triangular shapes
|
||||
+ 2 * margin;
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ protected:
|
|||
|
||||
public:
|
||||
SCH_TEXT( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
|
||||
KICAD_T aType = SCH_TEXT_T, int aMarkupFlags = 0 );
|
||||
KICAD_T aType = SCH_TEXT_T );
|
||||
|
||||
/**
|
||||
* Clones \a aText into a new object. All members are copied as is except
|
||||
|
@ -325,8 +325,7 @@ public:
|
|||
class SCH_LABEL : public SCH_TEXT
|
||||
{
|
||||
public:
|
||||
SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
|
||||
int aMarkupFlags = 0 );
|
||||
SCH_LABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
|
@ -370,8 +369,7 @@ private:
|
|||
class SCH_GLOBALLABEL : public SCH_TEXT
|
||||
{
|
||||
public:
|
||||
SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
|
||||
int aMarkupFlags = 0 );
|
||||
SCH_GLOBALLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
|
@ -421,7 +419,7 @@ class SCH_HIERLABEL : public SCH_TEXT
|
|||
{
|
||||
public:
|
||||
SCH_HIERLABEL( const wxPoint& aPos = wxPoint( 0, 0 ), const wxString& aText = wxEmptyString,
|
||||
KICAD_T aType = SCH_HIER_LABEL_T, int aMarkupFlags = 0 );
|
||||
KICAD_T aType = SCH_HIER_LABEL_T );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
|
|
|
@ -472,7 +472,6 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHier
|
|||
|
||||
SCH_SCREENS screens( aSheet );
|
||||
screens.UpdateSymbolLinks( true );
|
||||
screens.UpdateTextMarkupFlags( GetTextMarkupFlags() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
case LIB_TEXT_T:
|
||||
{
|
||||
LIB_TEXT* text = new LIB_TEXT( part, m_frame->GetTextMarkupFlags() );
|
||||
LIB_TEXT* text = new LIB_TEXT( part );
|
||||
text->SetPosition( wxPoint( cursorPos.x, -cursorPos.y ) );
|
||||
text->SetTextSize( wxSize( m_frame->GetDefaultTextSize(),
|
||||
m_frame->GetDefaultTextSize() ) );
|
||||
|
|
|
@ -661,7 +661,7 @@ int LIB_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
// If it's not a part then paste as text
|
||||
newPart = new LIB_PART( "dummy_part" );
|
||||
LIB_TEXT* newText = new LIB_TEXT( newPart, m_frame->GetTextMarkupFlags() );
|
||||
LIB_TEXT* newText = new LIB_TEXT( newPart );
|
||||
newText->SetText( text );
|
||||
newPart->AddDrawItem( newText );
|
||||
}
|
||||
|
|
|
@ -1170,8 +1170,6 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
paste_screen.UpdateTextMarkupFlags( m_frame->GetTextMarkupFlags() );
|
||||
|
||||
// Remove the references from our temporary screen to prevent freeing on the DTOR
|
||||
paste_screen.Clear( false );
|
||||
|
||||
|
|
|
@ -373,8 +373,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus( const wxString& aNet )
|
|||
m_busUnfold.entry->SetParent( m_frame->GetScreen() );
|
||||
m_frame->AddToScreen( m_busUnfold.entry );
|
||||
|
||||
m_busUnfold.label = new SCH_LABEL( m_busUnfold.entry->m_End(), aNet,
|
||||
m_frame->GetTextMarkupFlags() );
|
||||
m_busUnfold.label = new SCH_LABEL( m_busUnfold.entry->m_End(), aNet );
|
||||
m_busUnfold.label->SetTextSize( wxSize( m_frame->GetDefaultTextSize(),
|
||||
m_frame->GetDefaultTextSize() ) );
|
||||
m_busUnfold.label->SetLabelSpinStyle( LABEL_SPIN_STYLE::RIGHT );
|
||||
|
|
|
@ -112,7 +112,7 @@ struct TEXT_EFFECTS
|
|||
class EDA_TEXT
|
||||
{
|
||||
public:
|
||||
EDA_TEXT( const wxString& text = wxEmptyString, int aMarkupFlags = 0 );
|
||||
EDA_TEXT( const wxString& text = wxEmptyString );
|
||||
|
||||
EDA_TEXT( const EDA_TEXT& aText );
|
||||
|
||||
|
@ -218,9 +218,6 @@ public:
|
|||
|
||||
bool IsDefaultFormatting() const;
|
||||
|
||||
void SetTextMarkupFlags( int aFlags ) { m_textMarkupFlags = aFlags; }
|
||||
int GetTextMarkupFlags() const { return m_textMarkupFlags; }
|
||||
|
||||
void SetTextSize( const wxSize& aNewSize ) { m_e.size = aNewSize; }
|
||||
const wxSize& GetTextSize() const { return m_e.size; }
|
||||
|
||||
|
@ -303,10 +300,8 @@ public:
|
|||
* @param aLine : the line of text to consider.
|
||||
* For single line text, this parameter is always m_Text
|
||||
* @param aThickness : the stroke width of the text
|
||||
* @param aMarkupFlags a flag set of MARKUP_FLAG enums indicating which markup tokens should
|
||||
* be processed
|
||||
*/
|
||||
int LenSize( const wxString& aLine, int aThickness, int aMarkupFlags ) const;
|
||||
int LenSize( const wxString& aLine, int aThickness ) const;
|
||||
|
||||
/**
|
||||
* Useful in multiline texts to calculate the full text or a line area (for zones filling,
|
||||
|
@ -353,9 +348,6 @@ public:
|
|||
*/
|
||||
virtual void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const;
|
||||
|
||||
protected:
|
||||
int m_textMarkupFlags; // Set of TEXT_MARKUP_FLAGS indicating which markup
|
||||
// features are to be processed.
|
||||
private:
|
||||
wxString m_text;
|
||||
wxString m_shown_text; // Cache of unescaped text for efficient access
|
||||
|
|
|
@ -339,12 +339,11 @@ public:
|
|||
* @param aText is the text to be drawn.
|
||||
* @param aPosition is the text position in world coordinates.
|
||||
* @param aRotationAngle is the text rotation angle.
|
||||
* @param aMarkupFlags a bitset of TEXT_MARKUP_FLAGS.
|
||||
*/
|
||||
virtual void StrokeText( const wxString& aText, const VECTOR2D& aPosition,
|
||||
double aRotationAngle, int aMarkupFlags = 0 )
|
||||
double aRotationAngle )
|
||||
{
|
||||
strokeFont.Draw( aText, aPosition, aRotationAngle, aMarkupFlags );
|
||||
strokeFont.Draw( aText, aPosition, aRotationAngle );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -375,10 +374,9 @@ public:
|
|||
* a only one line text.
|
||||
*
|
||||
* @param aText is the text string (one line).
|
||||
* @param aMarkupFlags a bitset of TEXT_MARKUP_FLAGS.
|
||||
* @return is the text size.
|
||||
*/
|
||||
VECTOR2D GetTextLineSize( const UTF8& aText, int aMarkupFlags = 0 ) const;
|
||||
VECTOR2D GetTextLineSize( const UTF8& aText ) const;
|
||||
|
||||
/**
|
||||
* Compute the vertical position of an overbar, sometimes used in texts.
|
||||
|
|
|
@ -73,11 +73,8 @@ public:
|
|||
* @param aText is the text to be drawn.
|
||||
* @param aPosition is the text position in world coordinates.
|
||||
* @param aRotationAngle is the text rotation angle in radians.
|
||||
* @param markupFlags a flagset of MARKUP_FLAG enums indicating which markup tokens should
|
||||
* be processed
|
||||
*/
|
||||
void Draw( const UTF8& aText, const VECTOR2D& aPosition, double aRotationAngle,
|
||||
int markupFlags );
|
||||
void Draw( const UTF8& aText, const VECTOR2D& aPosition, double aRotationAngle );
|
||||
|
||||
/**
|
||||
* Function SetGAL
|
||||
|
@ -92,13 +89,10 @@ public:
|
|||
/**
|
||||
* Compute the boundary limits of aText (the bounding box of all shapes).
|
||||
* The overbar and alignment are not taken in account, '~' characters are skipped.
|
||||
*
|
||||
* @param markupFlags a flagset of MARKUP_FLAG enums indicating which markup tokens should
|
||||
* be processed
|
||||
* @return a VECTOR2D giving the width and height of text.
|
||||
*/
|
||||
VECTOR2D ComputeStringBoundaryLimits( const UTF8& aText, const VECTOR2D& aGlyphSize,
|
||||
double aGlyphThickness, int markupFlags ) const;
|
||||
double aGlyphThickness ) const;
|
||||
|
||||
/**
|
||||
* Compute the vertical position of an overbar, sometimes used in texts.
|
||||
|
@ -129,10 +123,9 @@ private:
|
|||
* a only one line text.
|
||||
*
|
||||
* @param aText is the text string (one line).
|
||||
* @param aMarkupFlags a bitset of TEXT_MARKUP_FLAGS.
|
||||
* @return the text size.
|
||||
*/
|
||||
VECTOR2D computeTextLineSize( const UTF8& aText, int aMarkupFlags ) const;
|
||||
VECTOR2D computeTextLineSize( const UTF8& aText ) const;
|
||||
|
||||
/**
|
||||
* Compute the vertical position of an overbar, sometimes used in texts.
|
||||
|
@ -156,7 +149,7 @@ private:
|
|||
*
|
||||
* @param aText is the text to be drawn.
|
||||
*/
|
||||
void drawSingleLineText( const UTF8& aText, int markupFlags );
|
||||
void drawSingleLineText( const UTF8& aText );
|
||||
|
||||
/**
|
||||
* @brief Returns number of lines for a given text.
|
||||
|
|
|
@ -50,12 +50,6 @@
|
|||
|
||||
class PLOTTER;
|
||||
|
||||
enum TEXT_MARKUP_FLAGS
|
||||
{
|
||||
ENABLE_SUBSCRIPT_MARKUP = 1 << 0,
|
||||
ENABLE_SUPERSCRIPT_MARKUP = 1 << 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Function Clamp_Text_PenSize
|
||||
*As a rule, pen width should not be >1/4em, otherwise the character
|
||||
|
@ -103,8 +97,6 @@ int GraphicTextWidth( const wxString& aText, const wxSize& aSize, bool italic, b
|
|||
* Use a value min(aSize.x, aSize.y) / 5 for a bold text
|
||||
* @param aItalic = true to simulate an italic font
|
||||
* @param aBold = true to use a bold font
|
||||
* @param aMarkupFlags a set of TEXT_MARKUP_FLAGS indicating what markup features are to
|
||||
* be processed
|
||||
* @param aCallback( int x0, int y0, int xf, int yf, void* aData ) is a function called
|
||||
* (if non null) to draw each segment. used to draw 3D texts or for plotting.
|
||||
* NULL for normal drawings
|
||||
|
@ -116,7 +108,6 @@ int GraphicTextWidth( const wxString& aText, const wxSize& aSize, bool italic, b
|
|||
void GRText( wxDC * aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText,
|
||||
double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify,
|
||||
enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold,
|
||||
int aMarkupFlags,
|
||||
void (*aCallback)( int x0, int y0, int xf, int yf, void* aData ) = nullptr,
|
||||
void* aCallbackData = nullptr, PLOTTER * aPlotter = nullptr );
|
||||
|
||||
|
@ -130,7 +121,7 @@ void GRText( wxDC * aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aT
|
|||
void GRHaloText( wxDC * aDC, const wxPoint &aPos, COLOR4D aBgColor, COLOR4D aColor1,
|
||||
COLOR4D aColor2, const wxString &aText, double aOrient, const wxSize &aSize,
|
||||
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
|
||||
int aWidth, bool aItalic, bool aBold, int aMarkupFlags,
|
||||
int aWidth, bool aItalic, bool aBold,
|
||||
void (*aCallback)( int x0, int y0, int xf, int yf, void* aData ) = nullptr,
|
||||
void* aCallbackData = nullptr, PLOTTER * aPlotter = nullptr );
|
||||
|
||||
|
|
|
@ -133,9 +133,6 @@ public:
|
|||
virtual void SetColorMode( bool aColorMode ) { colorMode = aColorMode; }
|
||||
bool GetColorMode() const { return colorMode; }
|
||||
|
||||
void SetTextMarkupFlags( bool aMarkupFlags ) { m_textMarkupFlags = aMarkupFlags; }
|
||||
int GetTextMarkupFlags() const { return m_textMarkupFlags; }
|
||||
|
||||
void SetRenderSettings( RENDER_SETTINGS* aSettings ) { m_renderSettings = aSettings; }
|
||||
RENDER_SETTINGS* RenderSettings() { return m_renderSettings; }
|
||||
|
||||
|
@ -412,7 +409,6 @@ public:
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed = false,
|
||||
void* aData = NULL );
|
||||
|
||||
|
@ -590,7 +586,6 @@ protected: // variables used in most of plotters:
|
|||
wxArrayString m_headerExtraLines; // a set of string to print in header file
|
||||
|
||||
RENDER_SETTINGS* m_renderSettings;
|
||||
int m_textMarkupFlags;
|
||||
};
|
||||
|
||||
|
||||
|
@ -827,7 +822,6 @@ public:
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed = false,
|
||||
void* aData = NULL ) override;
|
||||
protected:
|
||||
|
@ -900,7 +894,6 @@ public:
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed = false,
|
||||
void* aData = NULL ) override;
|
||||
|
||||
|
@ -994,7 +987,6 @@ public:
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed = false,
|
||||
void* aData = NULL ) override;
|
||||
|
||||
|
@ -1202,7 +1194,6 @@ public:
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed = false,
|
||||
void* aData = NULL ) override;
|
||||
|
||||
|
@ -1490,7 +1481,6 @@ public:
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold,
|
||||
int aTextMarkupFlags,
|
||||
bool aMultilineAllowed = false,
|
||||
void* aData = NULL ) override;
|
||||
|
||||
|
|
|
@ -275,10 +275,10 @@ class WS_DRAW_ITEM_TEXT : public WS_DRAW_ITEM_BASE, public EDA_TEXT
|
|||
{
|
||||
public:
|
||||
WS_DRAW_ITEM_TEXT( WS_DATA_ITEM* aPeer, int aIndex, wxString& aText, wxPoint aPos,
|
||||
wxSize aSize, int aPenWidth, int aMarkupFlags, bool aItalic = false,
|
||||
wxSize aSize, int aPenWidth, bool aItalic = false,
|
||||
bool aBold = false ) :
|
||||
WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
|
||||
EDA_TEXT( aText, aMarkupFlags )
|
||||
EDA_TEXT( aText )
|
||||
{
|
||||
SetTextPos( aPos );
|
||||
SetTextSize( aSize );
|
||||
|
|
|
@ -234,8 +234,8 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye
|
|||
|
||||
GRText( NULL, textmod->GetTextPos(), BLACK, textmod->GetShownText(),
|
||||
textmod->GetDrawRotation(), size, textmod->GetHorizJustify(),
|
||||
textmod->GetVertJustify(), penWidth, textmod->IsItalic(),
|
||||
forceBold, 0, addTextSegmToPoly, &prms );
|
||||
textmod->GetVertJustify(), penWidth, textmod->IsItalic(), forceBold,
|
||||
addTextSegmToPoly, &prms );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,13 +336,13 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet( SHAPE_POLY_SET& aCorner
|
|||
{
|
||||
wxString txt = strings_list.Item( ii );
|
||||
GRText( NULL, positions[ii], color, txt, GetTextAngle(), size, GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, 0, addTextSegmToPoly, &prms );
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, addTextSegmToPoly, &prms );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GRText( NULL, GetTextPos(), color, GetShownText(), GetTextAngle(), size, GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, 0, addTextSegmToPoly, &prms );
|
||||
GetVertJustify(), penWidth, IsItalic(), forceBold, addTextSegmToPoly, &prms );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ void TEXTE_MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOff
|
|||
size.x = -size.x;
|
||||
|
||||
GRText( aDC, pos, color, GetShownText(), orient, size, GetHorizJustify(), GetVertJustify(),
|
||||
width, IsItalic(), IsBold(), 0 );
|
||||
width, IsItalic(), IsBold() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -659,7 +659,7 @@ void VIA::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset )
|
|||
tsize = (tsize * 7) / 10; // small reduction to give a better look, inside via
|
||||
|
||||
GRHaloText( aDC, m_Start, color, WHITE, BLACK, text, 0, wxSize( tsize, tsize ),
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize/7, false, false, 0 );
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize/7, false, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -797,14 +797,14 @@ static void export_vrml_pcbtext( MODEL_VRML& aModel, TEXTE_PCB* text )
|
|||
{
|
||||
GRText( nullptr, positions[ii], color, strings_list[ii], text->GetTextAngle(), size,
|
||||
text->GetHorizJustify(), text->GetVertJustify(), penWidth, text->IsItalic(),
|
||||
forceBold, 0, vrml_text_callback );
|
||||
forceBold, vrml_text_callback );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GRText( nullptr, text->GetTextPos(), color, text->GetShownText(), text->GetTextAngle(),
|
||||
size, text->GetHorizJustify(), text->GetVertJustify(), penWidth, text->IsItalic(),
|
||||
forceBold, 0, vrml_text_callback );
|
||||
forceBold, vrml_text_callback );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ static void export_vrml_text_module( TEXTE_MODULE* item )
|
|||
|
||||
GRText( NULL, item->GetTextPos(), BLACK, item->GetShownText(), item->GetDrawRotation(),
|
||||
size, item->GetHorizJustify(), item->GetVertJustify(), penWidth, item->IsItalic(),
|
||||
forceBold, 0, vrml_text_callback );
|
||||
forceBold, vrml_text_callback );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
|||
wxString Text = wxT( "Drill Map:" );
|
||||
plotter->Text( wxPoint( plotX, plotY ), COLOR4D::UNSPECIFIED, Text, 0,
|
||||
wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false, 0 );
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
|
||||
|
||||
// For some formats (PS, PDF SVG) we plot the drill size list on more than one column
|
||||
// because the list must be contained inside the printed page
|
||||
|
@ -301,7 +301,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
|||
|
||||
plotter->Text( wxPoint( plotX, y ), COLOR4D::UNSPECIFIED, msg, 0,
|
||||
wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false, 0 );
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
|
||||
|
||||
intervalle = KiROUND( ( ( charSize * charScale ) + TextWidth ) * 1.2 );
|
||||
|
||||
|
|
|
@ -543,7 +543,7 @@ void D_PAD::PrintShape( wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
|
|||
tsize = ( tsize * 7 ) / 10;
|
||||
GRHaloText( aDC, tpos, aDrawInfo.m_Color, BLACK, WHITE, m_name, t_angle,
|
||||
wxSize( tsize , tsize ), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
tsize / 7, false, false, 0 );
|
||||
tsize / 7, false, false );
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ void D_PAD::PrintShape( wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
|
|||
tsize = ( tsize * 7 ) / 10;
|
||||
GRHaloText( aDC, tpos, aDrawInfo.m_Color, BLACK, WHITE, shortname, t_angle,
|
||||
wxSize( tsize, tsize ), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||
tsize / 7, false, false, 0 );
|
||||
tsize / 7, false, false );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1024,7 +1024,7 @@ void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer )
|
|||
m_gal->SetIsFill( false );
|
||||
m_gal->SetIsStroke( true );
|
||||
m_gal->SetTextAttributes( aText );
|
||||
m_gal->StrokeText( shownText, position, aText->GetTextAngleRadians(), 0 );
|
||||
m_gal->StrokeText( shownText, position, aText->GetTextAngleRadians() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1056,7 +1056,7 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
|
|||
m_gal->SetIsFill( false );
|
||||
m_gal->SetIsStroke( true );
|
||||
m_gal->SetTextAttributes( aText );
|
||||
m_gal->StrokeText( shownText, position, aText->GetDrawRotationRadians(), 0 );
|
||||
m_gal->StrokeText( shownText, position, aText->GetDrawRotationRadians() );
|
||||
|
||||
// Draw the umbilical line
|
||||
if( aText->IsSelected() )
|
||||
|
@ -1186,7 +1186,7 @@ void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer )
|
|||
|
||||
m_gal->SetLineWidth( getLineThickness( text.GetEffectiveTextPenWidth() ) );
|
||||
m_gal->SetTextAttributes( &text );
|
||||
m_gal->StrokeText( text.GetShownText(), position, text.GetTextAngleRadians(), 0 );
|
||||
m_gal->StrokeText( text.GetShownText(), position, text.GetTextAngleRadians() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -380,8 +380,7 @@ void BRDITEMS_PLOTTER::PlotTextModule( TEXTE_MODULE* pt_texte, COLOR4D aColor )
|
|||
|
||||
m_plotter->Text( pos, aColor, pt_texte->GetShownText(), orient, size,
|
||||
pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(), thickness,
|
||||
pt_texte->IsItalic(), allow_bold, pt_texte->GetTextMarkupFlags(),
|
||||
false, &gbr_metadata );
|
||||
pt_texte->IsItalic(), allow_bold, false, &gbr_metadata );
|
||||
}
|
||||
|
||||
|
||||
|
@ -682,14 +681,14 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
|
|||
wxString& txt = strings_list.Item( ii );
|
||||
m_plotter->Text( positions[ii], color, txt, orient, size, pt_texte->GetHorizJustify(),
|
||||
pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(),
|
||||
allow_bold, pt_texte->GetTextMarkupFlags(), false, &gbr_metadata );
|
||||
allow_bold, false, &gbr_metadata );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotter->Text( pos, color, shownText, orient, size, pt_texte->GetHorizJustify(),
|
||||
pt_texte->GetVertJustify(), thickness, pt_texte->IsItalic(), allow_bold,
|
||||
pt_texte->GetTextMarkupFlags(), false, &gbr_metadata );
|
||||
false, &gbr_metadata );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue