Skip to content

Commit

Permalink
Update to 6.3.0, Aliases and Sharp Regular Pro fonts
Browse files Browse the repository at this point in the history
- Aliases are now included in the icon list names
- Support for font style "Font Awesome Sharp Regular" (Pro)
- Update generator to include all alias names
- Update free font files to latest release
  • Loading branch information
gamecreature committed Feb 9, 2023
1 parent a6051c8 commit b304ec1
Show file tree
Hide file tree
Showing 13 changed files with 2,253 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.*
*.pro.user
*.pro.user*
CMakeLists.txt.user
/*build*

Expand Down
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changes

- (2023-02-09) Update to 6.3.0, Aliases and Sharp Regular Pro fonts
- Aliases are now included in the icon list names
- Support for font style "Font Awesome Sharp Regular" (Pro)
- Update generator to include all alias names
- Update free font files to latest release
- (2013-04-19) Initial release
5 changes: 5 additions & 0 deletions QtAwesome/QtAwesome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ const QString QtAwesome::FA_REGULAR_FONT_FILENAME = "pro/Font Awesome 6 Pro-Regu
const QString QtAwesome::FA_THIN_FONT_FILENAME = "pro/Font Awesome 6 Pro-Thin-100.otf";
const QString QtAwesome::FA_SOLID_FONT_FILENAME = "pro/Font Awesome 6 Pro-Solid-900.otf";
const QString QtAwesome::FA_SHARP_SOLID_FONT_FILENAME = "pro/Font Awesome 6 Sharp-Solid-900.otf";
const QString QtAwesome::FA_SHARP_REGULAR_FONT_FILENAME = "pro/Font Awesome 6 Sharp-Regular-400.otf";
#else
const QString QtAwesome::FA_REGULAR_FONT_FILENAME = "Font Awesome 6 Free-Regular-400.otf";
const QString QtAwesome::FA_SOLID_FONT_FILENAME = "Font Awesome 6 Free-Solid-900.otf";
Expand Down Expand Up @@ -254,6 +255,7 @@ QtAwesome::QtAwesome(QObject* parent)
_fontDetails.insert(fa::fa_duotone, QtAwesomeFontData(FA_DUOTONE_FONT_FILENAME, FA_DUOTONE_FONT_WEIGHT));
_fontDetails.insert(fa::fa_thin, QtAwesomeFontData(FA_THIN_FONT_FILENAME, FA_THIN_FONT_WEIGHT));
_fontDetails.insert(fa::fa_sharp_solid, QtAwesomeFontData(FA_SHARP_SOLID_FONT_FILENAME, FA_SHARP_SOLID_FONT_WEIGHT));
_fontDetails.insert(fa::fa_sharp_regular, QtAwesomeFontData(FA_SHARP_REGULAR_FONT_FILENAME, FA_SHARP_REGULAR_FONT_WEIGHT));
#endif
}

Expand Down Expand Up @@ -316,6 +318,7 @@ bool QtAwesome::initFontAwesome()
_namedCodepointsByStyle.insert(fa::fa_thin, _namedCodepointsByStyle.value(fa::fa_solid));
_namedCodepointsByStyle.insert(fa::fa_duotone, _namedCodepointsByStyle.value(fa::fa_solid));
_namedCodepointsByStyle.insert(fa::fa_sharp_solid, _namedCodepointsByStyle.value(fa::fa_solid));
_namedCodepointsByStyle.insert(fa::fa_sharp_regular, _namedCodepointsByStyle.value(fa::fa_solid));
#else
addToNamedCodePoints(fa::fa_regular, faRegularFreeIconArray, sizeof(faRegularFreeIconArray)/sizeof(QtAwesomeNamedIcon));
#endif
Expand Down Expand Up @@ -489,6 +492,7 @@ int QtAwesome::stringToStyleEnum(const QString style) const
else if (style == "fa-thin") return fa::fa_thin;
else if (style == "fa-duotone") return fa::fa_duotone;
else if (style == "fa-sharp-solid") return fa::fa_sharp_solid;
else if (style == "fa-sharp-regular") return fa::fa_sharp_regular;
#endif
return fa::fa_solid;
}
Expand All @@ -504,6 +508,7 @@ const QString QtAwesome::styleEnumToString(int style) const
case fa::fa_thin: return "fa=thin";
case fa::fa_duotone: return "fa-duotone";
case fa::fa_sharp_solid: return "fa-sharp-solid";
case fa::fa_sharp_regular: return "fa-sharp-regular";
#endif
}
return "fa_solid";
Expand Down
3 changes: 3 additions & 0 deletions QtAwesome/QtAwesome.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum fa_styles {
fa_thin = 4,
fa_duotone = 5,
fa_sharp_solid = 6,
fa_sharp_regular = 7,
#endif
fa_brands = 2
};
Expand Down Expand Up @@ -87,11 +88,13 @@ Q_OBJECT
static const QString FA_DUOTONE_FONT_FILENAME; // fa-duotone
static const QString FA_THIN_FONT_FILENAME; // fa-thin
static const QString FA_SHARP_SOLID_FONT_FILENAME; // fa-sharp fa-solid
static const QString FA_SHARP_REGULAR_FONT_FILENAME; // fa-sharp fa-regular
static const int DUOTONE_HEX_ICON_VALUE = 0x100000;
static const QFont::Weight FA_LIGHT_FONT_WEIGHT = QFont::Light;
static const QFont::Weight FA_THIN_FONT_WEIGHT = QFont::ExtraLight;
static const QFont::Weight FA_DUOTONE_FONT_WEIGHT = QFont::Black;
static const QFont::Weight FA_SHARP_SOLID_FONT_WEIGHT = QFont::Black;
static const QFont::Weight FA_SHARP_REGULAR_FONT_WEIGHT = QFont::Normal;
#endif

public:
Expand Down
Loading

0 comments on commit b304ec1

Please sign in to comment.