KiCad PCB EDA Suite
eda_text.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #include <eda_text.h>
31 #include <drawtxt.h>
32 #include <class_eda_rect.h>
33 #include <macros.h>
34 #include <trigo.h> // RotatePoint
35 #include <class_drawpanel.h> // EDA_DRAW_PANEL
36 
37 #include <basic_gal.h>
38 #include <unit_format.h>
39 #include <convert_to_biu.h>
40 
41 EDA_TEXT::EDA_TEXT( const wxString& text ) :
42  m_Text( text ),
43  m_e( 1<<TE_VISIBLE )
44 {
45  int sz = Mils2iu( DEFAULT_SIZE_TEXT );
46  SetTextSize( wxSize( sz, sz ) );
47 }
48 
49 
51 {
52 }
53 
54 
55 void EDA_TEXT::SetEffects( const EDA_TEXT& aSrc )
56 {
57  m_e = aSrc.m_e;
58 }
59 
60 
61 void EDA_TEXT::SwapEffects( EDA_TEXT& aTradingPartner )
62 {
63  std::swap( m_e, aTradingPartner.m_e );
64 }
65 
66 
67 int EDA_TEXT::LenSize( const wxString& aLine ) const
68 {
72 
73  VECTOR2D tsize = basic_gal.GetTextLineSize( aLine );
74 
75  return KiROUND( tsize.x );
76 }
77 
78 
80 {
81  wxString tmp = GetShownText();
82 
83  tmp.Replace( wxT( "\n" ), wxT( " " ) );
84  tmp.Replace( wxT( "\r" ), wxT( " " ) );
85  tmp.Replace( wxT( "\t" ), wxT( " " ) );
86 
87  if( tmp.Length() > 15 )
88  tmp = tmp.Left( 12 ) + wxT( "..." );
89 
90  return tmp;
91 }
92 
93 
94 int EDA_TEXT::GetInterline( int aTextThickness ) const
95 {
96  int thickness = aTextThickness <= 0 ? GetThickness() : aTextThickness;
97 
98  return KiROUND( KIGFX::STROKE_FONT::GetInterline( GetTextHeight(), thickness ) );
99 }
100 
101 
102 EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const
103 {
104  EDA_RECT rect;
105  wxArrayString strings;
106  wxString text = GetShownText();
107  int thickness = ( aThickness < 0 ) ? GetThickness() : aThickness;
108  int linecount = 1;
109  bool hasOverBar = false; // true if the first line of text as an overbar
110 
111  if( IsMultilineAllowed() )
112  {
113  wxStringSplit( text, strings, '\n' );
114 
115  if( strings.GetCount() ) // GetCount() == 0 for void strings
116  {
117  if( aLine >= 0 && (aLine < (int)strings.GetCount()) )
118  text = strings.Item( aLine );
119  else
120  text = strings.Item( 0 );
121 
122  linecount = strings.GetCount();
123  }
124  }
125 
126  // Search for overbar symbol. Only text is scanned,
127  // because only this line can change the bounding box
128  for( unsigned ii = 1; ii < text.size(); ii++ )
129  {
130  if( text[ii-1] == '~' && text[ii] != '~' )
131  {
132  hasOverBar = true;
133  break;
134  }
135  }
136 
137  // calculate the H and V size
139  text, VECTOR2D( GetTextSize() ), double( thickness ) ).x );
140  int dy = GetInterline( thickness );
141 
142  // Creates bounding box (rectangle) for an horizontal
143  // and left and top justified text. the bounding box will be moved later
144  // according to the actual text options
145  wxSize textsize = wxSize( dx, dy );
146  wxPoint pos = GetTextPos();
147 
148  if( aInvertY )
149  pos.y = -pos.y;
150 
151  rect.SetOrigin( pos );
152 
153  // The bbox vertical size returned by GetInterline( aThickness )
154  // includes letters like j and y and ] + interval between lines.
155  // The interval below the last line is not usefull, and we can use its half value
156  // as vertical margin above the text
157  // the full interval is roughly GetTextHeight() * 0.4 - aThickness/2
158  rect.Move( wxPoint( 0, thickness/4 - KiROUND( GetTextHeight() * 0.22 ) ) );
159 
160  if( hasOverBar )
161  { // A overbar adds an extra size to the text
162  // Height from the base line text of chars like [ or {
163  double curr_height = GetTextHeight() * 1.15;
164  int extra_height = KiROUND(
165  basic_gal.GetStrokeFont().ComputeOverbarVerticalPosition( GetTextHeight(), thickness ) - curr_height );
166  extra_height += thickness/2;
167  textsize.y += extra_height;
168  rect.Move( wxPoint( 0, -extra_height ) );
169  }
170 
171  // for multiline texts and aLine < 0, merge all rectangles
172  // ( if aLine < 0, we want the full text bounding box )
173  if( IsMultilineAllowed() && aLine < 0 )
174  {
175  for( unsigned ii = 1; ii < strings.GetCount(); ii++ )
176  {
177  text = strings.Item( ii );
179  text, VECTOR2D( GetTextSize() ), double( thickness ) ).x );
180  textsize.x = std::max( textsize.x, dx );
181  textsize.y += dy;
182  }
183  }
184 
185  rect.SetSize( textsize );
186 
187  /* Now, calculate the rect origin, according to text justification
188  * At this point the rectangle origin is the text origin (m_Pos).
189  * This is true only for left and top text justified texts (using top to bottom Y axis
190  * orientation). and must be recalculated for others justifications
191  * also, note the V justification is relative to the first line
192  */
193  switch( GetHorizJustify() )
194  {
196  if( IsMirrored() )
197  rect.SetX( rect.GetX() - rect.GetWidth() );
198  break;
199 
201  rect.SetX( rect.GetX() - (rect.GetWidth() / 2) );
202  break;
203 
205  if( !IsMirrored() )
206  rect.SetX( rect.GetX() - rect.GetWidth() );
207  break;
208  }
209 
210  dy = GetTextHeight() + thickness;
211 
212  switch( GetVertJustify() )
213  {
215  break;
216 
218  rect.SetY( rect.GetY() - ( dy / 2) );
219  break;
220 
222  rect.SetY( rect.GetY() - dy );
223  break;
224  }
225 
226  if( linecount > 1 )
227  {
228  int yoffset;
229  linecount -= 1;
230 
231  switch( GetVertJustify() )
232  {
234  break;
235 
237  yoffset = linecount * GetInterline() / 2;
238  rect.SetY( rect.GetY() - yoffset );
239  break;
240 
242  yoffset = linecount * GetInterline( aThickness );
243  rect.SetY( rect.GetY() - yoffset );
244  break;
245  }
246  }
247 
248  rect.Normalize(); // Make h and v sizes always >= 0
249 
250  return rect;
251 }
252 
253 
254 bool EDA_TEXT::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
255 {
256  EDA_RECT rect = GetTextBox( -1 ); // Get the full text area.
257  wxPoint location = aPoint;
258 
259  rect.Inflate( aAccuracy );
260  RotatePoint( &location, GetTextPos(), -GetTextAngle() );
261 
262  return rect.Contains( location );
263 }
264 
265 
266 bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
267 {
268  EDA_RECT rect = aRect;
269 
270  rect.Inflate( aAccuracy );
271 
272  if( aContains )
273  return rect.Contains( GetTextBox( -1 ) );
274 
275  return rect.Intersects( GetTextBox( -1 ), GetTextAngle() );
276 }
277 
278 
279 void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
280  COLOR4D aColor, GR_DRAWMODE aDrawMode,
281  EDA_DRAW_MODE_T aFillMode, COLOR4D aAnchor_color )
282 {
283  if( IsMultilineAllowed() )
284  {
285  std::vector<wxPoint> positions;
286  wxArrayString strings;
287  wxStringSplit( GetShownText(), strings, '\n' );
288 
289  positions.reserve( strings.Count() );
290 
291  GetPositionsOfLinesOfMultilineText( positions, strings.Count() );
292 
293  for( unsigned ii = 0; ii < strings.Count(); ii++ )
294  {
295  wxString& txt = strings.Item( ii );
296  drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
297  aDrawMode, aFillMode, txt, positions[ii] );
298  }
299  }
300  else
301  drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
302  aDrawMode, aFillMode, GetShownText(), GetTextPos() );
303 
304  // Draw text anchor, if requested
305  if( aAnchor_color != COLOR4D::UNSPECIFIED )
306  {
307  GRDrawAnchor( aClipBox, aDC,
308  GetTextPos().x + aOffset.x, GetTextPos().y + aOffset.y,
309  DIM_ANCRE_TEXTE, aAnchor_color );
310  }
311 }
312 
313 
315  std::vector<wxPoint>& aPositions, int aLineCount ) const
316 {
317  wxPoint pos = GetTextPos(); // Position of first line of the
318  // multiline text according to
319  // the center of the multiline text block
320 
321  wxPoint offset; // Offset to next line.
322 
323  offset.y = GetInterline();
324 
325  if( aLineCount > 1 )
326  {
327  switch( GetVertJustify() )
328  {
330  break;
331 
333  pos.y -= ( aLineCount - 1 ) * offset.y / 2;
334  break;
335 
337  pos.y -= ( aLineCount - 1 ) * offset.y;
338  break;
339  }
340  }
341 
342  // Rotate the position of the first line
343  // around the center of the multiline text block
344  RotatePoint( &pos, GetTextPos(), GetTextAngle() );
345 
346  // Rotate the offset lines to increase happened in the right direction
347  RotatePoint( &offset, GetTextAngle() );
348 
349  for( int ii = 0; ii < aLineCount; ii++ )
350  {
351  aPositions.push_back( pos );
352  pos += offset;
353  }
354 }
355 
356 void EDA_TEXT::drawOneLineOfText( EDA_RECT* aClipBox, wxDC* aDC,
357  const wxPoint& aOffset, COLOR4D aColor,
358  GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
359  const wxString& aText, const wxPoint &aPos )
360 {
361  int width = GetThickness();
362 
363  if( aDrawMode != UNSPECIFIED_DRAWMODE )
364  GRSetDrawMode( aDC, aDrawMode );
365 
366  if( aFillMode == SKETCH )
367  width = -width;
368 
369  wxSize size = GetTextSize();
370 
371  if( IsMirrored() )
372  size.x = -size.x;
373 
374  DrawGraphicText( aClipBox, aDC, aOffset + aPos, aColor, aText, GetTextAngle(), size,
376  width, IsItalic(), IsBold() );
377 }
378 
379 
381 {
382  int style = 0;
383 
384  if( IsItalic() )
385  style = 1;
386 
387  if( IsBold() )
388  style += 2;
389 
390  wxString stylemsg[4] = {
391  _("Normal"),
392  _("Italic"),
393  _("Bold"),
394  _("Bold+Italic")
395  };
396 
397  return stylemsg[style];
398 }
399 
400 
402 {
403  return ( GetTextWidth() == Mils2iu( DEFAULT_SIZE_TEXT )
404  && GetTextHeight() == Mils2iu( DEFAULT_SIZE_TEXT )
405  && IsVisible()
406  && !IsMirrored()
409  && GetThickness() == 0
410  && !IsItalic()
411  && !IsBold()
412  && !IsMultilineAllowed()
413  );
414 }
415 
416 
417 void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
418 {
419 #ifndef GERBVIEW // Gerbview does not use EDA_TEXT::Format
420  // and does not define FMT_IU, used here
421  // however this function should exist
422  if( !IsDefaultFormatting() )
423  {
424  aFormatter->Print( aNestLevel+1, "(effects" );
425 
426  if( ( GetTextWidth() != Mils2iu( DEFAULT_SIZE_TEXT ) )
427  || ( GetTextHeight() != Mils2iu( DEFAULT_SIZE_TEXT ) )
428  || ( GetThickness() != 0 ) || IsBold() || IsItalic() )
429  {
430  aFormatter->Print( 0, " (font" );
431 
432  // Add font support here at some point in the future.
433 
434  if( GetTextWidth() != Mils2iu( DEFAULT_SIZE_TEXT )
435  || GetTextHeight() != Mils2iu( DEFAULT_SIZE_TEXT ) )
436  {
437  aFormatter->Print( 0, " (size %s %s)",
438  FMT_IU( GetTextHeight() ).c_str(),
439  FMT_IU( GetTextWidth() ).c_str()
440  );
441  }
442 
443  if( GetThickness() )
444  aFormatter->Print( 0, " (thickness %s)", FMT_IU( GetThickness() ).c_str() );
445 
446  if( IsBold() )
447  aFormatter->Print( 0, " bold" );
448 
449  if( IsItalic() )
450  aFormatter->Print( 0, " italic" );
451 
452  aFormatter->Print( 0, ")");
453  }
454 
457  {
458  aFormatter->Print( 0, " (justify");
459 
461  aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
462 
464  aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
465 
466  if( IsMirrored() )
467  aFormatter->Print( 0, " mirror" );
468 
469  aFormatter->Print( 0, ")" );
470  }
471 
472  if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() )
473  aFormatter->Print( 0, " hide" );
474 
475  aFormatter->Print( 0, ")\n" );
476  }
477 #endif
478 }
479 
480 // Convert the text shape to a list of segment
481 // each segment is stored as 2 wxPoints: its starting point and its ending point
482 // we are using DrawGraphicText to create the segments.
483 // and therefore a call-back function is needed
484 static std::vector<wxPoint>* s_cornerBuffer;
485 
486 // This is a call back function, used by DrawGraphicText to put each segment in buffer
487 static void addTextSegmToBuffer( int x0, int y0, int xf, int yf )
488 {
489  s_cornerBuffer->push_back( wxPoint( x0, y0 ) );
490  s_cornerBuffer->push_back( wxPoint( xf, yf ) );
491 }
492 
493 void EDA_TEXT::TransformTextShapeToSegmentList( std::vector<wxPoint>& aCornerBuffer ) const
494 {
495  wxSize size = GetTextSize();
496 
497  if( IsMirrored() )
498  size.x = -size.x;
499 
500  s_cornerBuffer = &aCornerBuffer;
501  COLOR4D color = COLOR4D::BLACK; // not actually used, but needed by DrawGraphicText
502 
503  if( IsMultilineAllowed() )
504  {
505  wxArrayString strings_list;
506  wxStringSplit( GetShownText(), strings_list, wxChar('\n') );
507  std::vector<wxPoint> positions;
508  positions.reserve( strings_list.Count() );
509  GetPositionsOfLinesOfMultilineText( positions,strings_list.Count() );
510 
511  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
512  {
513  wxString txt = strings_list.Item( ii );
514  DrawGraphicText( NULL, NULL, positions[ii], color,
515  txt, GetTextAngle(), size,
517  GetThickness(), IsItalic(),
518  true, addTextSegmToBuffer );
519  }
520  }
521  else
522  {
523  DrawGraphicText( NULL, NULL, GetTextPos(), color,
524  GetText(), GetTextAngle(), size,
526  GetThickness(), IsItalic(),
527  true, addTextSegmToBuffer );
528  }
529 }
EDA_TEXT(const wxString &text=wxEmptyString)
Definition: eda_text.cpp:41
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Function wxStringSplit splits aString to a string list separated at aSplitter.
Definition: common.cpp:137
void SetFontItalic(const bool aItalic)
Set italic property of current font.
int GetInterline(int aTextThickness=-1) const
Return the distance between two lines of text.
Definition: eda_text.cpp:94
static double GetInterline(double aGlyphHeight, double aGlyphThickness)
Compute the distance (interline) between 2 lines of text (for multiline texts).
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), PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
Definition: drawtxt.cpp:122
void SwapEffects(EDA_TEXT &aTradingPartner)
Function SwapEffects swaps the text effects of the two involved instances.
Definition: eda_text.cpp:61
void Move(const wxPoint &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:74
bool IsMultilineAllowed() const
Definition: eda_text.h:188
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:79
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:296
const wxPoint & GetTextPos() const
Definition: eda_text.h:224
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
bool IsItalic() const
Definition: eda_text.h:170
bool Contains(const wxPoint &aPoint) const
Function Contains.
void SetEffects(const EDA_TEXT &aSrc)
Function SetEffects sets the text effects from another instance.
Definition: eda_text.cpp:55
TEXT_EFFECTS m_e
Definition: eda_text.h:368
int GetTextWidth() const
Definition: eda_text.h:218
void SetOrigin(const wxPoint &pos)
void GRDrawAnchor(EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, COLOR4D aColor)
Definition: gr_basic.cpp:1266
Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a conve...
Definition: richio.h:327
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:214
static std::vector< wxPoint > * s_cornerBuffer
Definition: eda_text.cpp:484
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
Definition of base KiCad text object.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:190
VECTOR2D ComputeStringBoundaryLimits(const UTF8 &aText, VECTOR2D aGlyphSize, double aGlyphThickness, double *aTopLimit=NULL, double *aBottomLimit=NULL) const
Compute the boundary limits of aText (the bbox of all shapes).
double GetTextAngle() const
Definition: eda_text.h:164
bool IsBold() const
Definition: eda_text.h:173
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:356
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:154
This file contains miscellaneous commonly used macros and functions.
bool IsDefaultFormatting() const
Definition: eda_text.cpp:401
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:135
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels...
Definition: eda_text.h:114
void SetFontBold(const bool aBold)
Set bold property of current font.
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:102
#define FMT_IU
Abbrevation for fomatting internal units to a string.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Function TextHitTest Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:254
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
virtual void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
Function Format outputs the object to aFormatter in s-expression form.
Definition: eda_text.cpp:417
EDA_DRAW_MODE_T
Definition: eda_text.h:62
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
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:314
void SetX(int val)
virtual ~EDA_TEXT()
Definition: eda_text.cpp:50
#define DIM_ANCRE_TEXTE
Definition: eda_text.h:75
void SetY(int val)
void Normalize()
Function Normalize ensures that the height ant width are positive.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:191
void SetSize(const wxSize &size)
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
wxString GetTextStyleName()
Function GetTextStyleName.
Definition: eda_text.cpp:380
#define max(a, b)
Definition: auxiliary.h:86
bool IsMirrored() const
Definition: eda_text.h:179
bool IsVisible() const
Definition: eda_text.h:176
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 ...
Definition: eda_text.cpp:493
Class EDA_RECT handles the component boundary box.
int GetX() const
double ComputeOverbarVerticalPosition(double aGlyphHeight, double aGlyphThickness) const
Compute the vertical position of an overbar, sometimes used in texts.
int GetWidth() const
int GetY() const
int GetTextHeight() const
Definition: eda_text.h:221
This file is part of the common libary.
void SetGlyphSize(const VECTOR2D aGlyphSize)
Set the font glyph size.
BASIC_GAL basic_gal(basic_displayOptions)
Definition: colors.h:45
const STROKE_FONT & GetStrokeFont() const
const wxSize & GetTextSize() const
Definition: eda_text.h:215
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
int LenSize(const wxString &aLine) const
Function LenSize.
Definition: eda_text.cpp:67
static void addTextSegmToBuffer(int x0, int y0, int xf, int yf)
Definition: eda_text.cpp:487
#define CTL_OMIT_HIDE
Definition: eda_text.h:42
VECTOR2D GetTextLineSize(const UTF8 &aText) const
Compute the X and Y size of a given text.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
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.
Definition: eda_text.cpp:279
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39