Chemical Data Processing Library C++ API - Version 1.2.0
Font.hpp
Go to the documentation of this file.
1 /*
2  * Font.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_VIS_FONT_HPP
30 #define CDPL_VIS_FONT_HPP
31 
32 #include <string>
33 
34 #include "CDPL/Vis/APIPrefix.hpp"
35 
36 
37 namespace CDPL
38 {
39 
40  namespace Vis
41  {
42 
54  {
55 
56  public:
60  Font();
61 
73  Font(const std::string& family, double size = 12.0, bool bold = false, bool italic = false);
74 
79  void setFamily(const std::string& family);
80 
85  const std::string& getFamily() const;
86 
94  void setSize(double size);
95 
100  double getSize() const;
101 
106  void setBold(bool flag);
107 
112  bool isBold() const;
113 
118  void setItalic(bool flag);
119 
124  bool isItalic() const;
125 
130  void setUnderlined(bool flag);
131 
136  bool isUnderlined() const;
137 
142  void setOverlined(bool flag);
143 
148  bool isOverlined() const;
149 
154  void setStrikedOut(bool flag);
155 
160  bool isStrikedOut() const;
161 
166  void setFixedPitch(bool flag);
167 
172  bool hasFixedPitch() const;
173 
179  bool operator==(const Font& font) const;
180 
189  bool operator!=(const Font& font) const;
190 
191  private:
192  std::string family;
193  double size;
194  bool bold;
195  bool italic;
196  bool underlined;
197  bool overlined;
198  bool strikedOut;
199  bool fixedPitch;
200  };
201  } // namespace Vis
202 } // namespace CDPL
203 
204 #endif // CDPL_VIS_FONT_HPP
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Specifies a font for drawing text.
Definition: Font.hpp:54
bool operator==(const Font &font) const
Equality comparison operator.
Font(const std::string &family, double size=12.0, bool bold=false, bool italic=false)
Constructs a font object with the specified font family name and font size.
void setUnderlined(bool flag)
Sets or clears the flag specifying whether text should be rendered underlined.
void setFamily(const std::string &family)
Sets the font family name.
bool isUnderlined() const
Returns the flag specifying whether text is rendered underlined.
void setStrikedOut(bool flag)
Sets or clears the flag specifying whether text should be rendered striked-out.
const std::string & getFamily() const
Returns the font family name.
void setItalic(bool flag)
Sets or clears the flag specifying whether text should be rendered italicized.
bool isOverlined() const
Returns the flag specifying whether text is rendered overlined.
void setBold(bool flag)
Sets or clears the flag specifying whether text should be rendered bold.
bool isStrikedOut() const
Returns the flag specifying whether text is rendered striked-out.
Font()
Constructs a font object with an unspecified family name and a font size of 12.0.
bool hasFixedPitch() const
Returns the fixed pitch flag.
bool isBold() const
Returns the flag specifying whether text is rendered bold.
void setSize(double size)
Sets the font size.
double getSize() const
Returns the font size.
bool isItalic() const
Returns the flag specifying whether text is rendered italicized.
void setFixedPitch(bool flag)
Sets or clears the fixed pitch flag.
void setOverlined(bool flag)
Sets or clears the flag specifying whether text should be rendered overlined.
bool operator!=(const Font &font) const
Inequality comparison operator.
The namespace of the Chemical Data Processing Library.