47#define TEXT_MIN_SIZE_MM  0.001     
   48#define TEXT_MAX_SIZE_MM  250.0     
   70#define DEFAULT_SIZE_TEXT   50      
   90    void Serialize( google::protobuf::Any &aContainer ) 
const override;
 
   91    bool Deserialize( 
const google::protobuf::Any &aContainer ) 
override;
 
  109    virtual wxString 
GetShownText( 
bool aAllowExtraText, 
int aDepth = 0 )
 const 
 
  119    virtual void SetText( 
const wxString& aText );
 
  250    bool ResolveFont( 
const std::vector<wxString>* aEmbeddedFonts );
 
  321    virtual bool TextHitTest( 
const BOX2I& aRect, 
bool aContains, 
int aAccuracy = 0 ) 
const;
 
  356                           int aLineCount ) 
const;
 
  385    std::vector<std::unique_ptr<KIFONT::GLYPH>>*
 
  387                    const VECTOR2I& aOffset = { 0, 0 } ) 
const;
 
  390    void SetupRenderCache( 
const wxString& aResolvedText, 
const KIFONT::FONT* aFont,
 
  391                           const EDA_ANGLE& aAngle, 
const VECTOR2I& aOffset );
 
  421    static bool IsGotoPageHref( 
const wxString& aHref, wxString* aDestination = 
nullptr );
 
  429    static wxString 
GotoPageHref( 
const wxString& aDestination );
 
 
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
 
int GetTextHeight() const
 
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
 
void SetTextColor(const COLOR4D &aColor)
 
const VECTOR2I & GetTextPos() const
 
COLOR4D GetTextColor() const
 
wxString GetTextStyleName() const
 
std::map< int, BBOX_CACHE_ENTRY > m_bbox_cache
 
bool IsDefaultFormatting() const
 
static bool IsGotoPageHref(const wxString &aHref, wxString *aDestination=nullptr)
Check if aHref is a valid internal hyperlink.
 
void SetFontProp(const wxString &aFontName)
 
std::vector< std::unique_ptr< KIFONT::GLYPH > > m_render_cache
 
wxString GetFontName() const
 
const EDA_ANGLE & GetTextAngle() const
 
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
 
void SetUnresolvedFontName(const wxString &aFontName)
 
bool IsMultilineAllowed() const
 
virtual const wxString & GetText() const
Return the string associated with the text object.
 
bool IsKeepUpright() const
 
virtual bool IsVisible() const
 
void SetTextPos(const VECTOR2I &aPoint)
 
bool m_shown_text_has_text_var_refs
 
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
 
KIFONT::FONT * GetFont() const
 
void SetAttributes(const TEXT_ATTRIBUTES &aTextAttrs)
 
bool ResolveFont(const std::vector< wxString > *aEmbeddedFonts)
 
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
 
void SetMirrored(bool isMirrored)
 
wxString GetFontProp() const
 
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache(const KIFONT::FONT *aFont, const wxString &forResolvedText, const VECTOR2I &aOffset={ 0, 0 }) const
 
const KIFONT::FONT * m_render_cache_font
 
virtual EDA_ANGLE GetDrawRotation() const
 
wxString m_unresolvedFontName
 
virtual VECTOR2I GetDrawPos() const
 
EDA_TEXT & operator=(const EDA_TEXT &aItem)
 
wxString m_hyperlink
A hyperlink URL.
 
BOX2I GetTextBox(const RENDER_SETTINGS *aSettings, int aLine=-1) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
 
virtual bool HasHyperlink() const
 
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
 
wxString GetHyperlink() const
 
void Offset(const VECTOR2I &aOffset)
 
virtual void Format(OUTPUTFORMATTER *aFormatter, int aControlBits) const
Output the object to aFormatter in s-expression form.
 
GR_TEXT_H_ALIGN_T GetHorizJustify() const
 
void SetTextWidth(int aWidth)
 
virtual KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const
 
void SetBoldFlag(bool aBold)
Set only the bold flag, without changing the font.
 
bool Replace(const EDA_SEARCH_DATA &aSearchData)
Helper function used in search and replace dialog.
 
void SetupRenderCache(const wxString &aResolvedText, const KIFONT::FONT *aFont, const EDA_ANGLE &aAngle, const VECTOR2I &aOffset)
 
int Compare(const EDA_TEXT *aOther) const
 
std::reference_wrapper< const EDA_IU_SCALE > m_IuScale
 
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
 
bool operator>(const EDA_TEXT &aRhs) const
 
std::mutex m_bbox_cacheMutex
 
virtual void SetVisible(bool aVisible)
 
EDA_TEXT(const EDA_IU_SCALE &aIuScale, const wxString &aText=wxEmptyString)
 
static wxString GotoPageHref(const wxString &aDestination)
Generate a href to a page in the current schematic.
 
virtual void ClearBoundingBoxCache()
 
bool GetAutoThickness() const
 
double GetLineSpacing() const
 
double Similarity(const EDA_TEXT &aOther) const
 
VECTOR2I m_render_cache_offset
 
void SetLineSpacing(double aLineSpacing)
 
wxString EvaluateText(const wxString &aText) const
 
void AddRenderCacheGlyph(const SHAPE_POLY_SET &aPoly)
 
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
 
virtual bool TextHitTest(const VECTOR2I &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
 
void SetTextHeight(int aHeight)
 
virtual void cacheShownText()
 
EDA_ANGLE m_render_cache_angle
 
static GR_TEXT_H_ALIGN_T MapHorizJustify(int aHorizJustify)
 
virtual void ClearRenderCache()
 
const TEXT_ATTRIBUTES & GetAttributes() const
 
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
 
static bool ValidateHyperlink(const wxString &aURL)
Check if aURL is a valid hyperlink.
 
void SetItalicFlag(bool aItalic)
Set only the italic flag, without changing the font.
 
void SetAutoThickness(bool aAuto)
 
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
 
void SwapAttributes(EDA_TEXT &aTradingPartner)
Swap the text attributes of the two involved instances.
 
wxString m_render_cache_text
 
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor)
Print this text object to the device context aDC.
 
double GetTextAngleDegrees() const
 
void GetLinePositions(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
 
virtual const KIFONT::METRICS & getFontMetrics() const
 
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape(bool aTriangulate=true, const BOX2I &aBBox=BOX2I(), const EDA_ANGLE &aAngle=ANGLE_0) const
build a list of segments (SHAPE_SEGMENT) to describe a text shape.
 
bool operator<(const EDA_TEXT &aRhs) const
 
void SetTextAngleDegrees(double aOrientation)
 
void SetHyperlink(wxString aLink)
 
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
 
void SetKeepUpright(bool aKeepUpright)
 
void CopyText(const EDA_TEXT &aSrc)
 
GR_TEXT_V_ALIGN_T GetVertJustify() const
 
int GetInterline(const RENDER_SETTINGS *aSettings) const
Return the distance between two lines of text.
 
int GetTextThicknessProperty() const
 
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
 
virtual void SetText(const wxString &aText)
 
double Levenshtein(const EDA_TEXT &aOther) const
Return the levenstein distance between two texts.
 
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
 
int GetTextThickness() const
 
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
 
void SwapText(EDA_TEXT &aTradingPartner)
 
bool operator==(const EDA_TEXT &aRhs) const
 
void SetMultilineAllowed(bool aAllow)
 
void SetFont(KIFONT::FONT *aFont)
 
void printOneLineOfText(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor, const wxString &aText, const VECTOR2I &aPos)
Print each line of this EDA_TEXT.
 
VECTOR2I GetTextSize() const
 
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
 
TEXT_ATTRIBUTES m_attributes
 
FONT is an abstract base class for both outline and stroke fonts.
 
A color representation with 4 components: red, green, blue, alpha.
 
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
 
Interface for objects that can be serialized to Protobuf messages.
 
Represent a set of closed polygons.
 
static constexpr EDA_ANGLE ANGLE_0
 
std::ostream & operator<<(std::ostream &aStream, const EDA_TEXT &aAttributes)
 
static constexpr std::size_t hash_val(const Types &... args)
 
The Cairo implementation of the graphics abstraction layer.
 
std::size_t operator()(const EDA_TEXT &aText) const
 
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
 
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
 
VECTOR2< int32_t > VECTOR2I