ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
hdps::FontAwesome Class Reference

#include <FontAwesome.h>

Inheritance diagram for hdps::FontAwesome:
hdps::IconFont

Public Member Functions

 FontAwesome (const std::uint32_t &majorVersion=5, const std::uint32_t &minorVersion=14)
 
 ~FontAwesome ()
 
void initialize () override
 
QString getIconCharacter (const QString &iconName) const override
 
- Public Member Functions inherited from hdps::IconFont
 IconFont (const QString &name, const std::uint32_t &majorVersion, const std::uint32_t &minorVersion)
 
QString getName () const
 
QString getFullName () const
 
std::uint32_t getMajorVersion () const
 
std::uint32_t getMinorVersion () const
 
QString getVersionString () const
 
QFont getFont (const int &pointSize=-1) const
 
QIcon getIcon (const QString &name, const QColor &foregroundColor=QColor(0, 0, 0, 255), const QColor &backgroundColor=Qt::transparent) const
 

Additional Inherited Members

- Static Public Member Functions inherited from hdps::IconFont
static QString getSearchVersionString (const std::int32_t &majorVersion=-1, const std::int32_t &minorVersion=-1)
 
- Protected Attributes inherited from hdps::IconFont
QString _name
 
std::uint32_t _majorVersion
 
std::uint32_t _minorVersion
 
QString _fontResourceName
 
QString _fontFamily
 
QMap< QString, QString > _characters
 

Detailed Description

Font Awesome icon font class

Follow the steps below to install a Font Awesome icon font

  1. Download a version of Font Awesome from this location: https://fontawesome.com/download
  2. Extract the zip file and note the major and minor version ([MAJOR_VERSION], [MINOR_VERSION])
  3. Copy the font from /otfs/Font Awesome x Free-Solid-900.otf to /core/HDPS/res/iconfonts and rename the file to: FontAwesome-[MAJOR_VERSION].[MINOR_VERSION].otf
  4. Copy the meta data file from /metadata/icons.json to core/HDPS/res/iconfonts and rename the file to: FontAwesome-[MAJOR_VERSION].[MINOR_VERSION].json
  5. Open /core/HDPS/res/ResourcesCore.qrc in a text editor and add two entries:
  6. <qresource prefix="/IconFonts"> ... <file alias="FontAwesome-[MAJOR_VERSION].[MINOR_VERSION].otf">iconfonts/FontAwesome-[MAJOR_VERSION].[MINOR_VERSION].otf</file> <file alias="FontAwesome-[MAJOR_VERSION].[MINOR_VERSION].json">iconfonts/FontAwesome-[MAJOR_VERSION].[MINOR_VERSION].json</file> </qresource>
  7. Add the font in the hdsp::Application constructor: _iconFonts.add(QSharedPointer<IconFont>(new FontAwesome([MAJOR_VERSION], [MINOR_VERSION])));
Author
Thomas Kroes

Constructor & Destructor Documentation

◆ FontAwesome()

hdps::FontAwesome::FontAwesome ( const std::uint32_t &  majorVersion = 5,
const std::uint32_t &  minorVersion = 14 
)

Constructor

Parameters
majorVersionMajor version number
minorVersionMinor version number

◆ ~FontAwesome()

hdps::FontAwesome::~FontAwesome ( )
inline

Destructor

Member Function Documentation

◆ getIconCharacter()

QString hdps::FontAwesome::getIconCharacter ( const QString &  iconName) const
overridevirtual

Converts human readable icon name to icon character (unicode)

Parameters
iconNameName of the icon
returnIcon character (unicode)

Implements hdps::IconFont.

◆ initialize()

void hdps::FontAwesome::initialize ( )
overridevirtual

Initializes the icon font A typical implementation builds a mapping from icon name to icon character (unicode)

Reimplemented from hdps::IconFont.


The documentation for this class was generated from the following files: