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 <draw_graphic_text.h>
32 #include <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 <base_units.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  m_shown_text = UnescapeString( text );
48 }
49 
50 
51 EDA_TEXT::EDA_TEXT( const EDA_TEXT& aText ) :
52  m_Text( aText.m_Text ),
53  m_e( aText.m_e )
54 {
56 }
57 
58 
60 {
61 }
62 
63 
64 void EDA_TEXT::SetText( const wxString& aText )
65 {
66  m_Text = aText;
67  m_shown_text = UnescapeString( aText );
68 }
69 
70 
71 void EDA_TEXT::SetEffects( const EDA_TEXT& aSrc )
72 {
73  m_e = aSrc.m_e;
74 }
75 
76 
77 void EDA_TEXT::SwapEffects( EDA_TEXT& aTradingPartner )
78 {
79  std::swap( m_e, aTradingPartner.m_e );
80 }
81 
82 
83 int EDA_TEXT::LenSize( const wxString& aLine, int aThickness ) const
84 {
87  basic_gal.SetLineWidth( aThickness );
89 
90  VECTOR2D tsize = basic_gal.GetTextLineSize( aLine );
91 
92  return KiROUND( tsize.x );
93 }
94 
95 
97 {
98  wxString tmp = GetShownText();
99 
100  tmp.Replace( wxT( "\n" ), wxT( " " ) );
101  tmp.Replace( wxT( "\r" ), wxT( " " ) );
102  tmp.Replace( wxT( "\t" ), wxT( " " ) );
103 
104  if( tmp.Length() > 15 )
105  tmp = tmp.Left( 12 ) + wxT( "..." );
106 
107  return tmp;
108 }
109 
110 
111 int EDA_TEXT::GetInterline( int aTextThickness ) const
112 {
113  int thickness = aTextThickness <= 0 ? GetThickness() : aTextThickness;
114 
115  return KiROUND( KIGFX::STROKE_FONT::GetInterline( GetTextHeight(), thickness ) );
116 }
117 
118 
119 EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const
120 {
121  EDA_RECT rect;
122  wxArrayString strings;
123  wxString text = GetShownText();
124  int thickness = ( aThickness < 0 ) ? GetThickness() : aThickness;
125  int linecount = 1;
126  bool hasOverBar = false; // true if the first line of text as an overbar
127 
128  if( IsMultilineAllowed() )
129  {
130  wxStringSplit( text, strings, '\n' );
131 
132  if( strings.GetCount() ) // GetCount() == 0 for void strings
133  {
134  if( aLine >= 0 && (aLine < (int)strings.GetCount()) )
135  text = strings.Item( aLine );
136  else
137  text = strings.Item( 0 );
138 
139  linecount = strings.GetCount();
140  }
141  }
142 
143  // Search for overbar symbol. Only text is scanned,
144  // because only this line can change the bounding box
145  for( unsigned ii = 1; ii < text.size(); ii++ )
146  {
147  if( text[ii-1] == '~' && text[ii] != '~' )
148  {
149  hasOverBar = true;
150  break;
151  }
152  }
153 
154  // calculate the H and V size
156  text, VECTOR2D( GetTextSize() ), double( thickness ) ).x );
157  int dy = GetInterline( thickness );
158 
159  // Creates bounding box (rectangle) for an horizontal
160  // and left and top justified text. the bounding box will be moved later
161  // according to the actual text options
162  wxSize textsize = wxSize( dx, dy );
163  wxPoint pos = GetTextPos();
164 
165  if( aInvertY )
166  pos.y = -pos.y;
167 
168  rect.SetOrigin( pos );
169 
170  // The bbox vertical size returned by GetInterline( aThickness )
171  // includes letters like j and y and ] + interval between lines.
172  // The interval below the last line is not usefull, and we can use its half value
173  // as vertical margin above the text
174  // the full interval is roughly GetTextHeight() * 0.4 - aThickness/2
175  rect.Move( wxPoint( 0, thickness/4 - KiROUND( GetTextHeight() * 0.22 ) ) );
176 
177  if( hasOverBar )
178  { // A overbar adds an extra size to the text
179  // Height from the base line text of chars like [ or {
180  double curr_height = GetTextHeight() * 1.15;
181  int extra_height = KiROUND(
182  basic_gal.GetStrokeFont().ComputeOverbarVerticalPosition( GetTextHeight(), thickness ) - curr_height );
183  extra_height += thickness/2;
184  textsize.y += extra_height;
185  rect.Move( wxPoint( 0, -extra_height ) );
186  }
187 
188  // for multiline texts and aLine < 0, merge all rectangles
189  // ( if aLine < 0, we want the full text bounding box )
190  if( IsMultilineAllowed() && aLine < 0 )
191  {
192  for( unsigned ii = 1; ii < strings.GetCount(); ii++ )
193  {
194  text = strings.Item( ii );
196  text, VECTOR2D( GetTextSize() ), double( thickness ) ).x );
197  textsize.x = std::max( textsize.x, dx );
198  textsize.y += dy;
199  }
200  }
201 
202  rect.SetSize( textsize );
203 
204  /* Now, calculate the rect origin, according to text justification
205  * At this point the rectangle origin is the text origin (m_Pos).
206  * This is true only for left and top text justified texts (using top to bottom Y axis
207  * orientation). and must be recalculated for others justifications
208  * also, note the V justification is relative to the first line
209  */
210  switch( GetHorizJustify() )
211  {
213  if( IsMirrored() )
214  rect.SetX( rect.GetX() - rect.GetWidth() );
215  break;
216 
218  rect.SetX( rect.GetX() - (rect.GetWidth() / 2) );
219  break;
220 
222  if( !IsMirrored() )
223  rect.SetX( rect.GetX() - rect.GetWidth() );
224  break;
225  }
226 
227  dy = GetTextHeight() + thickness;
228 
229  switch( GetVertJustify() )
230  {
232  break;
233 
235  rect.SetY( rect.GetY() - ( dy / 2) );
236  break;
237 
239  rect.SetY( rect.GetY() - dy );
240  break;
241  }
242 
243  if( linecount > 1 )
244  {
245  int yoffset;
246  linecount -= 1;
247 
248  switch( GetVertJustify() )
249  {
251  break;
252 
254  yoffset = linecount * GetInterline() / 2;
255  rect.SetY( rect.GetY() - yoffset );
256  break;
257 
259  yoffset = linecount * GetInterline( aThickness );
260  rect.SetY( rect.GetY() - yoffset );
261  break;
262  }
263  }
264 
265  rect.Normalize(); // Make h and v sizes always >= 0
266 
267  return rect;
268 }
269 
270 
271 bool EDA_TEXT::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
272 {
273  EDA_RECT rect = GetTextBox( -1 ); // Get the full text area.
274  wxPoint location = aPoint;
275 
276  rect.Inflate( aAccuracy );
277  RotatePoint( &location, GetTextPos(), -GetTextAngle() );
278 
279  return rect.Contains( location );
280 }
281 
282 
283 bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
284 {
285  EDA_RECT rect = aRect;
286 
287  rect.Inflate( aAccuracy );
288 
289  if( aContains )
290  return rect.Contains( GetTextBox( -1 ) );
291 
292  return rect.Intersects( GetTextBox( -1 ), GetTextAngle() );
293 }
294 
295 
296 void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
297  COLOR4D aColor, GR_DRAWMODE aDrawMode,
298  EDA_DRAW_MODE_T aFillMode, COLOR4D aAnchor_color )
299 {
300  if( IsMultilineAllowed() )
301  {
302  std::vector<wxPoint> positions;
303  wxArrayString strings;
304  wxStringSplit( GetShownText(), strings, '\n' );
305 
306  positions.reserve( strings.Count() );
307 
308  GetPositionsOfLinesOfMultilineText( positions, strings.Count() );
309 
310  for( unsigned ii = 0; ii < strings.Count(); ii++ )
311  {
312  wxString& txt = strings.Item( ii );
313  drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
314  aDrawMode, aFillMode, txt, positions[ii] );
315  }
316  }
317  else
318  drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
319  aDrawMode, aFillMode, GetShownText(), GetTextPos() );
320 
321  // Draw text anchor, if requested
322  if( aAnchor_color != COLOR4D::UNSPECIFIED )
323  {
324  GRDrawAnchor( aClipBox, aDC,
325  GetTextPos().x + aOffset.x, GetTextPos().y + aOffset.y,
326  DIM_ANCRE_TEXTE, aAnchor_color );
327  }
328 }
329 
330 
332  std::vector<wxPoint>& aPositions, int aLineCount ) const
333 {
334  wxPoint pos = GetTextPos(); // Position of first line of the
335  // multiline text according to
336  // the center of the multiline text block
337 
338  wxPoint offset; // Offset to next line.
339 
340  offset.y = GetInterline();
341 
342  if( aLineCount > 1 )
343  {
344  switch( GetVertJustify() )
345  {
347  break;
348 
350  pos.y -= ( aLineCount - 1 ) * offset.y / 2;
351  break;
352 
354  pos.y -= ( aLineCount - 1 ) * offset.y;
355  break;
356  }
357  }
358 
359  // Rotate the position of the first line
360  // around the center of the multiline text block
361  RotatePoint( &pos, GetTextPos(), GetTextAngle() );
362 
363  // Rotate the offset lines to increase happened in the right direction
364  RotatePoint( &offset, GetTextAngle() );
365 
366  for( int ii = 0; ii < aLineCount; ii++ )
367  {
368  aPositions.push_back( pos );
369  pos += offset;
370  }
371 }
372 
373 void EDA_TEXT::drawOneLineOfText( EDA_RECT* aClipBox, wxDC* aDC,
374  const wxPoint& aOffset, COLOR4D aColor,
375  GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
376  const wxString& aText, const wxPoint &aPos )
377 {
378  int width = GetThickness();
379 
380  if( aDrawMode != UNSPECIFIED_DRAWMODE )
381  GRSetDrawMode( aDC, aDrawMode );
382 
383  if( aFillMode == SKETCH )
384  width = -width;
385 
386  wxSize size = GetTextSize();
387 
388  if( IsMirrored() )
389  size.x = -size.x;
390 
391  DrawGraphicText( aClipBox, aDC, aOffset + aPos, aColor, aText, GetTextAngle(), size,
393  width, IsItalic(), IsBold() );
394 }
395 
396 
398 {
399  int style = 0;
400 
401  if( IsItalic() )
402  style = 1;
403 
404  if( IsBold() )
405  style += 2;
406 
407  wxString stylemsg[4] = {
408  _("Normal"),
409  _("Italic"),
410  _("Bold"),
411  _("Bold+Italic")
412  };
413 
414  return stylemsg[style];
415 }
416 
417 
419 {
420  return ( IsVisible()
421  && !IsMirrored()
424  && GetThickness() == 0
425  && !IsItalic()
426  && !IsBold()
427  && !IsMultilineAllowed()
428  );
429 }
430 
431 
432 void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
433 {
434 #ifndef GERBVIEW // Gerbview does not use EDA_TEXT::Format
435  // and does not define FormatInternalUnits, used here
436  // however this function should exist
437 
438  aFormatter->Print( aNestLevel + 1, "(effects" );
439 
440  // Text size
441  aFormatter->Print( 0, " (font" );
442 
443  aFormatter->Print( 0, " (size %s %s)",
444  FormatInternalUnits( GetTextHeight() ).c_str(),
445  FormatInternalUnits( GetTextWidth() ).c_str() );
446 
447  if( GetThickness() )
448  aFormatter->Print( 0, " (thickness %s)", FormatInternalUnits( GetThickness() ).c_str() );
449 
450  if( IsBold() )
451  aFormatter->Print( 0, " bold" );
452 
453  if( IsItalic() )
454  aFormatter->Print( 0, " italic" );
455 
456  aFormatter->Print( 0, ")"); // (font
457 
458  if( IsMirrored() ||
461  {
462  aFormatter->Print( 0, " (justify");
463 
465  aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
466 
468  aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
469 
470  if( IsMirrored() )
471  aFormatter->Print( 0, " mirror" );
472  aFormatter->Print( 0, ")" ); // (justify
473  }
474 
475  if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() )
476  aFormatter->Print( 0, " hide" );
477 
478  aFormatter->Print( 0, ")\n" ); // (justify
479 
480 #endif
481 }
482 
483 // Convert the text shape to a list of segment
484 // each segment is stored as 2 wxPoints: its starting point and its ending point
485 // we are using DrawGraphicText to create the segments.
486 // and therefore a call-back function is needed
487 
488 // This is a call back function, used by DrawGraphicText to put each segment in buffer
489 static void addTextSegmToBuffer( int x0, int y0, int xf, int yf, void* aData )
490 {
491  std::vector<wxPoint>* cornerBuffer = static_cast<std::vector<wxPoint>*>( aData );
492  cornerBuffer->push_back( wxPoint( x0, y0 ) );
493  cornerBuffer->push_back( wxPoint( xf, yf ) );
494 }
495 
496 void EDA_TEXT::TransformTextShapeToSegmentList( std::vector<wxPoint>& aCornerBuffer ) const
497 {
498  wxSize size = GetTextSize();
499 
500  if( IsMirrored() )
501  size.x = -size.x;
502 
503  COLOR4D color = COLOR4D::BLACK; // not actually used, but needed by DrawGraphicText
504 
505  if( IsMultilineAllowed() )
506  {
507  wxArrayString strings_list;
508  wxStringSplit( GetShownText(), strings_list, wxChar('\n') );
509  std::vector<wxPoint> positions;
510  positions.reserve( strings_list.Count() );
511  GetPositionsOfLinesOfMultilineText( positions,strings_list.Count() );
512 
513  for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
514  {
515  wxString txt = strings_list.Item( ii );
516  DrawGraphicText( NULL, NULL, positions[ii], color,
517  txt, GetTextAngle(), size,
519  GetThickness(), IsItalic(),
520  true, addTextSegmToBuffer, &aCornerBuffer );
521  }
522  }
523  else
524  {
525  DrawGraphicText( NULL, NULL, GetTextPos(), color,
526  GetText(), GetTextAngle(), size,
528  GetThickness(), IsItalic(),
529  true, addTextSegmToBuffer, &aCornerBuffer );
530  }
531 }
const STROKE_FONT & GetStrokeFont() const
EDA_TEXT(const wxString &text=wxEmptyString)
Definition: eda_text.cpp:41
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
Definition: common.cpp:188
void SetFontItalic(const bool aItalic)
Set italic property of current font.
bool IsBold() const
Definition: eda_text.h:190
static double GetInterline(double aGlyphHeight, double aGlyphThickness)
Compute the distance (interline) between 2 lines of text (for multiline texts).
void SwapEffects(EDA_TEXT &aTradingPartner)
Function SwapEffects swaps the text effects of the two involved instances.
Definition: eda_text.cpp:77
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:88
wxString m_Text
Definition: eda_text.h:378
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:208
bool IsMirrored() const
Definition: eda_text.h:196
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
Implementation of conversion functions that require both schematic and board internal units.
int GetX() const
Definition: eda_rect.h:109
wxString m_shown_text
Cache of unescaped text for efficient access.
Definition: eda_text.h:381
bool IsVisible() const
Definition: eda_text.h:193
void SetEffects(const EDA_TEXT &aSrc)
Function SetEffects sets the text effects from another instance.
Definition: eda_text.cpp:71
TEXT_EFFECTS m_e
Definition: eda_text.h:406
int color
Definition: DXF_plotter.cpp:62
int GetInterline(int aTextThickness=-1) const
Return the distance between two lines of text.
Definition: eda_text.cpp:111
int GetWidth() const
Definition: eda_rect.h:117
static void addTextSegmToBuffer(int x0, int y0, int xf, int yf, void *aData)
Definition: eda_text.cpp:489
double GetTextAngle() const
Definition: eda_text.h:181
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
void GRDrawAnchor(EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, COLOR4D aColor)
Definition: gr_basic.cpp:1193
Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a conve...
Definition: richio.h:327
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:171
virtual const wxString GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:147
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:231
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
Definition of base KiCad text object.
VECTOR2D GetTextLineSize(const UTF8 &aText) const
Compute the X and Y size of a given text.
bool Contains(const wxPoint &aPoint) const
Function Contains.
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)
virtual void SetLineWidth(float aLineWidth)
Set the line width.
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:373
This file contains miscellaneous commonly used macros and functions.
int GetTextHeight() const
Definition: eda_text.h:238
bool IsItalic() const
Definition: eda_text.h:187
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels,...
Definition: eda_text.h:128
void SetFontBold(const bool aBold)
Set bold property of current font.
int LenSize(const wxString &aLine, int aThickness) const
Function LenSize.
Definition: eda_text.cpp:83
double ComputeOverbarVerticalPosition(double aGlyphHeight, double aGlyphThickness) const
Compute the vertical position of an overbar, sometimes used in texts.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:207
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:64
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:119
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
EDA_DRAW_MODE_T
Definition: eda_text.h:78
const wxSize & GetTextSize() const
Definition: eda_text.h:232
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:496
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:96
void SetX(int val)
Definition: eda_rect.h:130
virtual ~EDA_TEXT()
Definition: eda_text.cpp:59
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:432
VECTOR2D ComputeStringBoundaryLimits(const UTF8 &aText, const VECTOR2D &aGlyphSize, double aGlyphThickness) const
Compute the boundary limits of aText (the bounding box of all shapes).
bool IsDefaultFormatting() const
Definition: eda_text.cpp:418
#define DIM_ANCRE_TEXTE
Definition: eda_text.h:89
bool IsMultilineAllowed() const
Definition: eda_text.h:205
void SetY(int val)
Definition: eda_rect.h:131
void Normalize()
Function Normalize ensures that the height ant width are positive.
void SetSize(const wxSize &size)
Definition: eda_rect.h:126
int GetTextWidth() const
Definition: eda_text.h:235
wxString GetTextStyleName()
Function GetTextStyleName.
Definition: eda_text.cpp:397
#define max(a, b)
Definition: auxiliary.h:86
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:123
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
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:271
int GetY() const
Definition: eda_rect.h:110
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
const wxPoint & GetTextPos() const
Definition: eda_text.h:241
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:331
void SetGlyphSize(const VECTOR2D aGlyphSize)
Set the font glyph size.
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:152
BASIC_GAL basic_gal(basic_displayOptions)
Definition: colors.h:45
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:58
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:457
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:296
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39