KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EDA_TEXT Class Reference

A mix-in class (via multiple inheritance) that handles texts such as labels, parts, components, or footprints. More...

#include <eda_text.h>

Inheritance diagram for EDA_TEXT:
SERIALIZABLE DS_DRAW_ITEM_TEXT PCB_TEXT PCB_TEXTBOX SCH_FIELD SCH_TEXT SCH_TEXTBOX PCB_DIMENSION_BASE PCB_FIELD PCB_TABLECELL SCH_LABEL_BASE SCH_TABLECELL PCB_DIM_ALIGNED PCB_DIM_CENTER PCB_DIM_LEADER PCB_DIM_RADIAL SCH_DIRECTIVE_LABEL SCH_GLOBALLABEL SCH_HIERLABEL SCH_LABEL

Classes

struct  BBOX_CACHE_ENTRY
 

Public Member Functions

 EDA_TEXT (const EDA_IU_SCALE &aIuScale, const wxString &aText=wxEmptyString)
 
 EDA_TEXT (const EDA_TEXT &aText)
 
virtual ~EDA_TEXT ()
 
EDA_TEXToperator= (const EDA_TEXT &aItem)
 
void Serialize (google::protobuf::Any &aContainer) const override
 Serializes this object to the given Any message.
 
bool Deserialize (const google::protobuf::Any &aContainer) override
 Deserializes the given protobuf message into this object.
 
void Serialize (google::protobuf::Any &aContainer, const EDA_IU_SCALE &aScale) const
 
bool Deserialize (const google::protobuf::Any &aContainer, const EDA_IU_SCALE &aScale)
 
virtual const wxString & GetText () const
 Return the string associated with the text object.
 
virtual wxString GetShownText (bool aAllowExtraText, int aDepth=0) const
 Return the string actually shown after processing of the base text.
 
bool HasTextVars () const
 Indicates the ShownText has text var references which need to be processed.
 
const std::vector< TEXT_VAR_REF_KEY > & GetTextVarReferences () const
 Return the set of ${...} references extracted from the source text.
 
virtual void SetText (const wxString &aText)
 
wxString EvaluateText (const wxString &aText) const
 
virtual void SetTextThickness (int aWidth)
 The TextThickness is that set by the user.
 
virtual int GetTextThickness () const
 
int GetTextThicknessProperty () const
 
void SetAutoThickness (bool aAuto)
 
bool GetAutoThickness () const
 
int GetEffectiveTextPenWidth (int aDefaultPenWidth=0) const
 The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
 
virtual void SetTextAngle (const EDA_ANGLE &aAngle)
 
virtual EDA_ANGLE GetTextAngle () const
 
void SetTextAngleDegrees (double aOrientation)
 
double GetTextAngleDegrees () const
 
void SetItalic (bool aItalic)
 Set the text to be italic - this will also update the font if needed.
 
void SetItalicFlag (bool aItalic)
 Set only the italic flag, without changing the font.
 
bool IsItalic () const
 
void SetBold (bool aBold)
 Set the text to be bold - this will also update the font if needed.
 
void SetBoldFlag (bool aBold)
 Set only the bold flag, without changing the font.
 
bool IsBold () const
 
virtual void SetVisible (bool aVisible)
 
virtual bool IsVisible () const
 
void SetMirrored (bool isMirrored)
 
bool IsMirrored () const
 
void SetMultilineAllowed (bool aAllow)
 
bool IsMultilineAllowed () const
 
void SetHorizJustify (GR_TEXT_H_ALIGN_T aType)
 
GR_TEXT_H_ALIGN_T GetHorizJustify () const
 
void SetVertJustify (GR_TEXT_V_ALIGN_T aType)
 
GR_TEXT_V_ALIGN_T GetVertJustify () const
 
void SetKeepUpright (bool aKeepUpright)
 
bool IsKeepUpright () const
 
void FlipHJustify ()
 
void SetAttributes (const EDA_TEXT &aSrc, bool aSetPosition=true)
 Set the text attributes from another instance.
 
void SwapAttributes (EDA_TEXT &aTradingPartner)
 Swap the text attributes of the two involved instances.
 
void SwapText (EDA_TEXT &aTradingPartner)
 
void CopyText (const EDA_TEXT &aSrc)
 
void SetAttributes (const TEXT_ATTRIBUTES &aTextAttrs)
 
const TEXT_ATTRIBUTESGetAttributes () const
 
bool Replace (const EDA_SEARCH_DATA &aSearchData)
 Helper function used in search and replace dialog.
 
bool IsDefaultFormatting () const
 
void SetFont (KIFONT::FONT *aFont)
 
KIFONT::FONTGetFont () const
 
void SetUnresolvedFontName (const wxString &aFontName)
 
bool ResolveFont (const std::vector< wxString > *aEmbeddedFonts)
 
wxString GetFontName () const
 
void SetFontProp (const wxString &aFontName)
 
wxString GetFontProp () const
 
void SetLineSpacing (double aLineSpacing)
 
double GetLineSpacing () const
 
virtual void SetTextSize (VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
 
virtual VECTOR2I GetTextSize () const
 
virtual void SetTextWidth (int aWidth)
 
virtual int GetTextWidth () const
 
virtual void SetTextHeight (int aHeight)
 
virtual int GetTextHeight () const
 
void SetTextColor (const COLOR4D &aColor)
 
COLOR4D GetTextColor () const
 
virtual void SetTextPos (const VECTOR2I &aPoint)
 
virtual VECTOR2I GetTextPos () const
 
virtual void SetTextX (int aX)
 
virtual void SetTextY (int aY)
 
void SetActiveUrl (const wxString &aUrl) const
 
virtual void Offset (const VECTOR2I &aOffset)
 
void Empty ()
 
void Print (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor)
 Print this text object to the device context aDC.
 
std::shared_ptr< SHAPE_COMPOUNDGetEffectiveTextShape (bool aTriangulate=true, const BOX2I &aBBox=BOX2I(), const EDA_ANGLE &aAngle=ANGLE_0) const
 build a list of segments (SHAPE_SEGMENT) to describe a text shape.
 
virtual bool TextHitTest (const VECTOR2I &aPoint, int aAccuracy=0) const
 Test if aPoint is within the bounds of this object.
 
virtual bool TextHitTest (const BOX2I &aRect, bool aContains, int aAccuracy=0) const
 Test if object bounding box is contained within or intersects aRect.
 
BOX2I GetTextBox (const RENDER_SETTINGS *aSettings, int aLine=-1) const
 Useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....)
 
int GetInterline (const RENDER_SETTINGS *aSettings) const
 Return the distance between two lines of text.
 
wxString GetTextStyleName () const
 
void GetLinePositions (const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPositions, int aLineCount) const
 Populate aPositions with the position of each line of a multiline text, according to the vertical justification and the rotation of the whole text.
 
double Levenshtein (const EDA_TEXT &aOther) const
 Return the levenstein distance between two texts.
 
double Similarity (const EDA_TEXT &aOther) const
 
virtual void Format (OUTPUTFORMATTER *aFormatter, int aControlBits) const
 Output the object to aFormatter in s-expression form.
 
virtual EDA_ANGLE GetDrawRotation () const
 
virtual VECTOR2I GetDrawPos () const
 
virtual KIFONT::FONTGetDrawFont (const RENDER_SETTINGS *aSettings) const
 
virtual void ClearRenderCache ()
 
virtual void ClearBoundingBoxCache ()
 
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache (const KIFONT::FONT *aFont, const wxString &forResolvedText, const VECTOR2I &aOffset={ 0, 0 }) const
 
void SetupRenderCache (const wxString &aResolvedText, const KIFONT::FONT *aFont, const EDA_ANGLE &aAngle, const VECTOR2I &aOffset)
 
void AddRenderCacheGlyph (const SHAPE_POLY_SET &aPoly)
 
int Compare (const EDA_TEXT *aOther) const
 
bool operator== (const EDA_TEXT &aRhs) const
 
bool operator< (const EDA_TEXT &aRhs) const
 
bool operator> (const EDA_TEXT &aRhs) const
 
virtual bool HasHyperlink () const
 
wxString GetHyperlink () const
 
void SetHyperlink (wxString aLink)
 
void RemoveHyperlink ()
 

Static Public Member Functions

static GR_TEXT_H_ALIGN_T MapHorizJustify (int aHorizJustify)
 
static GR_TEXT_V_ALIGN_T MapVertJustify (int aVertJustify)
 
static bool ValidateHyperlink (const wxString &aURL)
 Check if aURL is a valid hyperlink.
 
static bool IsGotoPageHref (const wxString &aHref, wxString *aDestination=nullptr)
 Check if aHref is a valid internal hyperlink.
 
static wxString GotoPageHref (const wxString &aDestination)
 Generate a href to a page in the current schematic.
 

Protected Member Functions

virtual const KIFONT::METRICSgetFontMetrics () const
 
virtual void cacheShownText ()
 
void printOneLineOfText (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor, const wxString &aText, const VECTOR2I &aPos)
 Print each line of this EDA_TEXT.
 
bool containsURL () const
 

Protected Attributes

wxString m_hyperlink
 A hyperlink URL.
 
wxString m_activeUrl
 

Private Attributes

wxString m_text
 
wxString m_shown_text
 
bool m_shown_text_has_text_var_refs = false
 
std::vector< TEXT_VAR_REF_KEYm_text_var_refs
 
std::reference_wrapper< const EDA_IU_SCALEm_IuScale
 
std::unique_ptr< EDA_TEXT_RENDER_CACHE_DATAm_render_cache
 
std::map< int, BBOX_CACHE_ENTRYm_bbox_cache
 
std::mutex m_bbox_cacheMutex
 
TEXT_ATTRIBUTES m_attributes
 
wxString m_unresolvedFontName
 
VECTOR2I m_pos
 
bool m_visible
 

Detailed Description

A mix-in class (via multiple inheritance) that handles texts such as labels, parts, components, or footprints.

Because it's a mix-in class, care is used to provide function names (accessors) that to not collide with function names likely to be seen in the combined derived classes.

Definition at line 88 of file eda_text.h.

Constructor & Destructor Documentation

◆ EDA_TEXT() [1/2]

◆ EDA_TEXT() [2/2]

◆ ~EDA_TEXT()

EDA_TEXT::~EDA_TEXT ( )
virtual

Definition at line 133 of file eda_text.cpp.

Member Function Documentation

◆ AddRenderCacheGlyph()

void EDA_TEXT::AddRenderCacheGlyph ( const SHAPE_POLY_SET & aPoly)

Definition at line 757 of file eda_text.cpp.

References KIFONT::OUTLINE_GLYPH::CacheTriangulation(), and m_render_cache.

◆ cacheShownText()

◆ ClearBoundingBoxCache()

◆ ClearRenderCache()

◆ Compare()

int EDA_TEXT::Compare ( const EDA_TEXT * aOther) const

Definition at line 1234 of file eda_text.cpp.

References EDA_TEXT(), GetFontName(), m_attributes, m_pos, m_text, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by operator<(), operator==(), and operator>().

◆ containsURL()

bool EDA_TEXT::containsURL ( ) const
protected

◆ CopyText()

void EDA_TEXT::CopyText ( const EDA_TEXT & aSrc)

Definition at line 272 of file eda_text.cpp.

References cacheShownText(), EDA_TEXT(), and m_text.

◆ Deserialize() [1/2]

bool EDA_TEXT::Deserialize ( const google::protobuf::Any & aContainer)
overridevirtual

Deserializes the given protobuf message into this object.

Parameters
aContaineris an Any which should have a concrete type matching this object
Returns
true if unpacking and deserialization succeeded

Reimplemented from SERIALIZABLE.

Reimplemented in PCB_DIM_ALIGNED, PCB_DIM_CENTER, PCB_DIM_LEADER, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIMENSION_BASE, PCB_FIELD, PCB_TEXT, PCB_TEXTBOX, SCH_DIRECTIVE_LABEL, SCH_FIELD, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LABEL, SCH_SHEET_PIN, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 208 of file eda_text.cpp.

References Deserialize(), and pcbIUScale.

Referenced by Deserialize(), PCB_DIMENSION_BASE::Deserialize(), PCB_TEXT::Deserialize(), SCH_FIELD::Deserialize(), SCH_SHEET_PIN::Deserialize(), and SCH_TEXT::Deserialize().

◆ Deserialize() [2/2]

◆ Empty()

void EDA_TEXT::Empty ( )

Definition at line 617 of file eda_text.cpp.

References cacheShownText(), and m_text.

Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::LoadPart().

◆ EvaluateText()

wxString EDA_TEXT::EvaluateText ( const wxString & aText) const

Definition at line 656 of file eda_text.cpp.

References EXPRESSION_EVALUATOR::Evaluate().

◆ FlipHJustify()

◆ Format()

◆ GetAttributes()

◆ GetAutoThickness()

◆ GetDrawFont()

◆ GetDrawPos()

◆ GetDrawRotation()

◆ GetEffectiveTextPenWidth()

int EDA_TEXT::GetEffectiveTextPenWidth ( int aDefaultPenWidth = 0) const

The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.

Definition at line 461 of file eda_text.cpp.

References ClampTextPenSize(), GetPenSizeForBold(), GetPenSizeForNormal(), GetTextSize(), GetTextThickness(), GetTextWidth(), and IsBold().

Referenced by BOARD_ADAPTER::addText(), PCB_IO_IPC2581::addText(), LABEL_BBOX_FIXTURE::CheckTextBoundingBoxWidth(), KIGFX::DS_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), SCH_HIERLABEL::GetBodyBoundingBox(), SCH_LABEL::GetBodyBoundingBox(), SCH_LABEL_BASE::GetBodyBoundingBox(), GetEffectiveTextShape(), PCB_TEXT::getKnockoutMargin(), PCB_TABLECELL::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), SCH_DIRECTIVE_LABEL::GetPenWidth(), SCH_FIELD::GetPenWidth(), SCH_TEXT::GetPenWidth(), PCB_TABLECELL::GetShownText(), SCH_TABLECELL::GetShownText(), SCH_TEXTBOX::GetShownText(), GetTextBox(), GetTextThicknessProperty(), ALTIUM_PCB::HelperSetTextAlignmentAndPos(), FEATURES_MANAGER::InitFeatureList(), SCH_FIELD::Plot(), SCH_LABEL_BASE::Plot(), SCH_TEXT::Plot(), SCH_TEXTBOX::Plot(), BRDITEMS_PLOTTER::PlotText(), printOneLineOfText(), SetAutoThickness(), PCB_TEXT::TextHitTest(), PCB_TEXT::TransformTextToPolySet(), PCB_TEXTBOX::TransformTextToPolySet(), PCB_DIM_ALIGNED::updateGeometry(), PCB_DIM_LEADER::updateGeometry(), PCB_DIM_ORTHOGONAL::updateGeometry(), PCB_DIM_RADIAL::updateGeometry(), PCB_DIM_ALIGNED::updateText(), and PCB_DIM_ORTHOGONAL::updateText().

◆ GetEffectiveTextShape()

std::shared_ptr< SHAPE_COMPOUND > EDA_TEXT::GetEffectiveTextShape ( bool aTriangulate = true,
const BOX2I & aBBox = BOX2I(),
const EDA_ANGLE & aAngle = ANGLE_0 ) const

◆ GetFont()

◆ getFontMetrics()

const KIFONT::METRICS & EDA_TEXT::getFontMetrics ( ) const
protectedvirtual

◆ GetFontName()

wxString EDA_TEXT::GetFontName ( ) const

Definition at line 1045 of file eda_text.cpp.

References GetFont(), and KIFONT::FONT::GetName().

Referenced by Compare(), and IsDefaultFormatting().

◆ GetFontProp()

wxString EDA_TEXT::GetFontProp ( ) const

Definition at line 1054 of file eda_text.cpp.

References _, GetFont(), IsEeschemaType(), and KICAD_FONT_NAME.

Referenced by EDA_TEXT_DESC::EDA_TEXT_DESC().

◆ GetHorizJustify()

GR_TEXT_H_ALIGN_T EDA_TEXT::GetHorizJustify ( ) const
inline

Definition at line 221 of file eda_text.h.

References m_attributes.

Referenced by AdjustFieldForSymbolOrientation(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_EDIT_TOOL::ChangeTextType(), SCH_TEXTBOX::compare(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), KIGFX::PCB_PAINTER::draw(), SCH_DRAWING_TOOLS::DrawShape(), EDA_TEXT_DESC::EDA_TEXT_DESC(), AUTOPLACER::fieldHPlacement(), FlipHJustify(), Format(), PCB_TEXTBOX::GetDrawPos(), SCH_TEXTBOX::GetDrawPos(), SCH_FIELD::GetEffectiveHorizJustify(), SCH_FIELD::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_LABEL_BASE::GetSpinStyle(), GetTextBox(), hash_fp_item(), IsDefaultFormatting(), SCH_FIELD::IsHorizJustifyFlipped(), AUTOPLACER::justifyField(), PCB_TEXT::KeepUpright(), SCH_IO_EAGLE::loadFieldAttributes(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), SIM_MODEL::MigrateSimModel(), PCB_TEXT::Mirror(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_TEXT::MirrorHorizontally(), SCH_TEXTBOX::MirrorHorizontally(), SCH_TEXT::MirrorVertically(), SCH_TEXTBOX::MirrorVertically(), SCH_TEXT::NormalizeJustification(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_FIELD::Plot(), positioningChanged(), positioningChanged(), printOneLineOfText(), processTextItem(), SCH_FIELD::Rotate(), SCH_IO_KICAD_LEGACY::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText(), Serialize(), PCB_TEXTBOX::Serialize(), SCH_TEXTBOX::Serialize(), SCH_EDIT_TOOL::Swap(), and swapFieldPositionsWithMatching().

◆ GetHyperlink()

◆ GetInterline()

int EDA_TEXT::GetInterline ( const RENDER_SETTINGS * aSettings) const

Return the distance between two lines of text.

Calculates the distance (pitch) between two lines of text. This distance includes the interline distance plus room for characters like j, {, and [. It also used for single line text, to calculate the text bounding box.

Definition at line 767 of file eda_text.cpp.

References GetDrawFont(), getFontMetrics(), GetInterline(), GetTextHeight(), and KiROUND().

Referenced by CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), GetInterline(), GetLinePositions(), and SCH_TEXT::Plot().

◆ GetLinePositions()

void EDA_TEXT::GetLinePositions ( const RENDER_SETTINGS * aSettings,
std::vector< VECTOR2I > & aPositions,
int aLineCount ) const

Populate aPositions with the position of each line of a multiline text, according to the vertical justification and the rotation of the whole text.

Parameters
aPositionsis the list to populate by the VECTOR2I positions.
aLineCountis the number of lines (not recalculated here for efficiency reasons.

Definition at line 943 of file eda_text.cpp.

References GetDrawPos(), GetDrawRotation(), GetInterline(), GetVertJustify(), GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_INDETERMINATE, GR_TEXT_V_ALIGN_TOP, RotatePoint(), and VECTOR2< T >::y.

Referenced by FEATURES_MANAGER::InitFeatureList(), SCH_TEXT::Plot(), SCH_TEXTBOX::Plot(), BRDITEMS_PLOTTER::PlotText(), and Print().

◆ GetLineSpacing()

double EDA_TEXT::GetLineSpacing ( ) const
inline

◆ GetRenderCache()

◆ GetShownText()

virtual wxString EDA_TEXT::GetShownText ( bool aAllowExtraText,
int aDepth = 0 ) const
inlinevirtual

Return the string actually shown after processing of the base text.

Parameters
aAllowExtraTextis true to allow adding more text than the initial expanded text, for intance a title, a prefix for texts in display functions. False to disable any added text (for instance when writing the shown text in netlists).
aDepthis used to prevent infinite recursions and loops when expanding text variables.

Reimplemented in PCB_FIELD, PCB_TABLECELL, PCB_TEXT, PCB_TEXTBOX, SCH_FIELD, SCH_LABEL_BASE, SCH_TABLECELL, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 121 of file eda_text.h.

References m_shown_text.

Referenced by BOARD_ADAPTER::addText(), PCB_IO_IPC2581::addText(), SCH_LABEL_BASE::cacheShownText(), LABEL_BBOX_FIXTURE::CheckTextBoundingBoxWidth(), containsURL(), KIGFX::DS_PAINTER::draw(), PCB_IO_KICAD_SEXPR::formatRenderCache(), PCB_IO_IPC2581::generateLayerSetNet(), DS_DRAW_ITEM_TEXT::GetApproxBBox(), GetEffectiveTextShape(), DS_DRAW_ITEM_TEXT::GetItemDescription(), PCB_TABLECELL::GetShownText(), PCB_TEXT::GetShownText(), PCB_TEXTBOX::GetShownText(), SCH_LABEL_BASE::GetShownText(), SCH_TABLECELL::GetShownText(), SCH_TEXT::GetShownText(), SCH_TEXTBOX::GetShownText(), GetTextBox(), SCH_FIELD::getUnescapedText(), FEATURES_MANAGER::InitFeatureList(), BRDITEMS_PLOTTER::PlotText(), Print(), and SCH_LABEL_BASE::SCH_LABEL_BASE().

◆ GetText()

virtual const wxString & EDA_TEXT::GetText ( ) const
inlinevirtual

Return the string associated with the text object.

Returns
a const wxString reference containing the string of the item.

Reimplemented in SCH_FIELD.

Definition at line 110 of file eda_text.h.

References m_text.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextCodeIfExists(), SCH_EDIT_FRAME::AutoRotateItem(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), SCH_EDIT_TOOL::ChangeTextType(), SCH_SHEET::CleanupSheet(), SCH_TEXT::compare(), SCH_TEXTBOX::compare(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), MULTICHANNEL_TOOL::copyRuleAreaContents(), SCH_IO_ALTIUM::CreateAliases(), SCH_DRAWING_TOOLS::createNewSheetPinFromLabel(), KIGFX::SCH_PAINTER::draw(), EDA_TEXT_DESC::EDA_TEXT_DESC(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), FormatProbeItem(), PCB_IO_IPC2581::generateComponents(), getFieldFunc(), GetFootprintDocumentationURL(), DS_DRAW_ITEM_TEXT::GetItemDescription(), PCB_DIMENSION_BASE::GetItemDescription(), PCB_FIELD::GetItemDescription(), PCB_TEXT::GetItemDescription(), PCB_TEXTBOX::GetItemDescription(), SCH_GLOBALLABEL::GetItemDescription(), SCH_HIERLABEL::GetItemDescription(), SCH_LABEL::GetItemDescription(), SCH_SHEET_PIN::GetItemDescription(), SCH_TEXT::GetItemDescription(), SCH_TEXTBOX::GetItemDescription(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet(), PCB_TEXTBOX::GetMinSize(), SCH_TEXTBOX::GetMinSize(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_TABLECELL::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), SCH_LABEL_BASE::GetMsgPanelInfo(), SCH_TABLECELL::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_TEXTBOX::GetMsgPanelInfo(), GetNetNavigatorItemText(), FOOTPRINT::GetReference(), PCB_FIELD::GetShownText(), SCH_LABEL_BASE::GetShownText(), SCH_TEXT::GetShownText(), PCB_FOOTPRINT_FIELD_PROPERTY::getter(), SCH_FIELD::GetText(), FOOTPRINT::GetValue(), PCB_FIELDS_GRID_TABLE::GetValue(), SCH_SHEET_PIN::HasConnectivityChanges(), hash_fp_item(), DIPTRACE_SCH_IMPORT_FIXTURE::HasLabelOnSheet(), DIPTRACE_SCH_IMPORT_FIXTURE::HasLabelStartingWithOnSheet(), SCH_SHEET::HasUndefinedPins(), SCH_DRAWING_TOOLS::importHierLabels(), SCH_TOOL_BASE< T >::Increment(), SCH_LABEL_BASE::IncrementLabel(), DIPTRACE_SCH_IMPORT_FIXTURE::LabelConnectsToWireOnSheet(), Levenshtein(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), SCH_IO_EAGLE::loadSegments(), PCB_TEXT::Matches(), PCB_TEXTBOX::Matches(), SCH_LABEL_BASE::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_TEXTBOX::Matches(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), FOOTPRINT::cmp_drawings::operator()(), std::hash< EDA_TEXT >::operator()(), SCH_TEXT::operator<(), SCH_TEXTBOX::operator<(), operator<<(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), PCB_FIELD::PCB_FIELD(), processTextItem(), CONNECTION_GRAPH::RebuildNetChains(), CLIPBOARD_IO::SaveSelection(), SCH_IO_KICAD_LEGACY::saveText(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText(), SCH_IO_KICAD_SEXPR::saveText(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveText(), SCH_IO_KICAD_SEXPR::saveTextBox(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox(), Serialize(), PCB_TEXTBOX::Serialize(), SCH_TEXTBOX::Serialize(), SCH_MARKER::SerializeToString(), SCH_LABEL_BASE::SetLabelShape(), SCH_IO_LTSPICE_PARSER::setTextJustification(), SCH_EDIT_TOOL::SwapPinLabels(), SCH_EDIT_TOOL::SwapUnitLabels(), PNS_KICAD_IFACE_BASE::syncDimension(), ERC_TESTER::TestTextVars(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), DIALOG_TABLE_PROPERTIES::TransferDataToWindow(), PANEL_SYNC_SHEET_PINS::UpdateForms(), PCB_DIM_LEADER::updateGeometry(), and PCB_TEXT::ViewGetLOD().

◆ GetTextAngle()

virtual EDA_ANGLE EDA_TEXT::GetTextAngle ( ) const
inlinevirtual

Reimplemented in PCB_TEXT, and PCB_TEXTBOX.

Definition at line 168 of file eda_text.h.

References m_attributes.

Referenced by AdjustFieldForSymbolOrientation(), AdjustTextForSymbolOrientation(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_EDIT_TOOL::ChangeTextType(), SCH_TEXTBOX::compare(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), KIGFX::SCH_PAINTER::draw(), SCH_TABLE::DrawBorders(), SCH_DRAWING_TOOLS::DrawShape(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), SCH_LABEL::GetBodyBoundingBox(), SCH_FIELD::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), SCH_TEXTBOX::GetDrawPos(), GetDrawRotation(), SCH_FIELD::GetDrawRotation(), SCH_TEXTBOX::GetMinSize(), SCH_TABLECELL::GetShownText(), SCH_TEXTBOX::GetShownText(), SCH_LABEL_BASE::GetSpinStyle(), FIELDS_GRID_TABLE::GetValue(), SCH_SELECTION_TOOL::GuessSelectionCandidates(), SCH_EDIT_TOOL::JustifyText(), SCH_IO_EAGLE::loadFieldAttributes(), SCH_TEXT::MirrorHorizontally(), SCH_TEXTBOX::MirrorHorizontally(), SCH_TEXT::MirrorSpinStyle(), SCH_TEXT::MirrorVertically(), SCH_TEXTBOX::MirrorVertically(), SCH_TABLE::Normalize(), SCH_TEXT::NormalizeJustification(), SCH_FIELD::Plot(), SCH_TEXT::Plot(), SCH_TEXTBOX::Plot(), SCH_SYMBOL::PlotLocalPowerIconShape(), positioningChanged(), positioningChanged(), SCH_EDIT_TOOL::Rotate(), SCH_FIELD::Rotate(), SCH_TEXTBOX::Rotate(), SCH_TEXT::Rotate90(), SCH_TEXTBOX::Rotate90(), SCH_IO_KICAD_LEGACY::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField(), SCH_IO_KICAD_SEXPR::saveField(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText(), SCH_IO_KICAD_SEXPR::saveText(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveText(), SCH_IO_KICAD_SEXPR::saveTextBox(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox(), SimulateRenderTransform(), swapFieldPositionsWithMatching(), EASYEDA_PARSER_BASE::TransformTextToBaseline(), DIALOG_FIELD_PROPERTIES::UpdateField(), and DIPTRACE_SCH_IMPORT_FIXTURE::ValueFieldAngleDegrees().

◆ GetTextAngleDegrees()

double EDA_TEXT::GetTextAngleDegrees ( ) const
inline

◆ GetTextBox()

BOX2I EDA_TEXT::GetTextBox ( const RENDER_SETTINGS * aSettings,
int aLine = -1 ) const

Useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....)

Parameters
aLineThe line of text to consider. Pass -1 for all lines.
Returns
the rect containing the line of text (i.e. the position and the size of one line) this rectangle is calculated for 0 orient text. If orientation is not 0 the rect must be rotated to match the physical area

Definition at line 773 of file eda_text.cpp.

References GetDrawFont(), GetDrawPos(), GetEffectiveTextPenWidth(), getFontMetrics(), BOX2< Vec >::GetHeight(), GetHorizJustify(), KIFONT::FONT::GetInterline(), GetShownText(), GetTextSize(), GetVertJustify(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_INDETERMINATE, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_INDETERMINATE, GR_TEXT_V_ALIGN_TOP, IsBold(), IsItalic(), IsMirrored(), IsMultilineAllowed(), KIFONT::FONT::IsStroke(), ITALIC_TILT, KiROUND(), m_bbox_cache, m_bbox_cacheMutex, BOX2< Vec >::Normalize(), BOX2< Vec >::Offset(), BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), BOX2< Vec >::SetX(), BOX2< Vec >::SetY(), KIFONT::FONT::StringBoundaryLimits(), text, wxStringSplit(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), LABEL_BBOX_FIXTURE::CheckLabelBodyBoundingBox(), LABEL_BBOX_FIXTURE::CheckTextBoundingBoxWidth(), SCH_GLOBALLABEL::CreateGraphicShape(), KIGFX::PCB_PAINTER::draw(), SCH_HIERLABEL::GetBodyBoundingBox(), SCH_LABEL::GetBodyBoundingBox(), DS_DRAW_ITEM_TEXT::GetBoundingBox(), PCB_DIMENSION_BASE::GetBoundingBox(), PCB_TEXT::GetBoundingBox(), SCH_FIELD::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), PCB_TEXTBOX::GetMinSize(), SCH_TEXTBOX::GetMinSize(), SCH_TEXT::GetOffsetToMatchSCH_FIELD(), ALTIUM_PCB::HelperSetTextAlignmentAndPos(), SCH_TEXT::NormalizeJustification(), TextHitTest(), TextHitTest(), PCB_TEXT::TextHitTest(), PCB_DIM_ALIGNED::updateGeometry(), PCB_DIM_LEADER::updateGeometry(), PCB_DIM_ORTHOGONAL::updateGeometry(), and PCB_DIM_RADIAL::updateGeometry().

◆ GetTextColor()

◆ GetTextHeight()

◆ GetTextPos()

virtual VECTOR2I EDA_TEXT::GetTextPos ( ) const
inlinevirtual

Reimplemented in PCB_TEXT.

Definition at line 294 of file eda_text.h.

References m_pos.

Referenced by PCB_IO_IPC2581::addText(), SCH_LABEL_BASE::AutoplaceFields(), SCH_FIELD::compare(), SCH_TEXT::compare(), SCH_SHEET_PIN::ConstrainOnEdge(), DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES(), SCH_GLOBALLABEL::doIsConnected(), SCH_HIERLABEL::doIsConnected(), SCH_LABEL::doIsConnected(), KIGFX::DS_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), PCB_TEXT::Flip(), DS_DRAW_ITEM_TEXT::GetApproxBBox(), SCH_HIERLABEL::GetBodyBoundingBox(), SCH_LABEL::GetBodyBoundingBox(), SCH_LABEL_BASE::GetBodyBoundingBox(), SCH_FIELD::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_LABEL_BASE::GetConnectionPoints(), GetDrawPos(), SCH_LABEL_BASE::GetEndPoints(), SCH_SHEET_PIN::GetEndPoints(), SCH_FIELD::GetLibPosition(), DS_DRAW_ITEM_TEXT::GetPosition(), SCH_FIELD::GetPosition(), SCH_TEXT::GetPosition(), PCB_TEXT::GetTextPos(), FIELDS_GRID_TABLE::GetValue(), FEATURES_MANAGER::InitFeatureList(), PCB_DIMENSION_BASE::Mirror(), SCH_DIRECTIVE_LABEL::MirrorHorizontally(), SCH_FIELD::MirrorHorizontally(), SCH_SHEET_PIN::MirrorHorizontally(), SCH_TEXT::MirrorHorizontally(), SCH_DIRECTIVE_LABEL::MirrorVertically(), SCH_FIELD::MirrorVertically(), SCH_SHEET_PIN::MirrorVertically(), SCH_TEXT::MirrorVertically(), SCH_TEXT::NormalizeJustification(), PCB_TEXT::Offset(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), std::hash< EDA_TEXT >::operator()(), SCH_FIELD::Plot(), SCH_LABEL_BASE::Plot(), BRDITEMS_PLOTTER::PlotText(), DIALOG_CHANGE_SYMBOLS::processSymbols(), SCH_LABEL_BASE::Rotate(), SCH_SHEET_PIN::Rotate(), SCH_TEXT::Rotate(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText(), Serialize(), PCB_TEXT::SetLibTextPos(), SCH_LABEL_BASE::SetPosition(), SetTextPos(), SetTextX(), SetTextY(), FIELDS_GRID_TABLE::SetValue(), EASYEDA_PARSER_BASE::TransformTextToBaseline(), and SCH_LABEL_BASE::UpdateDanglingState().

◆ GetTextSize()

◆ GetTextStyleName()

wxString EDA_TEXT::GetTextStyleName ( ) const
Returns
a wxString with the style name( Normal, Italic, Bold, Bold+Italic).

Definition at line 1029 of file eda_text.cpp.

References _, IsBold(), and IsItalic().

Referenced by SCH_FIELD::GetMsgPanelInfo().

◆ GetTextThickness()

◆ GetTextThicknessProperty()

int EDA_TEXT::GetTextThicknessProperty ( ) const
inline

◆ GetTextVarReferences()

const std::vector< TEXT_VAR_REF_KEY > & EDA_TEXT::GetTextVarReferences ( ) const

Return the set of ${...} references extracted from the source text.

The result is cached lazily and invalidated on SetText/CopyText/Replace. Consumers (the reactive dependency tracker) may call this at high frequency on items that rarely change; the cache avoids repeat lexing.

Definition at line 650 of file eda_text.cpp.

References m_text_var_refs.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetTextWidth()

◆ GetVertJustify()

◆ GotoPageHref()

wxString EDA_TEXT::GotoPageHref ( const wxString & aDestination)
static

Generate a href to a page in the current schematic.

Parameters
aDestinationDestination sheet's page number.
Returns
A hyperlink href string that goes to the specified page.

Definition at line 1335 of file eda_text.cpp.

Referenced by SCH_LABEL_BASE::Plot(), and SCH_SHEET::Plot().

◆ HasHyperlink()

◆ HasTextVars()

◆ IsBold()

◆ IsDefaultFormatting()

◆ IsGotoPageHref()

bool EDA_TEXT::IsGotoPageHref ( const wxString & aHref,
wxString * aDestination = nullptr )
static

Check if aHref is a valid internal hyperlink.

Parameters
aHrefString to validate
aDestination[optional] pointer to populate with the destination page
Returns
true if aHref is a valid internal hyperlink. Does not check if the destination page actually exists.

Definition at line 1329 of file eda_text.cpp.

Referenced by PDF_PLOTTER::endPlotEmitResources(), SCH_NAVIGATE_TOOL::HypertextCommand(), and ValidateHyperlink().

◆ IsItalic()

◆ IsKeepUpright()

◆ IsMirrored()

◆ IsMultilineAllowed()

bool EDA_TEXT::IsMultilineAllowed ( ) const
inline

◆ IsVisible()

virtual bool EDA_TEXT::IsVisible ( ) const
inlinevirtual

Definition at line 208 of file eda_text.h.

References m_visible.

Referenced by SCH_EDITOR_CONTROL::AssignFootprints(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), MULTICHANNEL_TOOL::copyRuleAreaContents(), EDIT_TOOL::DeleteItems(), DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawVia(), EDA_TEXT_DESC::EDA_TEXT_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::EditProperties(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_IPC2581::generateLayerSetNet(), LIB_SYMBOL::GetFields(), PCB_SHAPE::getHatchingKnockouts(), SCH_FIELD::GetMsgPanelInfo(), FIELDS_GRID_TABLE::GetValue(), FIELDS_GRID_TABLE::GetValueAsBool(), PCB_FIELDS_GRID_TABLE::GetValueAsBool(), SCH_FIELD::HasSameContent(), SCH_FIELD::ImportValues(), FEATURES_MANAGER::InitFeatureList(), DRC_RTREE::Insert(), GENERAL_COLLECTOR::Inspect(), PCB_FIELD::Matches(), SCH_FIELD::Matches(), SIM_MODEL::MigrateSimModel(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), PCB_FIELD::PCB_FIELD(), SCH_FIELD::Plot(), SCH_TEXT::Plot(), LIB_SYMBOL::PlotFields(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), DIALOG_CHANGE_SYMBOLS::processSymbols(), processTextItem(), SCH_IO_KICAD_LEGACY::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField(), SCH_IO_KICAD_SEXPR::saveField(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText(), PCB_SELECTION_TOOL::Selectable(), SCH_SELECTION_TOOL::Selectable(), PCB_FIELD::Serialize(), SCH_FIELD::Serialize(), PNS_KICAD_IFACE_BASE::syncDimension(), PNS_KICAD_IFACE_BASE::syncTextItem(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ Levenshtein()

double EDA_TEXT::Levenshtein ( const EDA_TEXT & aOther) const

Return the levenstein distance between two texts.

Return a value of 0.0 - 1.0 where 1.0 is a perfect match.

Definition at line 1268 of file eda_text.cpp.

References distance(), EDA_TEXT(), and GetText().

Referenced by Similarity().

◆ MapHorizJustify()

◆ MapVertJustify()

◆ Offset()

◆ operator<()

bool EDA_TEXT::operator< ( const EDA_TEXT & aRhs) const
inline

Definition at line 420 of file eda_text.h.

References Compare(), and EDA_TEXT().

◆ operator=()

◆ operator==()

◆ operator>()

bool EDA_TEXT::operator> ( const EDA_TEXT & aRhs) const
inline

Definition at line 421 of file eda_text.h.

References Compare(), and EDA_TEXT().

◆ Print()

void EDA_TEXT::Print ( const RENDER_SETTINGS * aSettings,
const VECTOR2I & aOffset,
const COLOR4D & aColor )

Print this text object to the device context aDC.

Parameters
aDCthe current Device Context.
aOffsetdraw offset (usually (0,0)).
aColortext color.

Definition at line 921 of file eda_text.cpp.

References GetDrawPos(), GetLinePositions(), GetShownText(), IsMultilineAllowed(), printOneLineOfText(), and wxStringSplit().

Referenced by DS_DRAW_ITEM_TEXT::PrintWsItem().

◆ printOneLineOfText()

void EDA_TEXT::printOneLineOfText ( const RENDER_SETTINGS * aSettings,
const VECTOR2I & aOffset,
const COLOR4D & aColor,
const wxString & aText,
const VECTOR2I & aPos )
protected

Print each line of this EDA_TEXT.

Parameters
aOffsetdraw offset (usually (0,0)).
aColortext color.
aTextthe single line of text to draw.
aPosthe position of this line ).

Definition at line 988 of file eda_text.cpp.

References KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), GetDrawFont(), GetDrawRotation(), GetEffectiveTextPenWidth(), getFontMetrics(), GetHorizJustify(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GetTextSize(), GetVertJustify(), GRPrintText(), IsBold(), IsItalic(), IsMirrored(), and VECTOR2< T >::x.

Referenced by Print().

◆ RemoveHyperlink()

void EDA_TEXT::RemoveHyperlink ( )
inline

Definition at line 426 of file eda_text.h.

References m_hyperlink.

◆ Replace()

bool EDA_TEXT::Replace ( const EDA_SEARCH_DATA & aSearchData)

Helper function used in search and replace dialog.

Perform a text replace using the find and replace criteria in aSearchData.

Parameters
aSearchDataA reference to a EDA_SEARCH_DATA object containing the search and replace criteria.
Returns
True if the text item was modified, otherwise false.

Definition at line 482 of file eda_text.cpp.

References cacheShownText(), ClearBoundingBoxCache(), ClearRenderCache(), m_text, and EDA_ITEM::Replace().

Referenced by SCH_FIELD::Replace(), SCH_LABEL_BASE::Replace(), SCH_SHEET_PIN::Replace(), SCH_TEXT::Replace(), and SCH_TEXTBOX::Replace().

◆ ResolveFont()

bool EDA_TEXT::ResolveFont ( const std::vector< wxString > * aEmbeddedFonts)

◆ Serialize() [1/2]

void EDA_TEXT::Serialize ( google::protobuf::Any & aContainer) const
overridevirtual

Serializes this object to the given Any message.

The Any message's concrete type will be specific to the object in question.

Parameters
aContainerwill be filled with a message describing this object

Reimplemented from SERIALIZABLE.

Reimplemented in PCB_DIM_ALIGNED, PCB_DIM_CENTER, PCB_DIM_LEADER, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIMENSION_BASE, PCB_FIELD, PCB_TEXT, PCB_TEXTBOX, SCH_DIRECTIVE_LABEL, SCH_FIELD, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LABEL, SCH_SHEET_PIN, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 165 of file eda_text.cpp.

References pcbIUScale, and Serialize().

Referenced by Serialize(), PCB_DIMENSION_BASE::Serialize(), PCB_TEXT::Serialize(), SCH_FIELD::Serialize(), SCH_GLOBALLABEL::Serialize(), SCH_SHEET_PIN::Serialize(), and SCH_TEXT::Serialize().

◆ Serialize() [2/2]

◆ SetActiveUrl()

void EDA_TEXT::SetActiveUrl ( const wxString & aUrl) const
inline

Definition at line 299 of file eda_text.h.

References m_activeUrl.

Referenced by KIGFX::SCH_PAINTER::draw(), and KIGFX::SCH_PAINTER::draw().

◆ SetAttributes() [1/2]

◆ SetAttributes() [2/2]

void EDA_TEXT::SetAttributes ( const TEXT_ATTRIBUTES & aTextAttrs)
inline

Definition at line 251 of file eda_text.h.

References m_attributes.

◆ SetAutoThickness()

void EDA_TEXT::SetAutoThickness ( bool aAuto)

◆ SetBold()

◆ SetBoldFlag()

void EDA_TEXT::SetBoldFlag ( bool aBold)

◆ SetFont()

◆ SetFontProp()

void EDA_TEXT::SetFontProp ( const wxString & aFontName)

◆ SetHorizJustify()

void EDA_TEXT::SetHorizJustify ( GR_TEXT_H_ALIGN_T aType)

Definition at line 404 of file eda_text.cpp.

References ClearBoundingBoxCache(), ClearRenderCache(), and m_attributes.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), SCH_IO_ALTIUM::AddLibTextBox(), SCH_IO_ALTIUM::AddTextBox(), AdjustFieldForSymbolOrientation(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::ApplyFieldSettings(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), SCH_SHEET::AutoplaceFields(), FOOTPRINT::AutoPositionFields(), Build_Board_Stackup_Table(), SCH_IO_ALTIUM::CreateAliases(), SCH_DRAWING_TOOLS::createNewText(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), createSchText(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), SCH_DRAWING_TOOLS::DrawShape(), EaglePcbTextToKiCadAlignment(), eagleToKicadAlignment(), EDA_TEXT_DESC::EDA_TEXT_DESC(), FlipHJustify(), ALTIUM_PCB::HelperSetTextAlignmentAndPos(), ALTIUM_PCB::HelperSetTextboxAlignmentAndPos(), AUTOPLACER::justifyField(), PCB_TEXT::KeepUpright(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_EAGLE::loadFieldAttributes(), PCB_IO_PADS::loadFootprints(), SCH_IO_EAGLE::loadFrame(), PCB_IO_KICAD_LEGACY::loadMODULE_TEXT(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_KICAD_LEGACY::loadSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), PCB_TEXT::Mirror(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_TEXT::MirrorHorizontally(), SCH_TEXTBOX::MirrorHorizontally(), SCH_TEXT::MirrorVertically(), SCH_TEXTBOX::MirrorVertically(), PCB_IO_EAGLE::orientFPText(), PCB_IO_EAGLE::packageText(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_ALTIUM::ParsePowerPort(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_TEXTBOX::PCB_TEXTBOX(), SCH_FIELD::Rotate(), SCH_TEXTBOX::SCH_TEXTBOX(), SCH_FIELD::SetEffectiveHorizJustify(), SCH_LABEL_BASE::SetSpinStyle(), SCH_IO_LTSPICE_PARSER::setTextJustification(), PCAD2KICAD::SetTextJustify(), FABMASTER::setupText(), FIELDS_GRID_TABLE::SetValue(), SCH_EDIT_TOOL::Swap(), swapFieldPositionsWithMatching(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_FIELD_PROPERTIES::UpdateField(), and DIALOG_FIELD_PROPERTIES::UpdateField().

◆ SetHyperlink()

void EDA_TEXT::SetHyperlink ( wxString aLink)
inline

◆ SetItalic()

void EDA_TEXT::SetItalic ( bool aItalic)

◆ SetItalicFlag()

void EDA_TEXT::SetItalicFlag ( bool aItalic)

Set only the italic flag, without changing the font.

Used when bulk-changing text attributes (e.g. from a dialog or import).

Definition at line 322 of file eda_text.cpp.

References ClearBoundingBoxCache(), ClearRenderCache(), and m_attributes.

Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), and SetItalic().

◆ SetKeepUpright()

◆ SetLineSpacing()

void EDA_TEXT::SetLineSpacing ( double aLineSpacing)

◆ SetMirrored()

◆ SetMultilineAllowed()

void EDA_TEXT::SetMultilineAllowed ( bool aAllow)
Parameters
aAllowtrue if ok to use multiline option, false if ok to use only single line text. (Single line is faster in calculations than multiline.)

Definition at line 396 of file eda_text.cpp.

References ClearBoundingBoxCache(), ClearRenderCache(), and m_attributes.

Referenced by BOOST_AUTO_TEST_CASE(), SCH_IO_LTSPICE_PARSER::CreateSCH_TEXT(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef(), PCB_TEXT::PCB_TEXT(), PCB_TEXTBOX::PCB_TEXTBOX(), SCH_LABEL_BASE::SCH_LABEL_BASE(), SCH_LABEL_BASE::SCH_LABEL_BASE(), SCH_TEXT::SCH_TEXT(), and SCH_TEXTBOX::SCH_TEXTBOX().

◆ SetText()

void EDA_TEXT::SetText ( const wxString & aText)
virtual

Reimplemented in SCH_FIELD.

Definition at line 265 of file eda_text.cpp.

References cacheShownText(), and m_text.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), SCH_IO_EAGLE::addImplicitConnections(), SCH_IO_ALTIUM::AddLibTextBox(), SCH_IO_ALTIUM::AddTextBox(), PCAD2KICAD::PCAD_FOOTPRINT::AddToBoard(), PCAD2KICAD::PCAD_TEXT::AddToBoard(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextCodeIfExists(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), Build_Board_Characteristics_Table(), Build_Board_Stackup_Table(), buildCoincidentFootprint(), ALLEGRO::BOARD_BUILDER::buildFootprint(), buildLibTable(), PCB_EDIT_TABLE_TOOL::copyCell(), SCH_EDIT_TABLE_TOOL::copyCell(), SCH_IO_ALTIUM::CreateAliases(), SPRINT_LAYOUT_PARSER::CreateBoard(), createBoard(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewLabel(), SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL(), Deserialize(), PCB_TEXTBOX::Deserialize(), SCH_TEXTBOX::Deserialize(), KIGFX::SCH_PAINTER::draw(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), FOOTPRINT::DuplicateItem(), EDA_TEXT_DESC::EDA_TEXT_DESC(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), PCB_IO_EASYEDAPRO::FootprintLoad(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), SCH_TOOL_BASE< T >::Increment(), SCH_LABEL_BASE::IncrementLabel(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), PCB_IO_PADS::loadFootprints(), SCH_IO_EAGLE::loadFrame(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), PCB_IO_KICAD_LEGACY::loadMODULE_TEXT(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), PCB_IO_EAGLE::loadPlain(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef(), PCB_IO_PADS::loadTestPoints(), PCB_IO_EAGLE::orientFPText(), PCB_IO_EAGLE::packageText(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), PCB_IO_EASYEDAPRO_PARSER::ParseFootprint(), PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked(), SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBoxContent(), SCH_IO_ALTIUM::ParseSheetEntry(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_IO_KICAD_SEXPR_PARSER::parseTextBoxContent(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), PCB_FIELD::PCB_FIELD(), processTextItem(), CLIPBOARD_IO::SaveSelection(), SCH_FIELD::SetName(), FOOTPRINT::SetReference(), PCB_FOOTPRINT_FIELD_PROPERTY::setter(), SCH_FIELD::SetText(), FABMASTER::setupText(), FOOTPRINT::SetValue(), PCB_FIELDS_GRID_TABLE::SetValue(), SCH_EDIT_TOOL::SwapPinLabels(), SCH_EDIT_TOOL::SwapUnitLabels(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_TABLE_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), BOARD_NETLIST_UPDATER::updateFootprintParameters(), and PCB_DIMENSION_BASE::updateText().

◆ SetTextAngle()

void EDA_TEXT::SetTextAngle ( const EDA_ANGLE & aAngle)
virtual

◆ SetTextAngleDegrees()

◆ SetTextColor()

◆ SetTextHeight()

◆ SetTextPos()

void EDA_TEXT::SetTextPos ( const VECTOR2I & aPoint)
virtual

Definition at line 576 of file eda_text.cpp.

References GetTextPos(), Offset(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCAD2KICAD::PCAD_TEXT::AddToBoard(), BACK_ANNOTATE::applyChangelist(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), CADSTAR_SCH_ARCHIVE_LOADER::applyToLibraryFieldAttribute(), SCH_SHEET::AutoplaceFields(), SCH_FIELD::BeginEdit(), SCH_TEXT::BeginEdit(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), buildCoincidentFootprint(), SCH_FIELD::CalcEdit(), SCH_TEXT::CalcEdit(), SCH_EDIT_TOOL::ChangeTextType(), Deserialize(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), DRAWING_TOOL::DrawDimension(), DS_DRAW_ITEM_TEXT::DS_DRAW_ITEM_TEXT(), ALTIUM_PCB::HelperSetTextAlignmentAndPos(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), SCH_IO_EAGLE::loadFieldAttributes(), SCH_IO_EAGLE::loadInstance(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), PCB_IO_EAGLE::loadPlain(), SCH_IO_KICAD_LEGACY::loadSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), PCB_DIMENSION_BASE::Mirror(), SCH_TEXT::NormalizeJustification(), PCB_IO_EAGLE::orientFPText(), SCH_IO_ALTIUM::ParseLibParameter(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TEXT_effects(), SCH_IO_KICAD_SEXPR_PARSER::parseSchText(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_TEXT::PCB_TEXT(), DIALOG_CHANGE_SYMBOLS::processSymbols(), PCB_DIMENSION_BASE::Rotate(), PCB_TEXT::Rotate(), SCH_LABEL_BASE::Rotate(), SCH_SHEET_PIN::Rotate(), SCH_TEXT::Rotate(), SCH_SHEET_PIN::SCH_SHEET_PIN(), SCH_TEXT::SCH_TEXT(), DS_DRAW_ITEM_TEXT::SetPosition(), PCB_TEXT::SetPosition(), SCH_FIELD::SetPosition(), SCH_TEXT::SetPosition(), FABMASTER::setupText(), FIELDS_GRID_TABLE::SetValue(), EASYEDA_PARSER_BASE::TransformTextToBaseline(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_FIELD_PROPERTIES::UpdateField(), SCH_SYMBOL::UpdateFields(), PCB_DIM_ALIGNED::updateText(), PCB_DIM_CENTER::updateText(), and PCB_DIM_ORTHOGONAL::updateText().

◆ SetTextSize()

void EDA_TEXT::SetTextSize ( VECTOR2I aNewSize,
bool aEnforceMinTextSize = true )
virtual

Reimplemented in PCB_TEXT, and PCB_TEXTBOX.

Definition at line 532 of file eda_text.cpp.

References ClearBoundingBoxCache(), ClearRenderCache(), m_attributes, m_IuScale, TEXT_MAX_SIZE_MM, TEXT_MIN_SIZE_MM, unityScale, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_IO_EAGLE::addImplicitConnections(), SCH_IO_ALTIUM::AddLibTextBox(), SCH_IO_ALTIUM::AddTextBox(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::ApplyFieldSettings(), CADSTAR_PCB_ARCHIVE_LOADER::applyTextCode(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::BuildMultiUnitConnectorSymbol(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::BuildMultiUnitSymbol(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::BuildSymbol(), SCH_EDIT_TOOL::ChangeTextType(), ALTIUM_PCB::ConvertTexts6ToEdaTextSettings(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::CreateCustomFields(), SCH_IO_LTSPICE_PARSER::CreateFields(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::CreateNetLabel(), SCH_DRAWING_TOOLS::createNewLabel(), SCH_DRAWING_TOOLS::createNewText(), SCH_IO_LTSPICE_PARSER::CreatePowerSymbol(), SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL(), SCH_IO_LTSPICE_PARSER::CreateSCH_TEXT(), createSchText(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), SCH_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawTable(), DS_DRAW_ITEM_TEXT::DS_DRAW_ITEM_TEXT(), EDA_TEXT(), SCH_IO_GEDA::flushPendingComponent(), PCB_IO_KICAD_SEXPR::format(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::GetOrCreateConnectorPinSymbol(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::GetOrCreatePartTypeSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::getScaledLibPart(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_EAGLE::loadFieldAttributes(), SCH_IO_EAGLE::loadFrame(), SCH_IO_EAGLE::loadInstance(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), SCH_IO_PADS::LoadSchematicFile(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_IO_KICAD_LEGACY::loadSheet(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), SCH_IO_EAGLE::loadTextAttributes(), DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_ALTIUM::ParseLabel(), SCH_IO_ALTIUM::ParseLibDesignator(), SCH_IO_ALTIUM::ParseLibParameter(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), BACK_ANNOTATE::processNetNameChange(), SCH_FIELD::SCH_FIELD(), PCB_TEXT::SetLibTextSize(), SCH_FIELD::SetSchTextSize(), SCH_TEXT::SetSchTextSize(), SCH_TEXTBOX::SetSchTextSize(), PCB_TEXT::SetTextSize(), PCB_TEXTBOX::SetTextSize(), PCAD2KICAD::SetTextSizeFromStrokeFontHeight(), PCAD2KICAD::SetTextSizeFromTrueTypeFontHeight(), FIELDS_GRID_TABLE::SetValue(), SCH_DRAWING_TOOLS::TwoClickPlace(), and DIALOG_FIELD_PROPERTIES::updateText().

◆ SetTextThickness()

◆ SetTextWidth()

◆ SetTextX()

◆ SetTextY()

◆ SetUnresolvedFontName()

void EDA_TEXT::SetUnresolvedFontName ( const wxString & aFontName)
inline

◆ SetupRenderCache()

void EDA_TEXT::SetupRenderCache ( const wxString & aResolvedText,
const KIFONT::FONT * aFont,
const EDA_ANGLE & aAngle,
const VECTOR2I & aOffset )

Definition at line 742 of file eda_text.cpp.

References IsMirrored(), and m_render_cache.

◆ SetVertJustify()

void EDA_TEXT::SetVertJustify ( GR_TEXT_V_ALIGN_T aType)

Definition at line 412 of file eda_text.cpp.

References ClearBoundingBoxCache(), ClearRenderCache(), and m_attributes.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), AdjustTextForSymbolOrientation(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::ApplyFieldSettings(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), SCH_SHEET::AutoplaceFields(), FOOTPRINT::AutoPositionFields(), SCH_IO_ALTIUM::CreateAliases(), SCH_DRAWING_TOOLS::createNewText(), createSchText(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), SCH_DRAWING_TOOLS::DrawShape(), EaglePcbTextToKiCadAlignment(), eagleToKicadAlignment(), EDA_TEXT_DESC::EDA_TEXT_DESC(), ALTIUM_PCB::HelperSetTextAlignmentAndPos(), ALTIUM_PCB::HelperSetTextboxAlignmentAndPos(), AUTOPLACER::justifyField(), PCB_TEXT::KeepUpright(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_EAGLE::loadFieldAttributes(), PCB_IO_PADS::loadFootprints(), SCH_IO_EAGLE::loadFrame(), PCB_IO_KICAD_LEGACY::loadMODULE_TEXT(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_KICAD_LEGACY::loadSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), SCH_EDIT_TOOL::Mirror(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_TEXT::MirrorHorizontally(), SCH_TEXT::MirrorVertically(), PCB_IO_EAGLE::orientFPText(), PCB_IO_EAGLE::packageText(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_TEXTBOX::PCB_TEXTBOX(), SCH_GLOBALLABEL::SCH_GLOBALLABEL(), SCH_TEXTBOX::SCH_TEXTBOX(), SCH_FIELD::SetEffectiveVertJustify(), SCH_GLOBALLABEL::SetSpinStyle(), SCH_HIERLABEL::SetSpinStyle(), SCH_LABEL_BASE::SetSpinStyle(), SCH_IO_LTSPICE_PARSER::setTextJustification(), PCAD2KICAD::SetTextJustify(), FABMASTER::setupText(), FIELDS_GRID_TABLE::SetValue(), SimulateRenderTransform(), SCH_EDIT_TOOL::Swap(), swapFieldPositionsWithMatching(), DIALOG_FIELD_PROPERTIES::UpdateField(), and DIALOG_FIELD_PROPERTIES::UpdateField().

◆ SetVisible()

void EDA_TEXT::SetVisible ( bool aVisible)
virtual

Definition at line 381 of file eda_text.cpp.

References ClearRenderCache(), and m_visible.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::addNewFieldToSymbol(), PCAD2KICAD::PCAD_FOOTPRINT::AddToBoard(), BACK_ANNOTATE::applyChangelist(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::ApplyFieldSettings(), SCH_EDITOR_CONTROL::AssignFootprints(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ALLEGRO::BOARD_BUILDER::buildFootprint(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::BuildKiCadPowerSymbol(), MULTICHANNEL_TOOL::copyRuleAreaContents(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::CreateCustomFields(), SCH_IO_LTSPICE_PARSER::CreateFields(), DIPTRACE::PCB_PARSER::CreateFootprint(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewLabel(), SCH_IO_LTSPICE_PARSER::CreatePowerSymbol(), SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL(), SCH_IO_LTSPICE_PARSER::CreateSCH_TEXT(), DIPTRACE::SCH_PARSER::createSymbolInstance(), EDIT_TOOL::DeleteItems(), PCB_FIELD::Deserialize(), SCH_FIELD::Deserialize(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), EDA_TEXT_DESC::EDA_TEXT_DESC(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), SCH_IO_GEDA::flushPendingComponent(), FOOTPRINT::FOOTPRINT(), PCB_IO_EASYEDA::FootprintLoad(), PCB_IO_EASYEDAPRO::FootprintLoad(), SCH_IO_EAGLE::getEagleSymbolFieldAttributes(), SCH_FIELD::ImportValues(), LIB_SYMBOL::LIB_SYMBOL(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), PCB_IO_EAGLE::loadElements(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), FABMASTER::loadFootprints(), PCB_IO_PADS::loadFootprints(), SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), PCB_IO_KICAD_LEGACY::loadMODULE_TEXT(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), SCH_IO_KICAD_LEGACY_LIB_CACHE::LoadPart(), PCB_IO_EAGLE::loadPlain(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_IO_EAGLE::loadSymbol(), SCH_IO_KICAD_LEGACY::loadSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymbolFieldAttribute(), SCH_IO_HTTP_LIB::loadSymbolFromPart(), SCH_IO_DATABASE::loadSymbolFromRow(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymbolGateAndPartFields(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef(), PCB_IO_PADS::loadTestPoints(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), SIM_MODEL::MigrateSimModel(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), DIALOG_LABEL_PROPERTIES::OnAddField(), DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField(), DIALOG_SHEET_PROPERTIES::OnAddField(), DIALOG_SYMBOL_PROPERTIES::OnAddField(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), SCH_IO_ALTIUM::ParseDesignator(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_ALTIUM::ParseFileName(), PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked(), SCH_IO_ALTIUM::ParseLibParameter(), SCH_IO_ALTIUM::ParseParameter(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TEXT_effects(), SCH_IO_ALTIUM::ParsePortHelper(), SCH_IO_ALTIUM::ParsePowerPort(), SCH_IO_KICAD_SEXPR_PARSER::parseSchText(), SCH_IO_ALTIUM::ParseSheetName(), SCH_EASYEDA_PARSER::ParseSymbol(), SCH_EASYEDAPRO_PARSER::ParseSymbol(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), PCB_FIELD::PCB_FIELD(), SCH_EDITOR_CONTROL::processCmpToFootprintLinkFile(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), SPRINT_LAYOUT_PARSER::processPad(), DIALOG_CHANGE_SYMBOLS::processSymbols(), processTextItem(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveDcmInfoAsFields(), SCH_FIELD::SCH_FIELD(), SCH_IO_LTSPICE_PARSER::setTextJustification(), FIELDS_GRID_TABLE::SetValue(), FIELDS_GRID_TABLE::SetValueAsBool(), PCB_FIELDS_GRID_TABLE::SetValueAsBool(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), SCH_SHEET_PATH::UpdateAllScreenReferences(), BOARD_NETLIST_UPDATER::updateFootprintParameters(), and DIALOG_FIELD_PROPERTIES::updateText().

◆ Similarity()

◆ SwapAttributes()

void EDA_TEXT::SwapAttributes ( EDA_TEXT & aTradingPartner)

Swap the text attributes of the two involved instances.

Definition at line 448 of file eda_text.cpp.

References ClearBoundingBoxCache(), ClearRenderCache(), EDA_TEXT(), m_attributes, and m_pos.

Referenced by SCH_FIELD::swapData(), SCH_TEXT::swapData(), and SCH_TEXTBOX::swapData().

◆ SwapText()

void EDA_TEXT::SwapText ( EDA_TEXT & aTradingPartner)

Definition at line 440 of file eda_text.cpp.

References cacheShownText(), EDA_TEXT(), and m_text.

Referenced by SCH_FIELD::swapData(), SCH_TEXT::swapData(), and SCH_TEXTBOX::swapData().

◆ TextHitTest() [1/2]

bool EDA_TEXT::TextHitTest ( const BOX2I & aRect,
bool aContains,
int aAccuracy = 0 ) const
virtual

Test if object bounding box is contained within or intersects aRect.

Parameters
aRectRect to test against.
aContainsTest for containment instead of intersection if true.
aAccuracyAmount to inflate the bounding box.
Returns
true if a hit, else false.

Reimplemented in PCB_TEXT.

Definition at line 910 of file eda_text.cpp.

References BOX2< Vec >::Contains(), GetDrawRotation(), BOX2< Vec >::GetInflated(), GetTextBox(), and BOX2< Vec >::Intersects().

◆ TextHitTest() [2/2]

bool EDA_TEXT::TextHitTest ( const VECTOR2I & aPoint,
int aAccuracy = 0 ) const
virtual

Test if aPoint is within the bounds of this object.

Parameters
aPointA VECTOR2I to test.
aAccuracyAmount to inflate the bounding box.
Returns
true if a hit, else false.

Reimplemented in PCB_TEXT.

Definition at line 902 of file eda_text.cpp.

References BOX2< Vec >::Contains(), GetDrawPos(), GetDrawRotation(), BOX2< Vec >::GetInflated(), GetRotated(), GetTextBox(), and location.

Referenced by DS_DRAW_ITEM_TEXT::HitTest(), DS_DRAW_ITEM_TEXT::HitTest(), and PCB_TEXT::TextHitTest().

◆ ValidateHyperlink()

bool EDA_TEXT::ValidateHyperlink ( const wxString & aURL)
static

Check if aURL is a valid hyperlink.

Parameters
aURLString to validate
Returns
true if aURL is a valid hyperlink

Definition at line 1258 of file eda_text.cpp.

References IsGotoPageHref().

Referenced by SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), and DIALOG_TEXT_PROPERTIES::TransferDataFromWindow().

Member Data Documentation

◆ m_activeUrl

wxString EDA_TEXT::m_activeUrl
mutableprotected

◆ m_attributes

◆ m_bbox_cache

std::map<int, BBOX_CACHE_ENTRY> EDA_TEXT::m_bbox_cache
mutableprivate

Definition at line 501 of file eda_text.h.

Referenced by ClearBoundingBoxCache(), EDA_TEXT(), GetTextBox(), and operator=().

◆ m_bbox_cacheMutex

std::mutex EDA_TEXT::m_bbox_cacheMutex
mutableprivate

Definition at line 502 of file eda_text.h.

Referenced by ClearBoundingBoxCache(), EDA_TEXT(), GetTextBox(), and operator=().

◆ m_hyperlink

wxString EDA_TEXT::m_hyperlink
protected

A hyperlink URL.

If empty, this text object is not a hyperlink.

Definition at line 476 of file eda_text.h.

Referenced by SCH_TEXT::DoHypertextAction(), SCH_TEXTBOX::DoHypertextAction(), GetHyperlink(), HasHyperlink(), RemoveHyperlink(), and SetHyperlink().

◆ m_IuScale

std::reference_wrapper<const EDA_IU_SCALE> EDA_TEXT::m_IuScale
private

Definition at line 491 of file eda_text.h.

Referenced by EDA_TEXT(), EDA_TEXT(), Format(), SetTextHeight(), SetTextSize(), and SetTextWidth().

◆ m_pos

VECTOR2I EDA_TEXT::m_pos
private

◆ m_render_cache

std::unique_ptr<EDA_TEXT_RENDER_CACHE_DATA> EDA_TEXT::m_render_cache
mutableprivate

◆ m_shown_text

wxString EDA_TEXT::m_shown_text
private

Definition at line 482 of file eda_text.h.

Referenced by cacheShownText(), EDA_TEXT(), GetShownText(), and operator=().

◆ m_shown_text_has_text_var_refs

bool EDA_TEXT::m_shown_text_has_text_var_refs = false
private

Definition at line 483 of file eda_text.h.

Referenced by cacheShownText(), EDA_TEXT(), HasTextVars(), and operator=().

◆ m_text

wxString EDA_TEXT::m_text
private

◆ m_text_var_refs

std::vector<TEXT_VAR_REF_KEY> EDA_TEXT::m_text_var_refs
private

Definition at line 489 of file eda_text.h.

Referenced by cacheShownText(), EDA_TEXT(), GetTextVarReferences(), and operator=().

◆ m_unresolvedFontName

wxString EDA_TEXT::m_unresolvedFontName
private

Definition at line 505 of file eda_text.h.

Referenced by EDA_TEXT(), operator=(), ResolveFont(), and SetUnresolvedFontName().

◆ m_visible

bool EDA_TEXT::m_visible
private

Definition at line 507 of file eda_text.h.

Referenced by EDA_TEXT(), EDA_TEXT(), IsVisible(), operator=(), and SetVisible().


The documentation for this class was generated from the following files: