KiCad PCB EDA Suite
Loading...
Searching...
No Matches
text_attributes.h File Reference
#include <math/vector2d.h>
#include <gal/color4d.h>
#include <geometry/eda_angle.h>
#include <gal/gal.h>

Go to the source code of this file.

Classes

class  TEXT_ATTRIBUTES
 
struct  std::hash< TEXT_ATTRIBUTES >
 

Namespaces

namespace  KIFONT
 

Enumerations

enum  GR_TEXT_H_ALIGN_T { GR_TEXT_H_ALIGN_LEFT = -1 , GR_TEXT_H_ALIGN_CENTER = 0 , GR_TEXT_H_ALIGN_RIGHT = 1 , GR_TEXT_H_ALIGN_INDETERMINATE }
 
enum  GR_TEXT_V_ALIGN_T { GR_TEXT_V_ALIGN_TOP = -1 , GR_TEXT_V_ALIGN_CENTER = 0 , GR_TEXT_V_ALIGN_BOTTOM = 1 , GR_TEXT_V_ALIGN_INDETERMINATE }
 

Functions

constexpr GR_TEXT_H_ALIGN_T GetFlippedAlignment (GR_TEXT_H_ALIGN_T aAlign)
 Get the reverse alignment: left-right are swapped, others are unchanged.
 
constexpr GR_TEXT_V_ALIGN_T GetFlippedAlignment (GR_TEXT_V_ALIGN_T aAlign)
 Get the reverse alignment: top-bottom are swapped, others are unchanged.
 
constexpr GR_TEXT_H_ALIGN_T ToHAlignment (int x)
 Convert an integral value to horizontal alignment.
 
GAL_API std::ostream & operator<< (std::ostream &aStream, const TEXT_ATTRIBUTES &aAttributes)
 

Enumeration Type Documentation

◆ GR_TEXT_H_ALIGN_T

Enumerator
GR_TEXT_H_ALIGN_LEFT 
GR_TEXT_H_ALIGN_CENTER 
GR_TEXT_H_ALIGN_RIGHT 
GR_TEXT_H_ALIGN_INDETERMINATE 

Definition at line 42 of file text_attributes.h.

◆ GR_TEXT_V_ALIGN_T

Enumerator
GR_TEXT_V_ALIGN_TOP 
GR_TEXT_V_ALIGN_CENTER 
GR_TEXT_V_ALIGN_BOTTOM 
GR_TEXT_V_ALIGN_INDETERMINATE 

Definition at line 51 of file text_attributes.h.

Function Documentation

◆ GetFlippedAlignment() [1/2]

constexpr GR_TEXT_H_ALIGN_T GetFlippedAlignment ( GR_TEXT_H_ALIGN_T  aAlign)
constexpr

Get the reverse alignment: left-right are swapped, others are unchanged.

Definition at line 64 of file text_attributes.h.

References GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_INDETERMINATE, GR_TEXT_H_ALIGN_LEFT, and GR_TEXT_H_ALIGN_RIGHT.

Referenced by KIGFX::PIN_TEXTS::GetTextPlacement(), AUTOPLACER::justifyField(), SCH_EDIT_TOOL::Mirror(), and SYMBOL_EDITOR_EDIT_TOOL::Mirror().

◆ GetFlippedAlignment() [2/2]

constexpr GR_TEXT_V_ALIGN_T GetFlippedAlignment ( GR_TEXT_V_ALIGN_T  aAlign)
constexpr

Get the reverse alignment: top-bottom are swapped, others are unchanged.

Definition at line 85 of file text_attributes.h.

References GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_INDETERMINATE, and GR_TEXT_V_ALIGN_TOP.

◆ operator<<()

◆ ToHAlignment()

constexpr GR_TEXT_H_ALIGN_T ToHAlignment ( int  x)
constexpr

Convert an integral value to horizontal alignment.

  • x < 0: Left align
  • x == 0: Center
  • x > 0: Right align

Definition at line 108 of file text_attributes.h.

References GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, and GR_TEXT_H_ALIGN_RIGHT.

Referenced by AUTOPLACER::justifyField().