KiCad PCB EDA Suite
lib_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) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <common.h>
25#include <sch_draw_panel.h>
26#include <plotters/plotter.h>
27#include <trigo.h>
28#include <base_units.h>
29#include <widgets/msgpanel.h>
30#include <bitmaps.h>
31#include <eda_draw_frame.h>
32#include <lib_item.h>
33#include <general.h>
34#include <transform.h>
36#include <lib_text.h>
37#include <default_values.h> // For some default values
38#include <string_utils.h>
39
41 LIB_ITEM( LIB_TEXT_T, aParent ),
42 EDA_TEXT( schIUScale, wxEmptyString )
43{
46}
47
48
49void LIB_TEXT::ViewGetLayers( int aLayers[], int& aCount ) const
50{
51 aCount = 2;
53 aLayers[1] = LAYER_SELECTION_SHADOWS;
54}
55
56
57bool LIB_TEXT::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
58{
59 EDA_TEXT tmp_text( *this );
61
62 /* The text orientation may need to be flipped if the
63 * transformation matrix causes xy axes to be flipped.
64 * this simple algo works only for schematic matrix (rot 90 or/and mirror)
65 */
66 bool t1 = ( DefaultTransform.x1 != 0 ) ^ ( GetTextAngle() != ANGLE_HORIZONTAL );
67
69 return tmp_text.TextHitTest( aPosition, aAccuracy );
70}
71
72
74{
75 LIB_TEXT* newitem = new LIB_TEXT( nullptr );
76
77 newitem->m_parent = m_parent;
78 newitem->m_unit = m_unit;
79 newitem->m_convert = m_convert;
80 newitem->m_private = m_private;
81 newitem->m_flags = m_flags;
82
83 newitem->SetText( GetText() );
84 newitem->SetAttributes( *this );
85
86 return newitem;
87}
88
89
90int LIB_TEXT::compare( const LIB_ITEM& aOther, int aCompareFlags ) const
91{
92 wxASSERT( aOther.Type() == LIB_TEXT_T );
93
94 int retv = LIB_ITEM::compare( aOther, aCompareFlags );
95
96 if( retv )
97 return retv;
98
99 const LIB_TEXT* tmp = ( LIB_TEXT* ) &aOther;
100
101 int result = GetText().CmpNoCase( tmp->GetText() );
102
103 if( result != 0 )
104 return result;
105
106 if( GetTextPos().x != tmp->GetTextPos().x )
107 return GetTextPos().x - tmp->GetTextPos().x;
108
109 if( GetTextPos().y != tmp->GetTextPos().y )
110 return GetTextPos().y - tmp->GetTextPos().y;
111
112 if( GetTextWidth() != tmp->GetTextWidth() )
113 return GetTextWidth() - tmp->GetTextWidth();
114
115 if( GetTextHeight() != tmp->GetTextHeight() )
116 return GetTextHeight() - tmp->GetTextHeight();
117
118 return 0;
119}
120
121
122void LIB_TEXT::Offset( const VECTOR2I& aOffset )
123{
124 EDA_TEXT::Offset( aOffset );
125}
126
127
128void LIB_TEXT::MoveTo( const VECTOR2I& newPosition )
129{
130 SetTextPos( newPosition );
131}
132
133
135{
136 VECTOR2I delta( 0, 0 );
137 BOX2I bbox = GetTextBox();
138
139 if( GetTextAngle().IsHorizontal() )
140 {
142 delta.x = bbox.GetWidth() / 2;
144 delta.x = - bbox.GetWidth() / 2;
145
147 delta.y = - bbox.GetHeight() / 2;
149 delta.y = bbox.GetHeight() / 2;
150 }
151 else
152 {
154 delta.y = bbox.GetWidth() / 2;
156 delta.y = - bbox.GetWidth() / 2;
157
159 delta.x = + bbox.GetHeight() / 2;
161 delta.x = - bbox.GetHeight() / 2;
162 }
163
164 if( inverse )
166 else
168}
169
170
172{
173 NormalizeJustification( false );
174 int x = GetTextPos().x;
175
176 x -= center.x;
177 x *= -1;
178 x += center.x;
179
180 if( GetTextAngle().IsHorizontal() )
181 {
186 }
187 else
188 {
193 }
194
195 SetTextX( x );
197}
198
199
201{
202 NormalizeJustification( false );
203 int y = GetTextPos().y;
204
205 y -= center.y;
206 y *= -1;
207 y += center.y;
208
209 if( GetTextAngle().IsHorizontal() )
210 {
215 }
216 else
217 {
222 }
223
224 SetTextY( y );
226}
227
228
229void LIB_TEXT::Rotate( const VECTOR2I& center, bool aRotateCCW )
230{
231 NormalizeJustification( false );
232 EDA_ANGLE rot_angle = aRotateCCW ? -ANGLE_90 : ANGLE_90;
233
234 VECTOR2I pt = GetTextPos();
235 RotatePoint( pt, center, rot_angle );
236 SetTextPos( pt );
237
238 if( GetTextAngle().IsHorizontal() )
239 {
241 }
242 else
243 {
244 // 180° rotation is a mirror
245
250
255
257 }
258
260}
261
262
263void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const VECTOR2I& offset,
264 const TRANSFORM& aTransform, bool aDimmed ) const
265{
266 wxASSERT( plotter != nullptr );
267
268 if( IsPrivate() )
269 return;
270
271 if( aBackground )
272 return;
273
274 RENDER_SETTINGS* settings = plotter->RenderSettings();
275
276 BOX2I bBox = GetBoundingBox();
277 // convert coordinates from draw Y axis to symbol_editor Y axis
278 bBox.RevertYAxis();
279 VECTOR2I txtpos = bBox.Centre();
281
282 if( attrs.m_Angle == ANGLE_VERTICAL )
283 {
284 switch( attrs.m_Halign )
285 {
286 case GR_TEXT_H_ALIGN_LEFT: txtpos.y = bBox.GetTop(); break;
287 case GR_TEXT_H_ALIGN_CENTER: txtpos.y = bBox.GetCenter().y; break;
288 case GR_TEXT_H_ALIGN_RIGHT: txtpos.y = bBox.GetBottom(); break;
289 }
290 }
291 else
292 {
293 switch( attrs.m_Halign )
294 {
295 case GR_TEXT_H_ALIGN_LEFT: txtpos.x = bBox.GetLeft(); break;
296 case GR_TEXT_H_ALIGN_CENTER: txtpos.x = bBox.GetCenter().x; break;
297 case GR_TEXT_H_ALIGN_RIGHT: txtpos.x = bBox.GetRight(); break;
298 }
299 }
300
301 // The text orientation may need to be flipped if the transformation matrix causes xy
302 // axes to be flipped.
303 int t1 = ( aTransform.x1 != 0 ) ^ ( GetTextAngle() != ANGLE_HORIZONTAL );
304 VECTOR2I pos = aTransform.TransformCoordinate( txtpos ) + offset;
306 COLOR4D bg = settings->GetBackgroundColor();
307
308 if( !plotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
309 color = settings->GetLayerColor( LAYER_DEVICE );
310
311 if( !IsVisible() )
312 bg = settings->GetLayerColor( LAYER_HIDDEN );
313 else if( bg == COLOR4D::UNSPECIFIED || !plotter->GetColorMode() )
314 bg = COLOR4D::WHITE;
315
316 if( aDimmed )
317 {
318 color.Desaturate( );
319 color = color.Mix( bg, 0.5f );
320 }
321
322 int penWidth = std::max( GetEffectiveTextPenWidth(), settings->GetMinPenWidth() );
323
324 KIFONT::FONT* font = GetFont();
325
326 if( !font )
327 font = KIFONT::FONT::GetFont( settings->GetDefaultFont(), IsBold(), IsItalic() );
328
329 attrs.m_StrokeWidth = penWidth;
331
332 plotter->PlotText( pos, color, GetText(), attrs, font );
333}
334
335
337{
339}
340
341
343{
345
346 if( !font )
348
349 return font;
350}
351
352
353void LIB_TEXT::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, void* aData,
354 const TRANSFORM& aTransform, bool aDimmed )
355{
356 wxDC* DC = aSettings->GetPrintDC();
358 bool blackAndWhiteMode = GetGRForceBlackPenState();
359 int penWidth = std::max( GetEffectiveTextPenWidth(), aSettings->GetDefaultPenWidth() );
360
361 if( blackAndWhiteMode || color == COLOR4D::UNSPECIFIED )
362 color = aSettings->GetLayerColor( LAYER_DEVICE );
363
364 COLOR4D bg = aSettings->GetBackgroundColor();
365
366 if( bg == COLOR4D::UNSPECIFIED || GetGRForceBlackPenState() )
367 bg = COLOR4D::WHITE;
368
369 if( !IsVisible() )
370 bg = aSettings->GetLayerColor( LAYER_HIDDEN );
371
372 if( aDimmed )
373 {
374 color.Desaturate( );
375 color = color.Mix( bg, 0.5f );
376 }
377
378 // Calculate the text orientation, according to the symbol orientation/mirror (needed when
379 // draw text in schematic)
380 EDA_ANGLE orient = GetTextAngle();
381
382 if( aTransform.y1 ) // Rotate symbol 90 degrees.
383 {
384 if( orient == ANGLE_HORIZONTAL )
385 orient = ANGLE_VERTICAL;
386 else
387 orient = ANGLE_HORIZONTAL;
388 }
389
390 KIFONT::FONT* font = GetFont();
391
392 if( !font )
393 font = KIFONT::FONT::GetFont( aSettings->GetDefaultFont(), IsBold(), IsItalic() );
394
395 /*
396 * Calculate the text justification, according to the symbol orientation/mirror.
397 * This is a bit complicated due to cumulative calculations:
398 * - numerous cases (mirrored or not, rotation)
399 * - the GRText function will also recalculate H and V justifications according to the text
400 * orientation.
401 * - When a symbol is mirrored, the text is not mirrored and justifications are complicated
402 * to calculate so the more easily way is to use no justifications (centered text) and
403 * use GetBoundingBox to know the text coordinate considered as centered
404 */
405 BOX2I bBox = GetBoundingBox();
406
407 // convert coordinates from draw Y axis to symbol_editor Y axis:
408 bBox.RevertYAxis();
409 VECTOR2I txtpos = bBox.Centre();
410
411 // Calculate pos according to mirror/rotation.
412 txtpos = aTransform.TransformCoordinate( txtpos ) + aOffset;
413
415 GR_TEXT_V_ALIGN_CENTER, penWidth, IsItalic(), IsBold(), font );
416}
417
418
419void LIB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
420{
421 wxString msg;
422
423 LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
424
425 // Don't use GetShownText() here; we want to show the user the variable references
426 aList.emplace_back( _( "Text" ), UnescapeString( GetText() ) );
427
428 aList.emplace_back( _( "Font" ), GetFont() ? GetFont()->GetName() : _( "Default" ) );
429
430 aList.emplace_back( _( "Style" ), GetTextStyleName() );
431
432 aList.emplace_back( _( "Text Size" ), aFrame->MessageTextFromValue( GetTextWidth() ) );
433
434 switch ( GetHorizJustify() )
435 {
436 case GR_TEXT_H_ALIGN_LEFT: msg = _( "Left" ); break;
437 case GR_TEXT_H_ALIGN_CENTER: msg = _( "Center" ); break;
438 case GR_TEXT_H_ALIGN_RIGHT: msg = _( "Right" ); break;
439 }
440
441 aList.emplace_back( _( "H Justification" ), msg );
442
443 switch ( GetVertJustify() )
444 {
445 case GR_TEXT_V_ALIGN_TOP: msg = _( "Top" ); break;
446 case GR_TEXT_V_ALIGN_CENTER: msg = _( "Center" ); break;
447 case GR_TEXT_V_ALIGN_BOTTOM: msg = _( "Bottom" ); break;
448 }
449
450 aList.emplace_back( _( "V Justification" ), msg );
451}
452
453
455{
456 /* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when
457 * calling GetTextBox() that works using top to bottom Y axis orientation.
458 */
459 BOX2I bbox = GetTextBox( -1, true );
460 bbox.RevertYAxis();
461
462 // We are using now a bottom to top Y axis.
463 VECTOR2I orig = bbox.GetOrigin();
464 VECTOR2I end = bbox.GetEnd();
465
466 RotatePoint( orig, GetTextPos(), -GetTextAngle() );
467 RotatePoint( end, GetTextPos(), -GetTextAngle() );
468
469 bbox.SetOrigin( orig );
470 bbox.SetEnd( end );
471
472 // We are using now a top to bottom Y axis:
473 bbox.RevertYAxis();
474
475 return bbox;
476}
477
478
479wxString LIB_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
480{
481 return wxString::Format( _( "Graphic Text '%s'" ), KIUI::EllipsizeMenuText( GetShownText() ) );
482}
483
484
486{
487 return BITMAPS::text;
488}
489
490
491void LIB_TEXT::BeginEdit( const VECTOR2I& aPosition )
492{
493 SetTextPos( aPosition );
494}
495
496
497void LIB_TEXT::CalcEdit( const VECTOR2I& aPosition )
498{
499 SetTextPos( aPosition );
500}
int color
Definition: DXF_plotter.cpp:57
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
void SetOrigin(const Vec &pos)
Definition: box2.h:202
const Vec & GetOrigin() const
Definition: box2.h:183
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
Definition: box2.h:689
const Vec GetCenter() const
Definition: box2.h:195
coord_type GetTop() const
Definition: box2.h:194
coord_type GetHeight() const
Definition: box2.h:188
coord_type GetWidth() const
Definition: box2.h:187
const Vec GetEnd() const
Definition: box2.h:185
Vec Centre() const
Definition: box2.h:70
coord_type GetRight() const
Definition: box2.h:189
coord_type GetLeft() const
Definition: box2.h:193
coord_type GetBottom() const
Definition: box2.h:190
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:255
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:498
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:496
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
int GetTextHeight() const
Definition: eda_text.h:202
BOX2I GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition: eda_text.cpp:505
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:208
COLOR4D GetTextColor() const
Definition: eda_text.h:205
wxString GetTextStyleName() const
Definition: eda_text.cpp:738
bool IsItalic() const
Definition: eda_text.h:130
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:120
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:87
void SetAttributes(const EDA_TEXT &aSrc)
Set the text attributes from another instance.
Definition: eda_text.cpp:266
virtual bool IsVisible() const
Definition: eda_text.h:136
void SetTextPos(const VECTOR2I &aPoint)
Definition: eda_text.cpp:373
void SetTextX(int aX)
Definition: eda_text.cpp:379
KIFONT::FONT * GetFont() const
Definition: eda_text.h:188
void SetTextY(int aY)
Definition: eda_text.cpp:385
int GetTextWidth() const
Definition: eda_text.h:199
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
Definition: eda_text.cpp:250
void Offset(const VECTOR2I &aOffset)
Definition: eda_text.cpp:391
GR_TEXT_H_ALIGN_T GetHorizJustify() const
Definition: eda_text.h:149
virtual bool TextHitTest(const VECTOR2I &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:625
const TEXT_ATTRIBUTES & GetAttributes() const
Definition: eda_text.h:172
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
Definition: eda_text.cpp:299
bool IsBold() const
Definition: eda_text.h:133
GR_TEXT_V_ALIGN_T GetVertJustify() const
Definition: eda_text.h:152
void SetTextSize(const VECTOR2I &aNewSize)
Definition: eda_text.cpp:349
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:165
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
Definition: eda_text.cpp:195
virtual wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:98
VECTOR2I GetTextSize() const
Definition: eda_text.h:196
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition: eda_text.cpp:242
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:105
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
Definition: font.cpp:138
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:102
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
const wxString & GetDefaultFont() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
wxDC * GetPrintDC() const
The base class for drawable items used by schematic library symbols.
Definition: lib_item.h:61
bool IsPrivate() const
Definition: lib_item.h:279
const wxString & GetDefaultFont() const
Definition: lib_item.cpp:128
int m_convert
Shape identification for alternate body styles.
Definition: lib_item.h:333
virtual int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:74
bool m_private
Private items are shown only in the Symbol Editor.
Definition: lib_item.h:338
int m_unit
Unit identification for multiple parts per package.
Definition: lib_item.h:327
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
Definition: lib_item.cpp:47
Define a library symbol object.
Definition: lib_symbol.h:99
Define a symbol library graphical text item.
Definition: lib_text.h:40
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: lib_text.cpp:73
void MirrorHorizontal(const VECTOR2I &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
Definition: lib_text.cpp:171
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: lib_text.cpp:485
const BOX2I GetBoundingBox() const override
Definition: lib_text.cpp:454
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: lib_text.cpp:49
KIFONT::FONT * getDrawFont() const override
Definition: lib_text.cpp:342
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
Definition: lib_text.cpp:419
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
Definition: lib_text.cpp:229
void MoveTo(const VECTOR2I &aPosition) override
Move a draw object to aPosition.
Definition: lib_text.cpp:128
LIB_TEXT(LIB_SYMBOL *aParent)
Definition: lib_text.cpp:40
void NormalizeJustification(bool inverse)
Definition: lib_text.cpp:134
int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_text.cpp:90
void print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, void *aData, const TRANSFORM &aTransform, bool aDimmed) override
Print the item to aDC.
Definition: lib_text.cpp:353
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: lib_text.cpp:57
int GetPenWidth() const override
Definition: lib_text.cpp:336
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
Definition: lib_text.cpp:491
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: lib_text.cpp:479
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
Definition: lib_text.cpp:497
void Plot(PLOTTER *aPlotter, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed) const override
Plot the draw item using the plot object.
Definition: lib_text.cpp:263
void Offset(const VECTOR2I &aOffset) override
Set the drawing object by aOffset from the current position.
Definition: lib_text.cpp:122
void MirrorVertical(const VECTOR2I &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
Definition: lib_text.cpp:200
Base plotter engine class.
Definition: plotter.h:110
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:141
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr)
Definition: plotter.cpp:758
bool GetColorMode() const
Definition: plotter.h:138
GR_TEXT_H_ALIGN_T m_Halign
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:47
int y1
Definition: transform.h:50
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:46
int x1
Definition: transform.h:49
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
@ WHITE
Definition: color4d.h:46
The common library.
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
#define _(s)
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
Definition: eda_angle.h:425
static constexpr EDA_ANGLE & ANGLE_VERTICAL
Definition: eda_angle.h:426
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:431
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:429
bool GetGRForceBlackPenState(void)
Definition: gr_basic.cpp:165
void GRPrintText(wxDC *aDC, const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, KIFONT::FONT *aFont)
Print a graphic text through wxDC.
Definition: gr_text.cpp:141
@ LAYER_DEVICE
Definition: layer_ids.h:357
@ LAYER_HIDDEN
Definition: layer_ids.h:380
@ LAYER_PRIVATE_NOTES
Definition: layer_ids.h:359
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:381
Message panel definition file.
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
Definition: ui_common.cpp:215
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
wxString UnescapeString(const wxString &aSource)
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
constexpr int delta
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
TRANSFORM DefaultTransform
Definition: transform.cpp:34
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183
@ LIB_TEXT_T
Definition: typeinfo.h:200
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590