KiCad PCB EDA Suite
text_attributes.h
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) 2021 Ola Rinta-Koski
5 * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef TEXT_ATTRIBUTES_H
22#define TEXT_ATTRIBUTES_H
23
24#include <iostream>
25#include <wx/log.h>
26#include <cmath>
27#include <math/vector2d.h>
28#include <gal/color4d.h>
29#include "../../libs/kimath/include/geometry/eda_angle.h"
30
31class EDA_TEXT;
32
33namespace KIFONT
34{
35class FONT;
36};
37
38
39// Graphic Text alignments:
40//
41// NB: values -1,0,1 are used in computations, do not change them
42//
43
45{
49};
50
52{
56};
57
58
59#define TO_HJUSTIFY( x ) static_cast<GR_TEXT_H_ALIGN_T>( x )
60#define TO_VJUSTIFY( x ) static_cast<GR_TEXT_V_ALIGN_T>( x )
61
62
64{
65public:
66 KIFONT::FONT* m_Font = nullptr;
70 double m_LineSpacing = 1.0;
72 bool m_Italic = false;
73 bool m_Bold = false;
74 bool m_Underlined = false;
76 bool m_Visible = true;
77 bool m_Mirrored = false;
78 bool m_Multiline = true;
80
84 bool m_KeepUpright = false;
85};
86
87
88#endif //TEXT_ATTRIBUTES_H
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:105
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:390
bool m_KeepUpright
If true, keep rotation angle between -90...90 degrees for readability.
KIGFX::COLOR4D m_Color
GR_TEXT_H_ALIGN_T m_Halign
GR_TEXT_V_ALIGN_T m_Valign
KIFONT::FONT * m_Font
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:412
Definition: font.h:100
GR_TEXT_H_ALIGN_T
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
GR_TEXT_V_ALIGN_T
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP