LibrePCB Developers Documentation
stroketextpathbuilder.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (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 <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_STROKETEXTPATHBUILDER_H
21#define LIBREPCB_CORE_STROKETEXTPATHBUILDER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../geometry/path.h"
27#include "../types/length.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Alignment;
37class StrokeFont;
38class StrokeTextSpacing;
39
40/*******************************************************************************
41 * Class StrokeTextPathBuilder
42 ******************************************************************************/
43
48 Q_DECLARE_TR_FUNCTIONS(StrokeTextPathBuilder)
49
50public:
51 // Constructors / Destructor
55
56 // Static Methods
57 static QVector<Path> build(const StrokeFont& font,
58 const StrokeTextSpacing& letterSpacing,
59 const StrokeTextSpacing& lineSpacing,
60 const PositiveLength& height,
61 const UnsignedLength& strokeWidth,
62 const Alignment& align, const Angle& rotation,
63 bool autoRotate, const QString& text) noexcept;
64 static Length calcLetterSpacing(const StrokeFont& font,
65 const StrokeTextSpacing& spacing,
66 const PositiveLength& height,
67 const UnsignedLength& strokeWidth) noexcept;
68 static Length calcLineSpacing(const StrokeFont& font,
69 const StrokeTextSpacing& spacing,
70 const PositiveLength& height,
71 const UnsignedLength& strokeWidth) noexcept;
72
73 // Operator Overloadings
75};
76
77/*******************************************************************************
78 * End of File
79 ******************************************************************************/
80
81} // namespace librepcb
82
83#endif
The Alignment class.
Definition: alignment.h:115
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The StrokeFont class.
Definition: strokefont.h:56
The StrokeTextPathBuilder class.
Definition: stroketextpathbuilder.h:47
StrokeTextPathBuilder(const StrokeTextPathBuilder &other)=delete
static QVector< Path > build(const StrokeFont &font, const StrokeTextSpacing &letterSpacing, const StrokeTextSpacing &lineSpacing, const PositiveLength &height, const UnsignedLength &strokeWidth, const Alignment &align, const Angle &rotation, bool autoRotate, const QString &text) noexcept
Definition: stroketextpathbuilder.cpp:40
static Length calcLineSpacing(const StrokeFont &font, const StrokeTextSpacing &spacing, const PositiveLength &height, const UnsignedLength &strokeWidth) noexcept
Definition: stroketextpathbuilder.cpp:74
static Length calcLetterSpacing(const StrokeFont &font, const StrokeTextSpacing &spacing, const PositiveLength &height, const UnsignedLength &strokeWidth) noexcept
Definition: stroketextpathbuilder.cpp:59
StrokeTextPathBuilder & operator=(const StrokeTextPathBuilder &rhs)=delete
Represents the letter- or line spacing configuration of a stroke text.
Definition: stroketextspacing.h:44
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696