Tulip  5.2.1
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 #ifndef TULIPICONICFONT_H
21 #define TULIPICONICFONT_H
22 
23 #include <tulip/tulipconf.h>
24 
25 namespace tlp {
26 
27 /**
28  * @brief Helper class to ease the use of iconic fonts bundled with Tulip
29  */
30 class TLP_GL_SCOPE TulipIconicFont {
31 
32 public:
33  /**
34  * Returns the location of the TrueType font file bundled with Tulip
35  * defining the icon with the given name
36  * @param iconName the name of the icon
37  */
38  static std::string getTTFLocation(const std::string &iconName);
39 
40  /**
41  * Returns the location of the .woff font file bundled with Tulip
42  * defining the icon with the given name
43  * @param iconName the name of the icon
44  */
45  static std::string getWOFFLocation(const std::string &iconName);
46 
47  /**
48  * Returns the location of the .woff2 font file bundled with Tulip
49  * defining the icon with the given name
50  * @param iconName the name of the icon
51  */
52  static std::string getWOFF2Location(const std::string &iconName);
53 
54  /**
55  * Checks if the provided icon name is supported
56  * @param iconName the name of the icon to check support
57  */
58  static bool isIconSupported(const std::string &iconName);
59 
60  /**
61  * Returns the Unicode code point associated to an icon name
62  * @param iconName the name of the icon to get the codepoint
63  */
64  static unsigned int getIconCodePoint(const std::string &iconName);
65 
66  /**
67  * Returns the font family name associated to an icon name
68  * @param iconName the icon name
69  */
70  static std::string getIconFamily(const std::string &iconName);
71 
72  /**
73  * Returns an UTF-8 encoded string of a Font Awesome icon
74  * @param iconName the icon name
75  * @return
76  */
77  static std::string getIconUtf8String(const std::string &iconName);
78 };
79 } // namespace tlp
80 
81 #endif // TULIPFONTICONIC_H
Helper class to ease the use of iconic fonts bundled with Tulip.