KiCad PCB EDA Suite
EDA_TEXT Class Reference

Class EDA_TEXT is 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:
LIB_FIELD LIB_TEXT SCH_FIELD SCH_TEXT TEXTE_MODULE TEXTE_PCB WS_DRAW_ITEM_TEXT SCH_GLOBALLABEL SCH_HIERLABEL SCH_LABEL SCH_SHEET_PIN

Public Member Functions

 EDA_TEXT (const wxString &text=wxEmptyString)
 
virtual ~EDA_TEXT ()
 
const wxString & GetText () const
 Function GetText returns the string associated with the text object. More...
 
virtual wxString GetShownText () const
 Returns the string actually shown after processing of the base text. More...
 
wxString ShortenedShownText () const
 Returns a shortened version (max 15 characters) of the shown text. More...
 
virtual void SetText (const wxString &aText)
 
void SetThickness (int aNewThickness)
 Function SetThickness sets pen width. More...
 
int GetThickness () const
 Function GetThickness returns pen width. More...
 
void SetTextAngle (double aAngle)
 
double GetTextAngle () const
 
double GetTextAngleDegrees () const
 
double GetTextAngleRadians () const
 
void SetItalic (bool isItalic)
 
bool IsItalic () const
 
void SetBold (bool aBold)
 
bool IsBold () const
 
void SetVisible (bool aVisible)
 
bool IsVisible () const
 
void SetMirrored (bool isMirrored)
 
bool IsMirrored () const
 
void SetMultilineAllowed (bool aAllow)
 Function SetMultiLineAllowed. More...
 
bool IsMultilineAllowed () const
 
EDA_TEXT_HJUSTIFY_T GetHorizJustify () const
 
EDA_TEXT_VJUSTIFY_T GetVertJustify () const
 
void SetHorizJustify (EDA_TEXT_HJUSTIFY_T aType)
 
void SetVertJustify (EDA_TEXT_VJUSTIFY_T aType)
 
void SetEffects (const EDA_TEXT &aSrc)
 Function SetEffects sets the text effects from another instance. More...
 
void SwapEffects (EDA_TEXT &aTradingPartner)
 Function SwapEffects swaps the text effects of the two involved instances. More...
 
bool IsDefaultFormatting () const
 
void SetTextSize (const wxSize &aNewSize)
 
const wxSize & GetTextSize () const
 
void SetTextWidth (int aWidth)
 
int GetTextWidth () const
 
void SetTextHeight (int aHeight)
 
int GetTextHeight () const
 
void SetTextPos (const wxPoint &aPoint)
 
const wxPointGetTextPos () const
 
void SetTextX (int aX)
 
void SetTextY (int aY)
 
void Offset (const wxPoint &aOffset)
 
void Empty ()
 
void Draw (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode=FILLED, COLOR4D aAnchor_color=COLOR4D::UNSPECIFIED)
 Function Draw. More...
 
void TransformTextShapeToSegmentList (std::vector< wxPoint > &aCornerBuffer) const
 Convert the text shape to a list of segment each segment is stored as 2 wxPoints: the starting point and the ending point there are therefore 2*n points. More...
 
void TransformBoundingBoxWithClearanceToPolygon (SHAPE_POLY_SET *aCornerBuffer, int aClearanceValue) const
 Function TransformBoundingBoxWithClearanceToPolygon Convert the text bounding box to a rectangular polygon depending on the text orientation, the bounding box is not always horizontal or vertical Used in filling zones calculations Circles and arcs are approximated by segments. More...
 
virtual bool TextHitTest (const wxPoint &aPoint, int aAccuracy=0) const
 Function TextHitTest Test if aPoint is within the bounds of this object. More...
 
virtual bool TextHitTest (const EDA_RECT &aRect, bool aContains=false, int aAccuracy=0) const
 Function TextHitTest (overloaded) Tests if object bounding box is contained within or intersects aRect. More...
 
int LenSize (const wxString &aLine, int aThickness) const
 Function LenSize. More...
 
EDA_RECT GetTextBox (int aLine=-1, int aThickness=-1, bool aInvertY=false) const
 Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....) More...
 
int GetInterline (int aTextThickness=-1) const
 Return the distance between two lines of text. More...
 
wxString GetTextStyleName ()
 Function GetTextStyleName. More...
 
void GetPositionsOfLinesOfMultilineText (std::vector< wxPoint > &aPositions, int aLineCount) const
 Function GetPositionsOfLinesOfMultilineText Populates aPositions with the position of each line of a multiline text, according to the vertical justification and the rotation of the whole text. More...
 
virtual void Format (OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
 Function Format outputs the object to aFormatter in s-expression form. More...
 

Protected Attributes

wxString m_Text
 
UNIQUE_MUTEX m_mutex
 

Private Types

enum  TE_FLAGS {
  TE_MIRROR, TE_ITALIC, TE_BOLD, TE_MULTILINE,
  TE_VISIBLE
}
 EDA_TEXT effects bools. More...
 

Private Member Functions

void drawOneLineOfText (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode, const wxString &aText, const wxPoint &aPos)
 Function drawOneLineOfText draws a single text line. More...
 

Private Attributes

TEXT_EFFECTS m_e
 

Detailed Description

Class EDA_TEXT is 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 127 of file eda_text.h.

Member Enumeration Documentation

enum EDA_TEXT::TE_FLAGS
private

EDA_TEXT effects bools.

Enumerator
TE_MIRROR 
TE_ITALIC 
TE_BOLD 
TE_MULTILINE 
TE_VISIBLE 

Definition at line 402 of file eda_text.h.

402  {
403  // start at zero, sequence is irrelevant
404  TE_MIRROR,
405  TE_ITALIC,
406  TE_BOLD,
407  TE_MULTILINE,
408  TE_VISIBLE,
409  };

Constructor & Destructor Documentation

EDA_TEXT::EDA_TEXT ( const wxString &  text = wxEmptyString)

Definition at line 41 of file eda_text.cpp.

References DEFAULT_SIZE_TEXT, and SetTextSize().

41  :
42  m_Text( text ),
43  m_e( 1<<TE_VISIBLE )
44 {
45  int sz = Mils2iu( DEFAULT_SIZE_TEXT );
46  SetTextSize( wxSize( sz, sz ) );
47 }
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:87
wxString m_Text
Definition: eda_text.h:374
TEXT_EFFECTS m_e
Definition: eda_text.h:399
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:227
EDA_TEXT::~EDA_TEXT ( )
virtual

Definition at line 50 of file eda_text.cpp.

51 {
52 }

Member Function Documentation

void EDA_TEXT::Draw ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint aOffset,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode,
EDA_DRAW_MODE_T  aDisplay_mode = FILLED,
COLOR4D  aAnchor_color = COLOR4D::UNSPECIFIED 
)

Function Draw.

Parameters
aClipBox= the clipping rect, or NULL if no clipping
aDC= the current Device Context
aOffset= draw offset (usually (0,0))
aColor= text color
aDrawMode= GR_OR, GR_XOR.., -1 to use the current mode.
aDisplay_mode= FILLED or SKETCH
aAnchor_color= anchor color ( COLOR4D::UNSPECIFIED = do not draw anchor ).

Definition at line 280 of file eda_text.cpp.

References DIM_ANCRE_TEXTE, drawOneLineOfText(), GetPositionsOfLinesOfMultilineText(), GetShownText(), GetTextPos(), GRDrawAnchor(), IsMultilineAllowed(), wxStringSplit(), wxPoint::x, and wxPoint::y.

Referenced by TEXTE_PCB::Draw(), SCH_TEXT::Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), and WS_DRAW_ITEM_TEXT::DrawWsItem().

283 {
284  if( IsMultilineAllowed() )
285  {
286  std::vector<wxPoint> positions;
287  wxArrayString strings;
288  wxStringSplit( GetShownText(), strings, '\n' );
289 
290  positions.reserve( strings.Count() );
291 
292  GetPositionsOfLinesOfMultilineText( positions, strings.Count() );
293 
294  for( unsigned ii = 0; ii < strings.Count(); ii++ )
295  {
296  wxString& txt = strings.Item( ii );
297  drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
298  aDrawMode, aFillMode, txt, positions[ii] );
299  }
300  }
301  else
302  drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
303  aDrawMode, aFillMode, GetShownText(), GetTextPos() );
304 
305  // Draw text anchor, if requested
306  if( aAnchor_color != COLOR4D::UNSPECIFIED )
307  {
308  GRDrawAnchor( aClipBox, aDC,
309  GetTextPos().x + aOffset.x, GetTextPos().y + aOffset.y,
310  DIM_ANCRE_TEXTE, aAnchor_color );
311  }
312 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:183
bool IsMultilineAllowed() const
Definition: eda_text.h:201
const wxPoint & GetTextPos() const
Definition: eda_text.h:237
void GRDrawAnchor(EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, COLOR4D aColor)
Definition: gr_basic.cpp:1193
void drawOneLineOfText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode, const wxString &aText, const wxPoint &aPos)
Function drawOneLineOfText draws a single text line.
Definition: eda_text.cpp:357
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
void GetPositionsOfLinesOfMultilineText(std::vector< wxPoint > &aPositions, int aLineCount) const
Function GetPositionsOfLinesOfMultilineText Populates aPositions with the position of each line of a ...
Definition: eda_text.cpp:315
#define DIM_ANCRE_TEXTE
Definition: eda_text.h:88
void EDA_TEXT::drawOneLineOfText ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint aOffset,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode,
EDA_DRAW_MODE_T  aFillMode,
const wxString &  aText,
const wxPoint aPos 
)
private

Function drawOneLineOfText draws a single text line.

Used to draw each line of this EDA_TEXT, that can be multiline

Parameters
aClipBox= the clipping rect, or NULL if no clipping
aDC= the current Device Context
aOffset= draw offset (usually (0,0))
aColor= text color
aDrawMode= GR_OR, GR_XOR.., -1 to use the current mode.
aFillMode= FILLED or SKETCH
aText= the single line of text to draw.
aPos= the position of this line ).

Definition at line 357 of file eda_text.cpp.

References DrawGraphicText(), GetHorizJustify(), GetTextAngle(), GetTextSize(), GetThickness(), GetVertJustify(), GRSetDrawMode(), IsBold(), IsItalic(), IsMirrored(), SKETCH, and UNSPECIFIED_DRAWMODE.

Referenced by Draw().

361 {
362  int width = GetThickness();
363 
364  if( aDrawMode != UNSPECIFIED_DRAWMODE )
365  GRSetDrawMode( aDC, aDrawMode );
366 
367  if( aFillMode == SKETCH )
368  width = -width;
369 
370  wxSize size = GetTextSize();
371 
372  if( IsMirrored() )
373  size.x = -size.x;
374 
375  DrawGraphicText( aClipBox, aDC, aOffset + aPos, aColor, aText, GetTextAngle(), size,
377  width, IsItalic(), IsBold() );
378 }
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
bool IsItalic() const
Definition: eda_text.h:183
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:203
void DrawGraphicText(EDA_RECT *aClipBox, 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, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
bool IsBold() const
Definition: eda_text.h:186
double GetTextAngle() const
Definition: eda_text.h:177
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:167
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:204
bool IsMirrored() const
Definition: eda_text.h:192
const wxSize & GetTextSize() const
Definition: eda_text.h:228
void EDA_TEXT::Empty ( )
inline

Definition at line 244 of file eda_text.h.

References FILLED, and Format().

Referenced by SCH_LEGACY_PLUGIN_CACHE::loadPart().

244 { m_Text.Empty(); }
wxString m_Text
Definition: eda_text.h:374
void EDA_TEXT::Format ( OUTPUTFORMATTER aFormatter,
int  aNestLevel,
int  aControlBits 
) const
virtual

Function Format outputs the object to aFormatter in s-expression form.

Parameters
aFormatterThe OUTPUTFORMATTER object to write to.
aNestLevelThe indentation next level.
aControlBitsThe control bit definition for object specific formatting.
Exceptions
IO_ERRORon write error.

Definition at line 416 of file eda_text.cpp.

References CTL_OMIT_HIDE, FMT_IU, GetHorizJustify(), GetTextHeight(), GetTextWidth(), GetThickness(), GetVertJustify(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, IsBold(), IsItalic(), IsMirrored(), IsVisible(), and OUTPUTFORMATTER::Print().

417 {
418 #ifndef GERBVIEW // Gerbview does not use EDA_TEXT::Format
419  // and does not define FMT_IU, used here
420  // however this function should exist
421 
422  aFormatter->Print( aNestLevel + 1, "(effects" );
423 
424  // Text size
425  aFormatter->Print( 0, " (font" );
426 
427  aFormatter->Print( 0, " (size %s %s)",
428  FMT_IU( GetTextHeight() ).c_str(),
429  FMT_IU( GetTextWidth() ).c_str() );
430 
431  if( GetThickness() )
432  aFormatter->Print( 0, " (thickness %s)", FMT_IU( GetThickness() ).c_str() );
433 
434  if( IsBold() )
435  aFormatter->Print( 0, " bold" );
436 
437  if( IsItalic() )
438  aFormatter->Print( 0, " italic" );
439 
440  aFormatter->Print( 0, ")"); // (font
441 
442  if( IsMirrored() ||
445  {
446  aFormatter->Print( 0, " (justify");
447 
449  aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
450 
452  aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
453 
454  if( IsMirrored() )
455  aFormatter->Print( 0, " mirror" );
456  aFormatter->Print( 0, ")" ); // (justify
457  }
458 
459  if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() )
460  aFormatter->Print( 0, " hide" );
461 
462  aFormatter->Print( 0, ")\n" ); // (justify
463 
464 #endif
465 }
bool IsItalic() const
Definition: eda_text.h:183
int GetTextWidth() const
Definition: eda_text.h:231
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:203
bool IsBold() const
Definition: eda_text.h:186
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:167
#define FMT_IU
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:204
bool IsMirrored() const
Definition: eda_text.h:192
bool IsVisible() const
Definition: eda_text.h:189
int GetTextHeight() const
Definition: eda_text.h:234
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
#define CTL_OMIT_HIDE
Definition: eda_text.h:57
int EDA_TEXT::GetInterline ( int  aTextThickness = -1) 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.

Parameters
aTextThicknessOverrides the current thickness when greater than 0. this is needed when the current m_Thickness is 0 and a default line thickness is used

Definition at line 95 of file eda_text.cpp.

References KIGFX::STROKE_FONT::GetInterline(), GetTextHeight(), GetThickness(), and KiROUND().

Referenced by GetPositionsOfLinesOfMultilineText(), and GetTextBox().

96 {
97  int thickness = aTextThickness <= 0 ? GetThickness() : aTextThickness;
98 
99  return KiROUND( KIGFX::STROKE_FONT::GetInterline( GetTextHeight(), thickness ) );
100 }
static double GetInterline(double aGlyphHeight, double aGlyphThickness)
Compute the distance (interline) between 2 lines of text (for multiline texts).
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:167
int GetTextHeight() const
Definition: eda_text.h:234
void EDA_TEXT::GetPositionsOfLinesOfMultilineText ( std::vector< wxPoint > &  aPositions,
int  aLineCount 
) const

Function GetPositionsOfLinesOfMultilineText Populates 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 wxPoint positions
aLineCountis the number of lines (not recalculated here for efficiency reasons

Definition at line 315 of file eda_text.cpp.

References GetInterline(), GetTextAngle(), GetTextPos(), GetVertJustify(), GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, RotatePoint(), and wxPoint::y.

Referenced by CINFO3D_VISU::AddShapeWithClearanceToContainer(), Draw(), export_vrml_pcbtext(), SCH_TEXT::Plot(), BRDITEMS_PLOTTER::PlotTextePcb(), and TransformTextShapeToSegmentList().

317 {
318  wxPoint pos = GetTextPos(); // Position of first line of the
319  // multiline text according to
320  // the center of the multiline text block
321 
322  wxPoint offset; // Offset to next line.
323 
324  offset.y = GetInterline();
325 
326  if( aLineCount > 1 )
327  {
328  switch( GetVertJustify() )
329  {
331  break;
332 
334  pos.y -= ( aLineCount - 1 ) * offset.y / 2;
335  break;
336 
338  pos.y -= ( aLineCount - 1 ) * offset.y;
339  break;
340  }
341  }
342 
343  // Rotate the position of the first line
344  // around the center of the multiline text block
345  RotatePoint( &pos, GetTextPos(), GetTextAngle() );
346 
347  // Rotate the offset lines to increase happened in the right direction
348  RotatePoint( &offset, GetTextAngle() );
349 
350  for( int ii = 0; ii < aLineCount; ii++ )
351  {
352  aPositions.push_back( pos );
353  pos += offset;
354  }
355 }
int GetInterline(int aTextThickness=-1) const
Return the distance between two lines of text.
Definition: eda_text.cpp:95
const wxPoint & GetTextPos() const
Definition: eda_text.h:237
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
double GetTextAngle() const
Definition: eda_text.h:177
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:204
const wxString& EDA_TEXT::GetText ( ) const
inline

Function GetText returns the string associated with the text object.

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

Definition at line 143 of file eda_text.h.

Referenced by NETLIST_EXPORTER_GENERIC::addComponentFields(), SCH_EAGLE_PLUGIN::addImplicitConnections(), AddMenusForComponent(), AddMenusForText(), SIM_PLOT_FRAME::AddTuner(), SCH_EDIT_FRAME::backAnnotateFootprints(), SCH_SHEET::CleanupSheet(), SCH_REFERENCE::CompareValue(), SCH_SHEET::ComponentCount(), CreateComponentsSection(), LIB_EDIT_FRAME::CreateGraphicItem(), SCH_EDIT_FRAME::CreateNewText(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), DIALOG_EDIT_ONE_FIELD::DIALOG_EDIT_ONE_FIELD(), KIGFX::SCH_PAINTER::draw(), TEXTE_MODULE::Draw(), PCB_IO::format(), FormatProbeItem(), LIB_FIELD::GetFullText(), getMatchingTextItem(), SCH_COMPONENT::GetRef(), SCH_COMPONENT::GetScreenCoord(), LIB_ALIAS::GetSearchText(), NETLIST_EXPORTER_PSPICE::GetSpiceField(), NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal(), DIMENSION::GetText(), TEXT_MOD_GRID_TABLE::GetValue(), hash_eda(), SCH_SHEET::HasUndefinedPins(), LIB_FIELD::HitTest(), SCH_EDIT_FRAME::ImportSheetPin(), GENERAL_COLLECTOR::Inspect(), SCH_COMPONENT::IsInNetlist(), SCH_SCREEN::IsTerminalPoint(), SCH_EDIT_FRAME::Load_Component(), LEGACY_PLUGIN::loadPCB_TEXT(), SCH_EAGLE_PLUGIN::loadSchematic(), SCH_EAGLE_PLUGIN::loadSegments(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_COMPONENT::operator==(), PCB_PARSER::parseDIMENSION(), DRAWING_TOOL::PlaceDXF(), DRAWING_TOOL::PlaceText(), BRDITEMS_PLOTTER::PlotAllTextsModule(), DIALOG_RESCUE_EACH::PopulateInstanceList(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), processTextItem(), LIB_EDIT_FRAME::RedrawComponent(), SCH_EDIT_FRAME::RotateField(), SCH_LEGACY_PLUGIN::saveComponent(), SCH_LEGACY_PLUGIN::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveSymbol(), SCH_LEGACY_PLUGIN::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SCREEN::SetComponentFootprint(), SCH_COMPONENT::SetRef(), LIB_FIELD::SetText(), SCH_REFERENCE_LIST::sortByReferenceOnly(), TestMultiunitFootprints(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TransformTextShapeToSegmentList(), TUNER_SLIDER::TUNER_SLIDER(), DIALOG_UPDATE_FIELDS::updateFields(), DIALOG_FOOTPRINT_FP_EDITOR::Validate(), DIALOG_FOOTPRINT_BOARD_EDITOR::Validate(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), and NETLIST_EXPORTER_CADSTAR::WriteNetlist().

143 { return m_Text; }
wxString m_Text
Definition: eda_text.h:374
double EDA_TEXT::GetTextAngle ( ) const
inline

Definition at line 177 of file eda_text.h.

Referenced by CINFO3D_VISU::AddShapeWithClearanceToContainer(), LIB_TEXT::CalcEdit(), LIB_FIELD::CalcEdit(), CreateComponentsSection(), DIALOG_EDIT_ONE_FIELD::DIALOG_EDIT_ONE_FIELD(), SCH_FIELD::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::WORKSHEET_VIEWITEM::draw(), LIB_TEXT::drawGraphic(), LIB_FIELD::drawGraphic(), drawOneLineOfText(), export_vrml_pcbtext(), TEXTE_MODULE::Flip(), PCB_IO::format(), LIB_TEXT::GetBoundingBox(), SCH_FIELD::GetBoundingBox(), TEXTE_PCB::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), LIB_FIELD::GetBoundingBox(), SCH_LABEL::GetBoundingBox(), TEXTE_MODULE::GetDrawRotation(), TEXTE_PCB::GetMsgPanelInfo(), GetPositionsOfLinesOfMultilineText(), TEXT_MOD_GRID_TABLE::GetValue(), hash_eda(), LIB_TEXT::HitTest(), LIB_FIELD::HitTest(), SCH_EAGLE_PLUGIN::loadFieldAttributes(), DIMENSION::Mirror(), EAGLE_PLUGIN::orientModuleText(), PCB_PARSER::parseMODULE_unchecked(), DRAWING_TOOL::PlaceDXF(), PCB_BASE_FRAME::PlaceTexteModule(), LIB_TEXT::Plot(), SCH_FIELD::Plot(), SCH_TEXT::Plot(), LIB_FIELD::Plot(), BRDITEMS_PLOTTER::PlotTextePcb(), PlotWorkSheet(), TEXTE_PCB::Rotate(), TEXTE_MODULE::Rotate(), LIB_TEXT::Rotate(), DIMENSION::Rotate(), LIB_FIELD::Rotate(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), PCB_BASE_FRAME::RotateTextModule(), SCH_LEGACY_PLUGIN::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SCREEN::SetComponentFootprint(), PCB_BASE_FRAME::StartMoveTexteModule(), TextHitTest(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), TransformTextShapeToSegmentList(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), and DIALOG_UPDATE_FIELDS::updateFields().

177 { return m_e.angle; }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
double angle
now: 0.1 degrees; future: degrees
Definition: eda_text.h:112
double EDA_TEXT::GetTextAngleDegrees ( ) const
inline

Definition at line 179 of file eda_text.h.

Referenced by TEXTE_MODULE::GetMsgPanelInfo(), and DIALOG_TEXT_PROPERTIES::TransferDataToWindow().

179 { return GetTextAngle() / 10.0; }
double GetTextAngle() const
Definition: eda_text.h:177
double EDA_TEXT::GetTextAngleRadians ( ) const
inline

Definition at line 180 of file eda_text.h.

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

180 { return GetTextAngle() * M_PI/1800; }
double GetTextAngle() const
Definition: eda_text.h:177
EDA_RECT EDA_TEXT::GetTextBox ( int  aLine = -1,
int  aThickness = -1,
bool  aInvertY = false 
) const

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

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
Parameters
aLineThe line of text to consider. for single line text, aLine is unused If aLine == -1, the full area (considering all lines) is returned
aThicknessOverrides the current penwidth when greater than 0. This is needed when the current penwidth is 0 and a default penwidth is used.
aInvertYInvert the Y axis when calculating bounding box.

Definition at line 103 of file eda_text.cpp.

References basic_gal, KIGFX::STROKE_FONT::ComputeOverbarVerticalPosition(), KIGFX::STROKE_FONT::ComputeStringBoundaryLimits(), GetHorizJustify(), GetInterline(), GetShownText(), KIGFX::GAL::GetStrokeFont(), GetTextHeight(), GetTextPos(), GetTextSize(), GetThickness(), GetVertJustify(), EDA_RECT::GetWidth(), EDA_RECT::GetX(), EDA_RECT::GetY(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, IsMirrored(), IsMultilineAllowed(), KiROUND(), max, EDA_RECT::Move(), EDA_RECT::Normalize(), EDA_RECT::SetOrigin(), EDA_RECT::SetSize(), EDA_RECT::SetX(), EDA_RECT::SetY(), wxStringSplit(), VECTOR2< T >::x, and wxPoint::y.

Referenced by LIB_TEXT::GetBoundingBox(), SCH_FIELD::GetBoundingBox(), TEXTE_PCB::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), TEXTE_MODULE::GetBoundingBox(), LIB_FIELD::GetBoundingBox(), SCH_LABEL::GetBoundingBox(), DIMENSION::GetBoundingBox(), WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize(), TEXTE_MODULE::TextHitTest(), TextHitTest(), and TEXTE_MODULE::ViewBBox().

104 {
105  EDA_RECT rect;
106  wxArrayString strings;
107  wxString text = GetShownText();
108  int thickness = ( aThickness < 0 ) ? GetThickness() : aThickness;
109  int linecount = 1;
110  bool hasOverBar = false; // true if the first line of text as an overbar
111 
112  if( IsMultilineAllowed() )
113  {
114  wxStringSplit( text, strings, '\n' );
115 
116  if( strings.GetCount() ) // GetCount() == 0 for void strings
117  {
118  if( aLine >= 0 && (aLine < (int)strings.GetCount()) )
119  text = strings.Item( aLine );
120  else
121  text = strings.Item( 0 );
122 
123  linecount = strings.GetCount();
124  }
125  }
126 
127  // Search for overbar symbol. Only text is scanned,
128  // because only this line can change the bounding box
129  for( unsigned ii = 1; ii < text.size(); ii++ )
130  {
131  if( text[ii-1] == '~' && text[ii] != '~' )
132  {
133  hasOverBar = true;
134  break;
135  }
136  }
137 
138  // calculate the H and V size
140  text, VECTOR2D( GetTextSize() ), double( thickness ) ).x );
141  int dy = GetInterline( thickness );
142 
143  // Creates bounding box (rectangle) for an horizontal
144  // and left and top justified text. the bounding box will be moved later
145  // according to the actual text options
146  wxSize textsize = wxSize( dx, dy );
147  wxPoint pos = GetTextPos();
148 
149  if( aInvertY )
150  pos.y = -pos.y;
151 
152  rect.SetOrigin( pos );
153 
154  // The bbox vertical size returned by GetInterline( aThickness )
155  // includes letters like j and y and ] + interval between lines.
156  // The interval below the last line is not usefull, and we can use its half value
157  // as vertical margin above the text
158  // the full interval is roughly GetTextHeight() * 0.4 - aThickness/2
159  rect.Move( wxPoint( 0, thickness/4 - KiROUND( GetTextHeight() * 0.22 ) ) );
160 
161  if( hasOverBar )
162  { // A overbar adds an extra size to the text
163  // Height from the base line text of chars like [ or {
164  double curr_height = GetTextHeight() * 1.15;
165  int extra_height = KiROUND(
166  basic_gal.GetStrokeFont().ComputeOverbarVerticalPosition( GetTextHeight(), thickness ) - curr_height );
167  extra_height += thickness/2;
168  textsize.y += extra_height;
169  rect.Move( wxPoint( 0, -extra_height ) );
170  }
171 
172  // for multiline texts and aLine < 0, merge all rectangles
173  // ( if aLine < 0, we want the full text bounding box )
174  if( IsMultilineAllowed() && aLine < 0 )
175  {
176  for( unsigned ii = 1; ii < strings.GetCount(); ii++ )
177  {
178  text = strings.Item( ii );
180  text, VECTOR2D( GetTextSize() ), double( thickness ) ).x );
181  textsize.x = std::max( textsize.x, dx );
182  textsize.y += dy;
183  }
184  }
185 
186  rect.SetSize( textsize );
187 
188  /* Now, calculate the rect origin, according to text justification
189  * At this point the rectangle origin is the text origin (m_Pos).
190  * This is true only for left and top text justified texts (using top to bottom Y axis
191  * orientation). and must be recalculated for others justifications
192  * also, note the V justification is relative to the first line
193  */
194  switch( GetHorizJustify() )
195  {
197  if( IsMirrored() )
198  rect.SetX( rect.GetX() - rect.GetWidth() );
199  break;
200 
202  rect.SetX( rect.GetX() - (rect.GetWidth() / 2) );
203  break;
204 
206  if( !IsMirrored() )
207  rect.SetX( rect.GetX() - rect.GetWidth() );
208  break;
209  }
210 
211  dy = GetTextHeight() + thickness;
212 
213  switch( GetVertJustify() )
214  {
216  break;
217 
219  rect.SetY( rect.GetY() - ( dy / 2) );
220  break;
221 
223  rect.SetY( rect.GetY() - dy );
224  break;
225  }
226 
227  if( linecount > 1 )
228  {
229  int yoffset;
230  linecount -= 1;
231 
232  switch( GetVertJustify() )
233  {
235  break;
236 
238  yoffset = linecount * GetInterline() / 2;
239  rect.SetY( rect.GetY() - yoffset );
240  break;
241 
243  yoffset = linecount * GetInterline( aThickness );
244  rect.SetY( rect.GetY() - yoffset );
245  break;
246  }
247  }
248 
249  rect.Normalize(); // Make h and v sizes always >= 0
250 
251  return rect;
252 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:183
int GetInterline(int aTextThickness=-1) const
Return the distance between two lines of text.
Definition: eda_text.cpp:95
void Move(const wxPoint &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
bool IsMultilineAllowed() const
Definition: eda_text.h:201
const wxPoint & GetTextPos() const
Definition: eda_text.h:237
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
VECTOR2D ComputeStringBoundaryLimits(const UTF8 &aText, const VECTOR2D &aGlyphSize, double aGlyphThickness) const
Compute the boundary limits of aText (the bounding box of all shapes).
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:203
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:167
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
void SetX(int val)
Definition: eda_rect.h:130
void SetY(int val)
Definition: eda_rect.h:131
void Normalize()
Function Normalize ensures that the height ant width are positive.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:204
void SetSize(const wxSize &size)
Definition: eda_rect.h:126
#define max(a, b)
Definition: auxiliary.h:86
bool IsMirrored() const
Definition: eda_text.h:192
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
int GetX() const
Definition: eda_rect.h:109
double ComputeOverbarVerticalPosition(double aGlyphHeight, double aGlyphThickness) const
Compute the vertical position of an overbar, sometimes used in texts.
int GetWidth() const
Definition: eda_rect.h:117
int GetY() const
Definition: eda_rect.h:110
int GetTextHeight() const
Definition: eda_text.h:234
BASIC_GAL basic_gal(basic_displayOptions)
const wxSize & GetTextSize() const
Definition: eda_text.h:228
const STROKE_FONT & GetStrokeFont() const
const wxPoint& EDA_TEXT::GetTextPos ( ) const
inline

Definition at line 237 of file eda_text.h.

Referenced by CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer(), CINFO3D_VISU::AddShapeWithClearanceToContainer(), LIB_TEXT::BeginEdit(), LIB_FIELD::BeginEdit(), PCB_EDIT_FRAME::BeginMoveDimensionText(), LIB_TEXT::compare(), LIB_FIELD::compare(), SCH_SHEET_PIN::ConstrainOnEdge(), DIALOG_EDIT_ONE_FIELD::DIALOG_EDIT_ONE_FIELD(), SCH_LABEL::doIsConnected(), SCH_GLOBALLABEL::doIsConnected(), SCH_HIERLABEL::doIsConnected(), SCH_TEXT::Draw(), SCH_FIELD::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::WORKSHEET_VIEWITEM::draw(), TEXTE_MODULE::Draw(), KIGFX::PCB_PAINTER::draw(), Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), WS_DRAW_ITEM_LIST::Draw(), LIB_FIELD::drawGraphic(), TEXTE_MODULE::DrawUmbilical(), export_vrml_pcbtext(), export_vrml_text_module(), TEXTE_PCB::Flip(), TEXTE_MODULE::Flip(), PCB_EDIT_FRAME::FlipTextePcb(), PCB_IO::format(), LIB_TEXT::GetBoundingBox(), SCH_FIELD::GetBoundingBox(), TEXTE_PCB::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), TEXTE_MODULE::GetBoundingBox(), LIB_FIELD::GetBoundingBox(), SCH_LABEL::GetBoundingBox(), SCH_GLOBALLABEL::GetBoundingBox(), SCH_HIERLABEL::GetBoundingBox(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetEndPoints(), SCH_SHEET_PIN::GetEndPoints(), SCH_FIELD::GetLibPosition(), SCH_TEXT::GetNetListItem(), TEXTE_PCB::GetPosition(), TEXTE_MODULE::GetPosition(), DIMENSION::GetPosition(), LIB_TEXT::GetPosition(), SCH_FIELD::GetPosition(), SCH_TEXT::GetPosition(), LIB_FIELD::GetPosition(), GetPositionsOfLinesOfMultilineText(), GetTextBox(), LIB_TEXT::HitTest(), LIB_FIELD::HitTest(), WS_DRAW_ITEM_TEXT::HitTestStartPoint(), SCH_TEXT::IsSelectStateChanged(), MarkItemsInBloc(), TEXTE_MODULE::Mirror(), DIMENSION::Mirror(), LIB_TEXT::MirrorHorizontal(), LIB_FIELD::MirrorHorizontal(), LIB_TEXT::MirrorVertical(), LIB_FIELD::MirrorVertical(), SCH_TEXT::MirrorX(), SCH_SHEET_PIN::MirrorX(), SCH_COMPONENT::MirrorX(), SCH_TEXT::MirrorY(), SCH_SHEET_PIN::MirrorY(), SCH_COMPONENT::MirrorY(), PCB_PARSER::parseDIMENSION(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), DRAWING_TOOL::PlaceDXF(), PCB_BASE_FRAME::PlaceTexteModule(), SCH_TEXT::Plot(), BRDITEMS_PLOTTER::PlotTextePcb(), BRDITEMS_PLOTTER::PlotTextModule(), PlotWorkSheet(), TEXTE_PCB::Rotate(), TEXTE_MODULE::Rotate(), LIB_TEXT::Rotate(), SCH_FIELD::Rotate(), SCH_TEXT::Rotate(), SCH_SHEET_PIN::Rotate(), DIMENSION::Rotate(), LIB_FIELD::Rotate(), SCH_COMPONENT::Rotate(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SCREEN::SetComponentFootprint(), TEXTE_MODULE::SetDrawCoord(), TEXTE_MODULE::SetLocalCoord(), SCH_COMPONENT::SetRef(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), TEXTE_MODULE::TextHitTest(), TextHitTest(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), MODULE::TransformGraphicShapesWithClearanceToPolygonSet(), MODULE::TransformGraphicTextWithClearanceToPolygonSet(), TransformTextShapeToSegmentList(), SCH_TEXT::UpdateDanglingState(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), DIALOG_UPDATE_FIELDS::updateFields(), and TEXTE_MODULE::ViewBBox().

237 { return m_e.pos; }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
wxPoint pos
Definition: eda_text.h:113
const wxSize& EDA_TEXT::GetTextSize ( ) const
inline

Definition at line 228 of file eda_text.h.

Referenced by CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer(), CINFO3D_VISU::AddShapeWithClearanceToContainer(), SCH_GLOBALLABEL::CreateGraphicShape(), MWAVE::CreateMicrowaveInductor(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_TEXT::Draw(), KIGFX::SCH_PAINTER::draw(), SCH_FIELD::Draw(), TEXTE_MODULE::Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), LIB_TEXT::drawGraphic(), LIB_FIELD::drawGraphic(), drawOneLineOfText(), export_vrml_pcbtext(), export_vrml_text_module(), SCH_FIELD::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), LIB_TEXT::GetPenSize(), SCH_FIELD::GetPenSize(), LIB_FIELD::GetPenSize(), SCH_TEXT::GetPenSize(), SCH_GLOBALLABEL::GetSchematicTextOffset(), GetTextBox(), LenSize(), SCH_EAGLE_PLUGIN::loadFieldAttributes(), SCH_EDIT_FRAME::OnConvertTextType(), EAGLE_PLUGIN::orientModuleText(), DRAWING_TOOL::PlaceDXF(), LIB_TEXT::Plot(), SCH_FIELD::Plot(), SCH_TEXT::Plot(), LIB_FIELD::Plot(), BRDITEMS_PLOTTER::PlotTextePcb(), BRDITEMS_PLOTTER::PlotTextModule(), PlotWorkSheet(), PCB_BASE_FRAME::ResetTextSize(), SCH_SCREEN::SetComponentFootprint(), KIGFX::GAL::SetTextAttributes(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), MODULE::TransformGraphicShapesWithClearanceToPolygonSet(), MODULE::TransformGraphicTextWithClearanceToPolygonSet(), TransformTextShapeToSegmentList(), and DIALOG_UPDATE_FIELDS::updateFields().

228 { return m_e.size; };
TEXT_EFFECTS m_e
Definition: eda_text.h:399
wxSize size
Definition: eda_text.h:110
wxString EDA_TEXT::GetTextStyleName ( )

Function GetTextStyleName.

Returns
a wxString with the style name( Normal, Italic, Bold, Bold+Italic)

Definition at line 381 of file eda_text.cpp.

References IsBold(), and IsItalic().

Referenced by LIB_FIELD::GetMsgPanelInfo().

382 {
383  int style = 0;
384 
385  if( IsItalic() )
386  style = 1;
387 
388  if( IsBold() )
389  style += 2;
390 
391  wxString stylemsg[4] = {
392  _("Normal"),
393  _("Italic"),
394  _("Bold"),
395  _("Bold+Italic")
396  };
397 
398  return stylemsg[style];
399 }
bool IsItalic() const
Definition: eda_text.h:183
bool IsBold() const
Definition: eda_text.h:186
int EDA_TEXT::GetThickness ( ) const
inline

Function GetThickness returns pen width.

Definition at line 167 of file eda_text.h.

Referenced by CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer(), CINFO3D_VISU::AddShapeWithClearanceToContainer(), DIMENSION::AdjustDimensionDetails(), SCH_GLOBALLABEL::CreateGraphicShape(), SCH_TEXT::Draw(), SCH_FIELD::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::WORKSHEET_VIEWITEM::draw(), TEXTE_MODULE::Draw(), KIGFX::PCB_PAINTER::draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), drawOneLineOfText(), export_vrml_pcbtext(), export_vrml_text_module(), Format(), SCH_FIELD::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), SCH_LABEL::GetBoundingBox(), SCH_GLOBALLABEL::GetBoundingBox(), SCH_HIERLABEL::GetBoundingBox(), GetInterline(), TEXTE_PCB::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), LIB_TEXT::GetPenSize(), SCH_FIELD::GetPenSize(), LIB_FIELD::GetPenSize(), SCH_TEXT::GetPenSize(), SCH_GLOBALLABEL::GetSchematicTextOffset(), SCH_HIERLABEL::GetSchematicTextOffset(), GetTextBox(), TEXT_MOD_GRID_TABLE::GetValue(), LIB_TEXT::GetWidth(), LIB_FIELD::GetWidth(), IsDefaultFormatting(), SCH_EDIT_FRAME::OnConvertTextType(), DRAWING_TOOL::PlaceDXF(), BRDITEMS_PLOTTER::PlotTextePcb(), BRDITEMS_PLOTTER::PlotTextModule(), PCB_BASE_FRAME::ResetTextSize(), SCH_LEGACY_PLUGIN::saveText(), PNS_KICAD_IFACE::syncTextItem(), DRC::testCopperTextItem(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), MODULE::TransformGraphicShapesWithClearanceToPolygonSet(), MODULE::TransformGraphicTextWithClearanceToPolygonSet(), and TransformTextShapeToSegmentList().

167 { return m_e.penwidth; };
TEXT_EFFECTS m_e
Definition: eda_text.h:399
int penwidth
Definition: eda_text.h:111
bool EDA_TEXT::IsDefaultFormatting ( ) const

Definition at line 402 of file eda_text.cpp.

References GetHorizJustify(), GetThickness(), GetVertJustify(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, IsBold(), IsItalic(), IsMirrored(), IsMultilineAllowed(), and IsVisible().

403 {
404  return ( IsVisible()
405  && !IsMirrored()
408  && GetThickness() == 0
409  && !IsItalic()
410  && !IsBold()
411  && !IsMultilineAllowed()
412  );
413 }
bool IsMultilineAllowed() const
Definition: eda_text.h:201
bool IsItalic() const
Definition: eda_text.h:183
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:203
bool IsBold() const
Definition: eda_text.h:186
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:167
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:204
bool IsMirrored() const
Definition: eda_text.h:192
bool IsVisible() const
Definition: eda_text.h:189
bool EDA_TEXT::IsItalic ( ) const
inline

Definition at line 183 of file eda_text.h.

Referenced by CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer(), CINFO3D_VISU::AddShapeWithClearanceToContainer(), SCH_EDIT_FRAME::CreateNewText(), DIALOG_EDIT_ONE_FIELD::DIALOG_EDIT_ONE_FIELD(), KIGFX::SCH_PAINTER::draw(), SCH_FIELD::Draw(), TEXTE_MODULE::Draw(), LIB_TEXT::drawGraphic(), LIB_FIELD::drawGraphic(), drawOneLineOfText(), export_vrml_pcbtext(), export_vrml_text_module(), Format(), SCH_TEXT::GetMsgPanelInfo(), GetTextStyleName(), TEXT_MOD_GRID_TABLE::GetValueAsBool(), hash_eda(), IsDefaultFormatting(), LenSize(), SCH_EDIT_FRAME::OnConvertTextType(), DRAWING_TOOL::PlaceDXF(), LIB_TEXT::Plot(), SCH_FIELD::Plot(), SCH_TEXT::Plot(), LIB_FIELD::Plot(), BRDITEMS_PLOTTER::PlotTextePcb(), BRDITEMS_PLOTTER::PlotTextModule(), PlotWorkSheet(), SCH_LEGACY_PLUGIN::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), KIGFX::GAL::SetTextAttributes(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), MODULE::TransformGraphicShapesWithClearanceToPolygonSet(), MODULE::TransformGraphicTextWithClearanceToPolygonSet(), TransformTextShapeToSegmentList(), and DIALOG_UPDATE_FIELDS::updateFields().

183 { return m_e.Bit( TE_ITALIC ); }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
void Bit(int aBit, bool aValue)
Definition: eda_text.h:115
int EDA_TEXT::LenSize ( const wxString &  aLine,
int  aThickness 
) const

Function LenSize.

Returns
the text length in internal units
Parameters
aLine: the line of text to consider. For single line text, this parameter is always m_Text
aThickness: the stroke width of the text

Definition at line 67 of file eda_text.cpp.

References basic_gal, KIGFX::GAL::GetTextLineSize(), GetTextSize(), IsBold(), IsItalic(), KiROUND(), KIGFX::GAL::SetFontBold(), KIGFX::GAL::SetFontItalic(), KIGFX::GAL::SetGlyphSize(), KIGFX::GAL::SetLineWidth(), and VECTOR2< T >::x.

Referenced by SCH_GLOBALLABEL::CreateGraphicShape(), SCH_GLOBALLABEL::GetBoundingBox(), and SCH_HIERLABEL::GetBoundingBox().

68 {
71  basic_gal.SetLineWidth( aThickness );
73 
74  VECTOR2D tsize = basic_gal.GetTextLineSize( aLine );
75 
76  return KiROUND( tsize.x );
77 }
void SetFontItalic(const bool aItalic)
Set italic property of current font.
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
bool IsItalic() const
Definition: eda_text.h:183
bool IsBold() const
Definition: eda_text.h:186
virtual void SetLineWidth(float aLineWidth)
Set the line width.
void SetFontBold(const bool aBold)
Set bold property of current font.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
void SetGlyphSize(const VECTOR2D aGlyphSize)
Set the font glyph size.
BASIC_GAL basic_gal(basic_displayOptions)
const wxSize & GetTextSize() const
Definition: eda_text.h:228
VECTOR2D GetTextLineSize(const UTF8 &aText) const
Compute the X and Y size of a given text.
void EDA_TEXT::SetEffects ( const EDA_TEXT aSrc)

Function SetEffects sets the text effects from another instance.

(TEXT_EFFECTS is not exposed in the public API, but includes everything except the actual text string itself.)

Definition at line 55 of file eda_text.cpp.

References m_e.

Referenced by LIB_TEXT::Clone(), LIB_FIELD::Copy(), SCH_FIELD::ExportValues(), SCH_FIELD::ImportValues(), LIB_FIELD::operator=(), and TEXTE_MODULE::SetEffects().

56 {
57  m_e = aSrc.m_e;
58 }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
void EDA_TEXT::SetMultilineAllowed ( bool  aAllow)
inline

Function SetMultiLineAllowed.

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 200 of file eda_text.h.

Referenced by WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), DRAWING_TOOL::PlaceDXF(), SCH_GLOBALLABEL::SCH_GLOBALLABEL(), SCH_HIERLABEL::SCH_HIERLABEL(), SCH_LABEL::SCH_LABEL(), SCH_TEXT::SCH_TEXT(), WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize(), and TEXTE_PCB::TEXTE_PCB().

200 { m_e.Bit( TE_MULTILINE, aAllow ); }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
void Bit(int aBit, bool aValue)
Definition: eda_text.h:115
virtual void EDA_TEXT::SetText ( const wxString &  aText)
inlinevirtual
void EDA_TEXT::SetTextHeight ( int  aHeight)
inline

Definition at line 233 of file eda_text.h.

Referenced by DXF2BRD_CONVERTER::addMText(), DXF2BRD_CONVERTER::addText(), LIB_FIELD::Init(), and TEXT_MOD_GRID_TABLE::SetValue().

233 { m_e.size.y = aHeight; }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
wxSize size
Definition: eda_text.h:110
void EDA_TEXT::SetTextPos ( const wxPoint aPoint)
inline

Definition at line 236 of file eda_text.h.

Referenced by AbortMoveDimensionText(), DXF2BRD_CONVERTER::addMText(), DXF2BRD_CONVERTER::addText(), PCAD2KICAD::PCB_TEXT::AddToBoard(), DIMENSION::AdjustDimensionDetails(), LIB_TEXT::BeginEdit(), LIB_FIELD::BeginEdit(), LIB_TEXT::CalcEdit(), LIB_FIELD::CalcEdit(), PCB_EDIT_FRAME::CreateTextePcb(), LIB_TEXT::HitTest(), LIB_FIELD::HitTest(), SCH_EAGLE_PLUGIN::loadFieldAttributes(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), DIMENSION::Mirror(), SCH_COMPONENT::MirrorX(), SCH_COMPONENT::MirrorY(), LIB_TEXT::Move(), LIB_FIELD::Move(), Move_Texte_Pcb(), MoveDimensionText(), EAGLE_PLUGIN::orientModuleText(), EAGLE_PLUGIN::packageText(), PCB_EDIT_FRAME::PlaceDimensionText(), DRAWING_TOOL::PlaceDXF(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), TEXTE_PCB::Rotate(), TEXTE_MODULE::Rotate(), LIB_TEXT::Rotate(), SCH_FIELD::Rotate(), SCH_TEXT::Rotate(), SCH_SHEET_PIN::Rotate(), DIMENSION::Rotate(), LIB_FIELD::Rotate(), SCH_COMPONENT::Rotate(), SCH_FIELD::SCH_FIELD(), SCH_SHEET_PIN::SCH_SHEET_PIN(), SCH_TEXT::SCH_TEXT(), SCH_SCREEN::SetComponentFootprint(), TEXTE_MODULE::SetDrawCoord(), TEXTE_PCB::SetPosition(), TEXTE_MODULE::SetPosition(), DIMENSION::SetPosition(), SCH_FIELD::SetPosition(), SCH_TEXT::SetPosition(), SCH_COMPONENT::SetRef(), TEXTE_MODULE::TEXTE_MODULE(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_UPDATE_FIELDS::updateFields(), SCH_COMPONENT::UpdateFields(), DIALOG_EDIT_ONE_FIELD::updateText(), and WS_DRAW_ITEM_TEXT::WS_DRAW_ITEM_TEXT().

236 { m_e.pos = aPoint; }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
wxPoint pos
Definition: eda_text.h:113
void EDA_TEXT::SetTextSize ( const wxSize &  aNewSize)
inline

Definition at line 227 of file eda_text.h.

Referenced by SCH_EAGLE_PLUGIN::addImplicitConnections(), LIB_EDIT_FRAME::CreateGraphicItem(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), PCB_BASE_FRAME::CreateNewModule(), SCH_EDIT_FRAME::CreateNewText(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTextePcb(), DRAWING_TOOL::DrawDimension(), DrawGraphicText(), dummy(), KIGFX::dummy(), EDA_TEXT(), PCB_EDIT_FRAME::EditDimension(), SCH_EDIT_FRAME::ImportSheetPin(), LIB_TEXT::LIB_TEXT(), SCH_LEGACY_PLUGIN_CACHE::loadField(), SCH_EAGLE_PLUGIN::loadFieldAttributes(), LEGACY_PLUGIN::loadMODULE_TEXT(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), SCH_LEGACY_PLUGIN_CACHE::loadText(), SCH_EAGLE_PLUGIN::loadTextAttributes(), DIALOG_FOOTPRINT_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAddField(), SCH_EDIT_FRAME::OnConvertTextType(), EAGLE_PLUGIN::orientModuleText(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseEDA_TEXT(), DRAWING_TOOL::PlaceDXF(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::ResetTextSize(), SCH_SCREEN::SetComponentFootprint(), DIMENSION::SetTextSize(), PCAD2KICAD::SetTextSizeFromStrokeFontHeight(), PCAD2KICAD::SetTextSizeFromTrueTypeFontHeight(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_UPDATE_FIELDS::updateFields(), DIALOG_EDIT_ONE_FIELD::updateText(), and WS_DRAW_ITEM_TEXT::WS_DRAW_ITEM_TEXT().

227 { m_e.size = aNewSize; };
TEXT_EFFECTS m_e
Definition: eda_text.h:399
wxSize size
Definition: eda_text.h:110
void EDA_TEXT::SetTextWidth ( int  aWidth)
inline

Definition at line 230 of file eda_text.h.

Referenced by DXF2BRD_CONVERTER::addMText(), DXF2BRD_CONVERTER::addText(), LIB_FIELD::Init(), and TEXT_MOD_GRID_TABLE::SetValue().

230 { m_e.size.x = aWidth; }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
wxSize size
Definition: eda_text.h:110
wxString EDA_TEXT::ShortenedShownText ( ) const

Returns a shortened version (max 15 characters) of the shown text.

Definition at line 80 of file eda_text.cpp.

References GetShownText().

Referenced by TEXTE_PCB::GetSelectMenuText(), LIB_TEXT::GetSelectMenuText(), SCH_TEXT::GetSelectMenuText(), SCH_SHEET_PIN::GetSelectMenuText(), TEXTE_MODULE::GetSelectMenuText(), LIB_FIELD::GetSelectMenuText(), SCH_LABEL::GetSelectMenuText(), SCH_GLOBALLABEL::GetSelectMenuText(), and SCH_HIERLABEL::GetSelectMenuText().

81 {
82  wxString tmp = GetShownText();
83 
84  tmp.Replace( wxT( "\n" ), wxT( " " ) );
85  tmp.Replace( wxT( "\r" ), wxT( " " ) );
86  tmp.Replace( wxT( "\t" ), wxT( " " ) );
87 
88  if( tmp.Length() > 15 )
89  tmp = tmp.Left( 12 ) + wxT( "..." );
90 
91  return tmp;
92 }
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
void EDA_TEXT::SwapEffects ( EDA_TEXT aTradingPartner)

Function SwapEffects swaps the text effects of the two involved instances.

(TEXT_EFECTS is not exposed in the public API, but includes everything except the actual text string itself.)

Definition at line 61 of file eda_text.cpp.

References m_e.

Referenced by SCH_FIELD::SwapData(), SCH_TEXT::SwapData(), and TEXTE_MODULE::SwapEffects().

62 {
63  std::swap( m_e, aTradingPartner.m_e );
64 }
TEXT_EFFECTS m_e
Definition: eda_text.h:399
bool EDA_TEXT::TextHitTest ( const wxPoint aPoint,
int  aAccuracy = 0 
) const
virtual

Function TextHitTest Test if aPoint is within the bounds of this object.

Parameters
aPoint-A wxPoint to test
aAccuracy- Amount to inflate the bounding box.
Returns
bool - true if a hit, else false

Reimplemented in TEXTE_MODULE.

Definition at line 255 of file eda_text.cpp.

References EDA_RECT::Contains(), GetTextAngle(), GetTextBox(), GetTextPos(), EDA_RECT::Inflate(), and RotatePoint().

Referenced by TEXTE_PCB::HitTest(), LIB_TEXT::HitTest(), LIB_FIELD::HitTest(), DIMENSION::HitTest(), and WS_DRAW_ITEM_TEXT::HitTest().

256 {
257  EDA_RECT rect = GetTextBox( -1 ); // Get the full text area.
258  wxPoint location = aPoint;
259 
260  rect.Inflate( aAccuracy );
261  RotatePoint( &location, GetTextPos(), -GetTextAngle() );
262 
263  return rect.Contains( location );
264 }
const wxPoint & GetTextPos() const
Definition: eda_text.h:237
bool Contains(const wxPoint &aPoint) const
Function Contains.
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
double GetTextAngle() const
Definition: eda_text.h:177
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false) const
Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones fi...
Definition: eda_text.cpp:103
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
bool EDA_TEXT::TextHitTest ( const EDA_RECT aRect,
bool  aContains = false,
int  aAccuracy = 0 
) const
virtual

Function TextHitTest (overloaded) Tests if object bounding box is contained within or intersects aRect.

Parameters
aRect- Rect to test against.
aContains- Test for containment instead of intersection if true.
aAccuracy- Amount to inflate the bounding box.
Returns
bool - true if a hit, else false

Reimplemented in TEXTE_MODULE.

Definition at line 267 of file eda_text.cpp.

References EDA_RECT::Contains(), GetTextAngle(), GetTextBox(), EDA_RECT::Inflate(), and EDA_RECT::Intersects().

268 {
269  EDA_RECT rect = aRect;
270 
271  rect.Inflate( aAccuracy );
272 
273  if( aContains )
274  return rect.Contains( GetTextBox( -1 ) );
275 
276  return rect.Intersects( GetTextBox( -1 ), GetTextAngle() );
277 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
double GetTextAngle() const
Definition: eda_text.h:177
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false) const
Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones fi...
Definition: eda_text.cpp:103
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
void EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon ( SHAPE_POLY_SET aCornerBuffer,
int  aClearanceValue 
) const

Function TransformBoundingBoxWithClearanceToPolygon Convert the text bounding box to a rectangular polygon depending on the text orientation, the bounding box is not always horizontal or vertical Used in filling zones calculations Circles and arcs are approximated by segments.

Function TransformBoundingBoxWithClearanceToPolygon Convert the text bounding box to a rectangular polygon Used in filling zones calculations Circles and arcs are approximated by segments.

Parameters
aCornerBuffer= a buffer to store the polygon
aClearanceValue= the clearance around the text bounding box to the real clearance value (usually near from 1.0)
aCornerBuffer= a buffer to store the polygon
aClearanceValue= the clearance around the text bounding box

Definition at line 410 of file board_items_to_polygon_shape_transform.cpp.

References SHAPE_POLY_SET::Append(), EDA_RECT::GetBottom(), EDA_RECT::GetOrigin(), EDA_RECT::GetRight(), GetText(), EDA_RECT::Inflate(), SHAPE_POLY_SET::NewOutline(), RotatePoint(), wxPoint::x, and wxPoint::y.

413 {
414  // Oh dear. When in UTF-8 mode, wxString puts string iterators in a linked list, and
415  // that linked list is not thread-safe.
416  std::lock_guard<std::mutex> guard( m_mutex );
417 
418  if( GetText().Length() == 0 )
419  return;
420 
421  wxPoint corners[4]; // Buffer of polygon corners
422 
423  EDA_RECT rect = GetTextBox( -1 );
424  rect.Inflate( aClearanceValue );
425  corners[0].x = rect.GetOrigin().x;
426  corners[0].y = rect.GetOrigin().y;
427  corners[1].y = corners[0].y;
428  corners[1].x = rect.GetRight();
429  corners[2].x = corners[1].x;
430  corners[2].y = rect.GetBottom();
431  corners[3].y = corners[2].y;
432  corners[3].x = corners[0].x;
433 
434  aCornerBuffer->NewOutline();
435 
436  for( int ii = 0; ii < 4; ii++ )
437  {
438  // Rotate polygon
439  RotatePoint( &corners[ii].x, &corners[ii].y, GetTextPos().x, GetTextPos().y, GetTextAngle() );
440  aCornerBuffer->Append( corners[ii].x, corners[ii].y );
441  }
442 }
const wxPoint GetOrigin() const
Definition: eda_rect.h:112
const wxPoint & GetTextPos() const
Definition: eda_text.h:237
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
double GetTextAngle() const
Definition: eda_text.h:177
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false) const
Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones fi...
Definition: eda_text.cpp:103
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
int GetBottom() const
Definition: eda_rect.h:122
int GetRight() const
Definition: eda_rect.h:119
int NewOutline()
Creates a new empty polygon in the set and returns its index
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline) ...
UNIQUE_MUTEX m_mutex
Definition: eda_text.h:377
void EDA_TEXT::TransformTextShapeToSegmentList ( std::vector< wxPoint > &  aCornerBuffer) const

Convert the text shape to a list of segment each segment is stored as 2 wxPoints: the starting point and the ending point there are therefore 2*n points.

Parameters
aCornerBuffer= a buffer to store the polygon

Definition at line 480 of file eda_text.cpp.

References addTextSegmToBuffer(), BLACK, color, DrawGraphicText(), GetHorizJustify(), GetPositionsOfLinesOfMultilineText(), GetShownText(), GetText(), GetTextAngle(), GetTextPos(), GetTextSize(), GetThickness(), GetVertJustify(), IsItalic(), IsMirrored(), IsMultilineAllowed(), and wxStringSplit().

Referenced by PNS_KICAD_IFACE::syncTextItem(), and DRC::testCopperTextItem().

481 {
482  wxSize size = GetTextSize();
483 
484  if( IsMirrored() )
485  size.x = -size.x;
486 
487  COLOR4D color = COLOR4D::BLACK; // not actually used, but needed by DrawGraphicText
488 
489  if( IsMultilineAllowed() )
490  {
491  wxArrayString strings_list;
492  wxStringSplit( GetShownText(), strings_list, wxChar('\n') );
493  std::vector<wxPoint> positions;
494  positions.reserve( strings_list.Count() );
495  GetPositionsOfLinesOfMultilineText( positions,strings_list.Count() );
496 
497  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
498  {
499  wxString txt = strings_list.Item( ii );
500  DrawGraphicText( NULL, NULL, positions[ii], color,
501  txt, GetTextAngle(), size,
503  GetThickness(), IsItalic(),
504  true, addTextSegmToBuffer, &aCornerBuffer );
505  }
506  }
507  else
508  {
509  DrawGraphicText( NULL, NULL, GetTextPos(), color,
510  GetText(), GetTextAngle(), size,
512  GetThickness(), IsItalic(),
513  true, addTextSegmToBuffer, &aCornerBuffer );
514  }
515 }
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:183
bool IsMultilineAllowed() const
Definition: eda_text.h:201
const wxPoint & GetTextPos() const
Definition: eda_text.h:237
bool IsItalic() const
Definition: eda_text.h:183
int color
Definition: DXF_plotter.cpp:62
static void addTextSegmToBuffer(int x0, int y0, int xf, int yf, void *aData)
Definition: eda_text.cpp:473
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:203
void DrawGraphicText(EDA_RECT *aClipBox, 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, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
double GetTextAngle() const
Definition: eda_text.h:177
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:167
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
void GetPositionsOfLinesOfMultilineText(std::vector< wxPoint > &aPositions, int aLineCount) const
Function GetPositionsOfLinesOfMultilineText Populates aPositions with the position of each line of a ...
Definition: eda_text.cpp:315
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:204
bool IsMirrored() const
Definition: eda_text.h:192
Definition: colors.h:45
const wxSize & GetTextSize() const
Definition: eda_text.h:228
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

Member Data Documentation

TEXT_EFFECTS EDA_TEXT::m_e
private

Definition at line 399 of file eda_text.h.

Referenced by SetEffects(), and SwapEffects().

UNIQUE_MUTEX EDA_TEXT::m_mutex
mutableprotected

Definition at line 377 of file eda_text.h.


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