Tulip  5.4.0
Large graphs analysis and drawing
TulipIconicFont.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip 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.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 ///@cond DOXYGEN_HIDDEN
21 
22 #ifndef TULIPICONICFONT_H
23 #define TULIPICONICFONT_H
24 
25 #include <tulip/tulipconf.h>
26 
27 namespace tlp {
28 
29 /**
30  * @brief Helper class to ease the use of iconic fonts bundled with Tulip
31  */
32 class TLP_GL_SCOPE TulipIconicFont {
33 
34 public:
35  /**
36  * Returns the location of the TrueType font file bundled with Tulip
37  * defining the icon with the given name
38  * @param iconName the name of the icon
39  */
40  static std::string getTTFLocation(const std::string &iconName);
41 
42  /**
43  * Returns the location of the .woff font file bundled with Tulip
44  * defining the icon with the given name
45  * @param iconName the name of the icon
46  */
47  static std::string getWOFFLocation(const std::string &iconName);
48 
49  /**
50  * Returns the location of the .woff2 font file bundled with Tulip
51  * defining the icon with the given name
52  * @param iconName the name of the icon
53  */
54  static std::string getWOFF2Location(const std::string &iconName);
55 
56  /**
57  * Checks if the provided icon name is supported
58  * @param iconName the name of the icon to check support
59  */
60  static bool isIconSupported(const std::string &iconName);
61 
62  /**
63  * Returns the Unicode code point associated to an icon name
64  * @param iconName the name of the icon to get the codepoint
65  */
66  static unsigned int getIconCodePoint(const std::string &iconName);
67 
68  /**
69  * Returns the font family name associated to an icon name
70  * @param iconName the icon name
71  */
72  static std::string getIconFamily(const std::string &iconName);
73 
74  /**
75  * Returns an UTF-8 encoded string of a Font Awesome icon
76  * @param iconName the icon name
77  * @return
78  */
79  static std::string getIconUtf8String(const std::string &iconName);
80 };
81 } // namespace tlp
82 
83 #endif // TULIPFONTICONIC_H
84 
85 ///@endcond