KiCad PCB EDA Suite
Loading...
Searching...
No Matches
target3001_fonts.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 The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef TARGET3001_FONTS_H
21
#define TARGET3001_FONTS_H
22
23
#include <map>
24
#include <tuple>
25
26
#include <
math/vector2d.h
>
27
#include <wx/string.h>
28
29
class
EDA_TEXT
;
30
31
namespace
KIFONT
32
{
33
class
OUTLINE_FONT
;
34
}
35
36
namespace
TARGET3001
37
{
38
39
struct
ELEMENT
;
40
54
class
FONTS
55
{
56
public
:
64
void
Apply
(
EDA_TEXT
* aText,
const
ELEMENT
& aElem,
int
aUnit );
65
74
static
VECTOR2I
BaselineShift
(
const
EDA_TEXT
& aText );
75
76
private
:
77
bool
applyTrueType
(
EDA_TEXT
* aText,
const
ELEMENT
& aElem,
int
aUnit );
78
79
std::map<std::tuple<wxString, bool, bool>,
KIFONT::OUTLINE_FONT
*>
m_fonts
;
80
std::map<const KIFONT::OUTLINE_FONT*, double>
m_averageWidth
;
81
};
82
83
}
// namespace TARGET3001
84
85
#endif
// TARGET3001_FONTS_H
EDA_TEXT
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition
eda_text.h:94
KIFONT::OUTLINE_FONT
Implement outline font drawing.
Definition
outline_font.h:49
TARGET3001::FONTS
Maps TARGET 3001!
Definition
target3001_fonts.h:55
TARGET3001::FONTS::applyTrueType
bool applyTrueType(EDA_TEXT *aText, const ELEMENT &aElem, int aUnit)
Definition
target3001_fonts.cpp:248
TARGET3001::FONTS::BaselineShift
static VECTOR2I BaselineShift(const EDA_TEXT &aText)
Offset in text units that moves aText so the baseline-left point of its first glyph lies on its posit...
Definition
target3001_fonts.cpp:219
TARGET3001::FONTS::m_fonts
std::map< std::tuple< wxString, bool, bool >, KIFONT::OUTLINE_FONT * > m_fonts
Definition
target3001_fonts.h:79
TARGET3001::FONTS::m_averageWidth
std::map< const KIFONT::OUTLINE_FONT *, double > m_averageWidth
per unit of text size
Definition
target3001_fonts.h:80
TARGET3001::FONTS::Apply
void Apply(EDA_TEXT *aText, const ELEMENT &aElem, int aUnit)
Give aText the font, style, size and stroke width of text aElem.
Definition
target3001_fonts.cpp:160
KIFONT
Definition
target3001_fonts.h:32
TARGET3001
Reader for TARGET 3001!
Definition
target3001_fonts.cpp:39
ELEMENT
One element of any class.
Definition
target3001_parser.h:357
TARGET3001::ELEMENT
One element of any class.
Definition
target3001_parser.h:357
vector2d.h
VECTOR2I
VECTOR2< int32_t > VECTOR2I
Definition
vector2d.h:708
src
common
io
target3001
target3001_fonts.h
Generated on Fri Oct 23 2026 00:06:15 for KiCad PCB EDA Suite by
1.13.2