diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index e6fdbc83e1..66c7c14818 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -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 ); } } diff --git a/common/eda_text.cpp b/common/eda_text.cpp index c032b04708..5808ab1b36 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -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<& 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 ); } } diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp index a8c1ca8fcd..ff834b7610 100644 --- a/common/gal/graphics_abstraction_layer.cpp +++ b/common/gal/graphics_abstraction_layer.cpp @@ -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 ); } diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp index 0161827dd7..0cd6bc65a0 100644 --- a/common/gal/stroke_font.cpp +++ b/common/gal/stroke_font.cpp @@ -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 diff --git a/common/gr_text.cpp b/common/gr_text.cpp index 5525706a68..480e26c1cf 100644 --- a/common/gr_text.cpp +++ b/common/gr_text.cpp @@ -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 ); } diff --git a/common/plotters/DXF_plotter.cpp b/common/plotters/DXF_plotter.cpp index 145f529a4c..6364292c17 100644 --- a/common/plotters/DXF_plotter.cpp +++ b/common/plotters/DXF_plotter.cpp @@ -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 { diff --git a/common/plotters/GERBER_plotter.cpp b/common/plotters/GERBER_plotter.cpp index e41ec0646a..64117b70b2 100644 --- a/common/plotters/GERBER_plotter.cpp +++ b/common/plotters/GERBER_plotter.cpp @@ -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( 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 ); } diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 5e15dd7ea9..955b38d18b 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -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 ); } } diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index 48923c3ee9..4dc9f2bdad 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -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 ); } } diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 56d4b958b1..512fa1a03b 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -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, "%s\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( "", outputFile ); } diff --git a/common/plotters/common_plot_functions.cpp b/common/plotters/common_plot_functions.cpp index 30a0890ec2..aaa0813813 100644 --- a/common/plotters/common_plot_functions.cpp +++ b/common/plotters/common_plot_functions.cpp @@ -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; diff --git a/eeschema/class_libentry.h b/eeschema/class_libentry.h index 4107efa5fd..695b612711 100644 --- a/eeschema/class_libentry.h +++ b/eeschema/class_libentry.h @@ -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; } }; diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index effc9a74f7..f4515d3a9f 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -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 ); } diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 7fbdff967c..767ff4dd6c 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -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 ) diff --git a/eeschema/dialogs/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp index 81b2f9ec84..387de6ac8d 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin.cpp @@ -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 ); diff --git a/eeschema/dialogs/dialog_sch_sheet_props.cpp b/eeschema/dialogs/dialog_sch_sheet_props.cpp index 6b6d2540b6..2e08bf4d25 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props.cpp @@ -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() ); diff --git a/eeschema/dialogs/dialog_update_fields.cpp b/eeschema/dialogs/dialog_update_fields.cpp index 2db169fdb6..3ce4f5cec1 100644 --- a/eeschema/dialogs/dialog_update_fields.cpp +++ b/eeschema/dialogs/dialog_update_fields.cpp @@ -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() ); diff --git a/eeschema/dialogs/panel_setup_formatting.cpp b/eeschema/dialogs/panel_setup_formatting.cpp index 0c95b104d9..f115ae17dc 100644 --- a/eeschema/dialogs/panel_setup_formatting.cpp +++ b/eeschema/dialogs/panel_setup_formatting.cpp @@ -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(); diff --git a/eeschema/dialogs/panel_setup_formatting_base.cpp b/eeschema/dialogs/panel_setup_formatting_base.cpp index d07332bd95..26c20d4dcc 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.cpp +++ b/eeschema/dialogs/panel_setup_formatting_base.cpp @@ -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 ); diff --git a/eeschema/dialogs/panel_setup_formatting_base.fbp b/eeschema/dialogs/panel_setup_formatting_base.fbp index ced00d6547..7677630ae5 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.fbp +++ b/eeschema/dialogs/panel_setup_formatting_base.fbp @@ -615,131 +615,6 @@ - - 5 - wxEXPAND|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Enable superscript/subscript markup - - 0 - - - 0 - - 1 - m_checkSuperSub - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Use '^' for superscript and '#' for subscript - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - (preceed superscript text with ^; subscript text with #) - 0 - - 0 - - - 0 - - 1 - m_superSubHint - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - diff --git a/eeschema/dialogs/panel_setup_formatting_base.h b/eeschema/dialogs/panel_setup_formatting_base.h index bf4738107a..9c0de8e5d3 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.h +++ b/eeschema/dialogs/panel_setup_formatting_base.h @@ -20,7 +20,6 @@ #include #include #include -#include #include /////////////////////////////////////////////////////////////////////////// @@ -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; diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp index 4e6aa41bc1..c3568d0b07 100644 --- a/eeschema/edit_label.cpp +++ b/eeschema/edit_label.cpp @@ -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; diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index d752806ce4..c2105bc348 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -267,8 +267,6 @@ void SCH_EDIT_FRAME::AddFormattingParameters( std::vector& 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 ), diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 643f04be7e..c452021f26 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -326,7 +326,6 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) ret &= fromLegacyString( aCfg, "FieldNames", "drawing.field_names" ); ret &= fromLegacy( aCfg, "HorizVertLinesOnly", "drawing.hv_lines_only" ); ret &= fromLegacy( aCfg, "RepeatLabelIncrement", "drawing.repeat_label_increment" ); - ret &= fromLegacy( aCfg, "TextMarkupFlags", "drawing.text_markup_flags" ); ret &= fromLegacy( aCfg, "DragActionIsMove", "input.drag_is_move" ); diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 54c2025c6b..01b918ffe0 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -407,7 +407,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& 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; diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index a54e691b74..c3ddce163e 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -115,7 +115,7 @@ void LIB_FIELD::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* wxString text = aData ? *static_cast( 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() ); } diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 4d5f1f5003..3e5b029ce0 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -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() ); } diff --git a/eeschema/lib_pin.h b/eeschema/lib_pin.h index 0527f7246b..23a4a1bb7b 100644 --- a/eeschema/lib_pin.h +++ b/eeschema/lib_pin.h @@ -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; diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 9865e43a23..7842b62dde 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -44,9 +44,9 @@ #include // 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() ); } diff --git a/eeschema/lib_text.h b/eeschema/lib_text.h index 70607fa72e..381daadd28 100644 --- a/eeschema/lib_text.h +++ b/eeschema/lib_text.h @@ -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. diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index ed8bd5a608..c430b5b44a 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -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( &item )->SetTextMarkupFlags( m_textMarkupFlags ); - break; - - case LIB_TEXT_T: - static_cast( &item )->SetTextMarkupFlags( m_textMarkupFlags ); - break; - - case LIB_PIN_T: - static_cast( &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(); diff --git a/eeschema/libedit/libedit_plot_component.cpp b/eeschema/libedit/libedit_plot_component.cpp index b8851c7d05..d96930e907 100644 --- a/eeschema/libedit/libedit_plot_component.cpp +++ b/eeschema/libedit/libedit_plot_component.cpp @@ -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; diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index 3dd5ce43dd..ba12e82dd0 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -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 ); diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 336ad0ac91..901f2740aa 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -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(); diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index f6af92f628..1d1276e6ae 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -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 diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 83b2fe64a6..0b5f25b1ab 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -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 ) diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 3945b9c0ce..d2e24b12cd 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -48,10 +48,10 @@ #include -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() ); } diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index e5775020f3..a15a109d1f 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -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. diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index c5b9106718..d44be7cec2 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -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 diff --git a/eeschema/sch_painter.h b/eeschema/sch_painter.h index f58ec1c046..13729aae9e 100644 --- a/eeschema/sch_painter.h +++ b/eeschema/sch_painter.h @@ -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; }; diff --git a/eeschema/sch_pin.h b/eeschema/sch_pin.h index de236d9206..092635ec2f 100644 --- a/eeschema/sch_pin.h +++ b/eeschema/sch_pin.h @@ -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 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; } diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 65fdf838d2..73b70a0f36 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -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( aItem )->SetTextMarkupFlags( aMarkupFlags ); - break; - - case SCH_COMPONENT_T: - for( SCH_FIELD& field : static_cast( aItem )->GetFields() ) - field.SetTextMarkupFlags( aMarkupFlags ); - - break; - - case SCH_PIN_T: - static_cast( aItem )->SetTextMarkupFlags( aMarkupFlags ); - break; - - case SCH_SHEET_T: - for( SCH_FIELD& field : static_cast( 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 screens; diff --git a/eeschema/sch_screen.h b/eeschema/sch_screen.h index 08d0a939b6..976b943dc3 100644 --- a/eeschema/sch_screen.h +++ b/eeschema/sch_screen.h @@ -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(); /** diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 64c3ef679d..e54edf895b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -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; diff --git a/eeschema/sch_text.h b/eeschema/sch_text.h index a5b191dd49..4728e5e045 100644 --- a/eeschema/sch_text.h +++ b/eeschema/sch_text.h @@ -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. diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index 51c8d8b87b..0ea50547ff 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -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; } diff --git a/eeschema/tools/lib_drawing_tools.cpp b/eeschema/tools/lib_drawing_tools.cpp index 43e06dbe18..44aca72e06 100644 --- a/eeschema/tools/lib_drawing_tools.cpp +++ b/eeschema/tools/lib_drawing_tools.cpp @@ -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() ) ); diff --git a/eeschema/tools/lib_edit_tool.cpp b/eeschema/tools/lib_edit_tool.cpp index fca9b003be..3959d600bc 100644 --- a/eeschema/tools/lib_edit_tool.cpp +++ b/eeschema/tools/lib_edit_tool.cpp @@ -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 ); } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index f023459f83..60d4e2ae98 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -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 ); diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 50da9ce342..385c2028dd 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -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 ); diff --git a/include/eda_text.h b/include/eda_text.h index 656e6e7a8e..e3e5d768bf 100644 --- a/include/eda_text.h +++ b/include/eda_text.h @@ -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 diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h index 4a03a7c99f..7b374c5534 100644 --- a/include/gal/graphics_abstraction_layer.h +++ b/include/gal/graphics_abstraction_layer.h @@ -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. diff --git a/include/gal/stroke_font.h b/include/gal/stroke_font.h index 168f87b6b4..aff2397e8b 100644 --- a/include/gal/stroke_font.h +++ b/include/gal/stroke_font.h @@ -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. diff --git a/include/gr_text.h b/include/gr_text.h index 43f9e8cd82..0ea2c2ef11 100644 --- a/include/gr_text.h +++ b/include/gr_text.h @@ -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 ); diff --git a/include/plotter.h b/include/plotter.h index 07f1260db8..c725b783e1 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -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; diff --git a/include/ws_draw_item.h b/include/ws_draw_item.h index 067af1c743..7fb6041b40 100644 --- a/include/ws_draw_item.h +++ b/include/ws_draw_item.h @@ -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 ); diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 7c3a5cd7b7..de8544f96a 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -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 ); } } diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 136f9f5b21..a7bf42b1b4 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -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() ); } diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index f237925e0f..57bf181788 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -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 ); } } } diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 02f5369ac6..c9f3484370 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -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 ); } } diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index dfed4005bb..ccebaf66a6 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -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 ); diff --git a/pcbnew/pad_print_functions.cpp b/pcbnew/pad_print_functions.cpp index df11f91eda..2c5deaf803 100644 --- a/pcbnew/pad_print_functions.cpp +++ b/pcbnew/pad_print_functions.cpp @@ -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 ); } } diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index ae4dfa4f8e..4107816a9f 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -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() ); } diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 8cebd9159c..b4832ebc23 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -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 ); } }