Chemical Data Processing Library C++ API - Version 1.0.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 
70  Font(const std::string& family, double size = 12.0);
71 
76  void setFamily(const std::string& family);
77 
82  const std::string& getFamily() const;
83 
91  void setSize(double size);
92 
97  double getSize() const;
98 
103  void setBold(bool flag);
104 
109  bool isBold() const;
110 
115  void setItalic(bool flag);
116 
121  bool isItalic() const;
122 
127  void setUnderlined(bool flag);
128 
133  bool isUnderlined() const;
134 
139  void setOverlined(bool flag);
140 
145  bool isOverlined() const;
146 
151  void setStrikedOut(bool flag);
152 
157  bool isStrikedOut() const;
158 
163  void setFixedPitch(bool flag);
164 
169  bool hasFixedPitch() const;
170 
176  bool operator==(const Font& font) const;
177 
186  bool operator!=(const Font& font) const;
187 
188  private:
189  std::string family;
190  double size;
191  bool bold;
192  bool italic;
193  bool underlined;
194  bool overlined;
195  bool strikedOut;
196  bool fixedPitch;
197  };
198  } // namespace Vis
199 } // namespace CDPL
200 
201 #endif // CDPL_VIS_FONT_HPP
CDPL::Vis::Font::setFamily
void setFamily(const std::string &family)
Sets the font family name.
CDPL::Vis::Font::isUnderlined
bool isUnderlined() const
Returns the flag specifying whether text is rendered underlined.
CDPL::Vis::Font::setItalic
void setItalic(bool flag)
Sets or clears the flag specifying whether text should be rendered italicized.
CDPL::Vis::Font::Font
Font()
Constructs a font object with an unspecified family name and a font size of 12.0.
CDPL::Vis::Font::isStrikedOut
bool isStrikedOut() const
Returns the flag specifying whether text is rendered striked-out.
CDPL::Vis::Font
Specifies a font for drawing text.
Definition: Font.hpp:54
CDPL::Vis::Font::isBold
bool isBold() const
Returns the flag specifying whether text is rendered bold.
CDPL::Vis::Font::isOverlined
bool isOverlined() const
Returns the flag specifying whether text is rendered overlined.
CDPL::Vis::Font::hasFixedPitch
bool hasFixedPitch() const
Returns the fixed pitch flag.
CDPL_VIS_API
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Vis::Font::setBold
void setBold(bool flag)
Sets or clears the flag specifying whether text should be rendered bold.
CDPL::Vis::Font::setSize
void setSize(double size)
Sets the font size.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Vis::Font::isItalic
bool isItalic() const
Returns the flag specifying whether text is rendered italicized.
CDPL::Vis::Font::Font
Font(const std::string &family, double size=12.0)
Constructs a font object with the specified font family name and font size.
CDPL::Vis::Font::getFamily
const std::string & getFamily() const
Returns the font family name.
CDPL::Vis::Font::setUnderlined
void setUnderlined(bool flag)
Sets or clears the flag specifying whether text should be rendered underlined.
CDPL::Vis::Font::setOverlined
void setOverlined(bool flag)
Sets or clears the flag specifying whether text should be rendered overlined.
CDPL::Vis::Font::operator==
bool operator==(const Font &font) const
Equality comparison operator.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_VIS_API.
CDPL::Vis::Font::setStrikedOut
void setStrikedOut(bool flag)
Sets or clears the flag specifying whether text should be rendered striked-out.
CDPL::Vis::Font::getSize
double getSize() const
Returns the font size.
CDPL::Vis::Font::setFixedPitch
void setFixedPitch(bool flag)
Sets or clears the fixed pitch flag.
CDPL::Vis::Font::operator!=
bool operator!=(const Font &font) const
Inequality comparison operator.