Tulip  5.7.4
Large graphs analysis and drawing
TulipIconicFont.h
1 /*
2  *
3  * This file is part of Tulip (https://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 .woff2 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 getWOFF2Location(const std::string &iconName);
48 
49  /**
50  * Checks if the provided icon name is supported
51  * @param iconName the name of the icon to check support
52  */
53  static bool isIconSupported(const std::string &iconName);
54 
55  /**
56  * Returns the Unicode code point associated to an icon name
57  * @param iconName the name of the icon to get the codepoint
58  */
59  static unsigned int getIconCodePoint(const std::string &iconName);
60 
61  /**
62  * Returns the font family name associated to an icon name
63  * @param iconName the icon name
64  */
65  static std::string getIconFamily(const std::string &iconName);
66 
67  /**
68  * Returns the font style name associated to an icon name
69  * @param iconName the icon name
70  */
71  static std::string getIconStyle(const std::string &iconName);
72 
73  /**
74  * Returns an UTF-8 encoded string of a Font Awesome icon
75  * @param iconName the icon name
76  * @return
77  */
78  static std::string getIconUtf8String(const std::string &iconName);
79 };
80 } // namespace tlp
81 
82 #endif // TULIPFONTICONIC_H
83 
84 ///@endcond