KiCad PCB EDA Suite
eda_text.h File Reference
#include <memory>
#include <vector>
#include <outline_mode.h>
#include <eda_rect.h>

Go to the source code of this file.

Classes

struct  TSEGM_2_POLY_PRMS
 A helper for the text to polygon callback function. More...
 
struct  TEXT_EFFECTS
 A container for text effects. More...
 
class  EDA_TEXT
 A mix-in class (via multiple inheritance) that handles texts such as labels, parts, components, or footprints. More...
 

Namespaces

 KIGFX
 The Cairo implementation of the graphics abstraction layer.
 

Macros

#define TEXT_ANGLE_HORIZ   0
 Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to degrees eventually. More...
 
#define TEXT_ANGLE_VERT   900
 
#define CTL_OMIT_HIDE   (1 << 6)
 
#define DEFAULT_SIZE_TEXT   50
 This is the "default-of-the-default" hardcoded text size; individual application define their own default policy starting with this (usually with a user option or project). More...
 
#define DIM_ANCRE_TEXTE   2
 

Enumerations

enum  EDA_TEXT_HJUSTIFY_T { GR_TEXT_HJUSTIFY_LEFT = -1, GR_TEXT_HJUSTIFY_CENTER = 0, GR_TEXT_HJUSTIFY_RIGHT = 1 }
 
enum  EDA_TEXT_VJUSTIFY_T { GR_TEXT_VJUSTIFY_TOP = -1, GR_TEXT_VJUSTIFY_CENTER = 0, GR_TEXT_VJUSTIFY_BOTTOM = 1 }
 

Functions

void addTextSegmToPoly (int x0, int y0, int xf, int yf, void *aData)
 Callback function used to convert text segments to polygons. More...
 

Macro Definition Documentation

◆ CTL_OMIT_HIDE

#define CTL_OMIT_HIDE   (1 << 6)

Definition at line 77 of file eda_text.h.

◆ DEFAULT_SIZE_TEXT

#define DEFAULT_SIZE_TEXT   50

This is the "default-of-the-default" hardcoded text size; individual application define their own default policy starting with this (usually with a user option or project).

Definition at line 101 of file eda_text.h.

◆ DIM_ANCRE_TEXTE

#define DIM_ANCRE_TEXTE   2

Definition at line 102 of file eda_text.h.

◆ TEXT_ANGLE_HORIZ

#define TEXT_ANGLE_HORIZ   0

Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to degrees eventually.

Definition at line 71 of file eda_text.h.

◆ TEXT_ANGLE_VERT

#define TEXT_ANGLE_VERT   900

Definition at line 72 of file eda_text.h.

Enumeration Type Documentation

◆ EDA_TEXT_HJUSTIFY_T

Enumerator
GR_TEXT_HJUSTIFY_LEFT 
GR_TEXT_HJUSTIFY_CENTER 
GR_TEXT_HJUSTIFY_RIGHT 

Definition at line 82 of file eda_text.h.

◆ EDA_TEXT_VJUSTIFY_T

Enumerator
GR_TEXT_VJUSTIFY_TOP 
GR_TEXT_VJUSTIFY_CENTER 
GR_TEXT_VJUSTIFY_BOTTOM 

Definition at line 89 of file eda_text.h.

Function Documentation

◆ addTextSegmToPoly()

void addTextSegmToPoly ( int  x0,
int  y0,
int  xf,
int  yf,
void *  aData 
)

Callback function used to convert text segments to polygons.

Definition at line 65 of file eda_text.cpp.

66 {
67  TSEGM_2_POLY_PRMS* prm = static_cast<TSEGM_2_POLY_PRMS*>( aData );
68  TransformOvalToPolygon( *prm->m_cornerBuffer, wxPoint( x0, y0 ), wxPoint( xf, yf ),
69  prm->m_textWidth, prm->m_error, ERROR_INSIDE );
70 }
SHAPE_POLY_SET * m_cornerBuffer
Definition: eda_text.h:50
A helper for the text to polygon callback function.
Definition: eda_text.h:46
void TransformOvalToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aStart, const wxPoint &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.

References ERROR_INSIDE, TSEGM_2_POLY_PRMS::m_cornerBuffer, TSEGM_2_POLY_PRMS::m_error, TSEGM_2_POLY_PRMS::m_textWidth, and TransformOvalToPolygon().

Referenced by PCB_TEXT::TransformTextShapeWithClearanceToPolygon(), and FP_TEXT::TransformTextShapeWithClearanceToPolygon().