KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LABEL_BBOX_FIXTURE Struct Reference

Test fixture for label bounding box tests. More...

Public Member Functions

 LABEL_BBOX_FIXTURE ()
 
KIFONT::FONTGetFirstExistingOutlineFont ()
 
void CheckTextBoundingBoxWidth (const EDA_TEXT &aText, const wxString &aTestName, double aMaxWidthMultiplier=1.3)
 Helper function to check that a text bounding box is reasonable.
 
void CheckLabelBodyBoundingBox (SCH_LABEL_BASE &aLabel, const wxString &aTestName)
 Helper function to check label body bounding box.
 

Detailed Description

Test fixture for label bounding box tests.

Definition at line 33 of file test_label_bounding_box.cpp.

Constructor & Destructor Documentation

◆ LABEL_BBOX_FIXTURE()

LABEL_BBOX_FIXTURE::LABEL_BBOX_FIXTURE ( )
inline

Definition at line 35 of file test_label_bounding_box.cpp.

Member Function Documentation

◆ CheckLabelBodyBoundingBox()

void LABEL_BBOX_FIXTURE::CheckLabelBodyBoundingBox ( SCH_LABEL_BASE & aLabel,
const wxString & aTestName )
inline

Helper function to check label body bounding box.

Definition at line 116 of file test_label_bounding_box.cpp.

References BOOST_TEST_MESSAGE(), SCH_LABEL_BASE::GetBodyBoundingBox(), EDA_TEXT::GetTextBox(), and BOX2< Vec >::GetWidth().

◆ CheckTextBoundingBoxWidth()

void LABEL_BBOX_FIXTURE::CheckTextBoundingBoxWidth ( const EDA_TEXT & aText,
const wxString & aTestName,
double aMaxWidthMultiplier = 1.3 )
inline

Helper function to check that a text bounding box is reasonable.

The bounding box should contain the text without excessive empty space. For a left-justified text, the width should be approximately equal to the text width, not double it.

Definition at line 71 of file test_label_bounding_box.cpp.

References BOOST_TEST_MESSAGE(), EDA_TEXT::GetDrawFont(), EDA_TEXT::GetEffectiveTextPenWidth(), KIFONT::FONT::GetName(), EDA_TEXT::GetShownText(), EDA_TEXT::GetTextBox(), EDA_TEXT::GetTextSize(), BOX2< Vec >::GetWidth(), EDA_TEXT::IsBold(), EDA_TEXT::IsItalic(), KIFONT::FONT::StringBoundaryLimits(), text, and VECTOR2< T >::x.

◆ GetFirstExistingOutlineFont()

KIFONT::FONT * LABEL_BBOX_FIXTURE::GetFirstExistingOutlineFont ( )
inline

The documentation for this struct was generated from the following file: