Skip to content

Commit

Permalink
Update to 6.5.1, Sharp Thin Pro font
Browse files Browse the repository at this point in the history
  • Loading branch information
gamecreature committed Dec 7, 2023
1 parent 45e3e70 commit 3622b85
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

- (2023-12-07) Update to 6.5.1, Sharp Thin Pro font
- (2023-08-16) Update to 6.4.2, Fix issue missing pro icons in namedCodePoints
- (2023-03-28) Update to 6.4.0, Sharp Light Pro font
- (2023-02-09) Update to 6.3.0, Aliases and Sharp Regular Pro font
Expand Down
7 changes: 6 additions & 1 deletion QtAwesome/QtAwesome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ const QString QtAwesome::FA_SOLID_FONT_FILENAME = "pro/Font Awesome 6 Pro-Solid-
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";
const QString QtAwesome::FA_SHARP_LIGHT_FONT_FILENAME = "pro/Font Awesome 6 Sharp-Light-300.otf";
const QString QtAwesome::FA_SHARP_THIN_FONT_FILENAME = "pro/Font Awesome 6 Sharp-Thin-100.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 @@ -258,6 +259,7 @@ QtAwesome::QtAwesome(QObject* parent)
_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));
_fontDetails.insert(fa::fa_sharp_light, QtAwesomeFontData(FA_SHARP_LIGHT_FONT_FILENAME, FA_SHARP_LIGHT_FONT_WEIGHT));
_fontDetails.insert(fa::fa_sharp_thin, QtAwesomeFontData(FA_SHARP_THIN_FONT_FILENAME, FA_SHARP_THIN_FONT_WEIGHT));
#endif
}

Expand Down Expand Up @@ -324,6 +326,7 @@ bool QtAwesome::initFontAwesome()
_namedCodepointsByStyle.insert(fa::fa_sharp_solid, _namedCodepointsByStyle.value(fa::fa_solid));
_namedCodepointsByStyle.insert(fa::fa_sharp_regular, _namedCodepointsByStyle.value(fa::fa_solid));
_namedCodepointsByStyle.insert(fa::fa_sharp_light, _namedCodepointsByStyle.value(fa::fa_solid));
_namedCodepointsByStyle.insert(fa::fa_sharp_thin, _namedCodepointsByStyle.value(fa::fa_solid));
#else
addToNamedCodePoints(fa::fa_regular, faRegularFreeIconArray, sizeof(faRegularFreeIconArray)/sizeof(QtAwesomeNamedIcon));
#endif
Expand Down Expand Up @@ -410,7 +413,7 @@ QIcon QtAwesome::icon(const QString& name, const QVariantMap& options)

if( spaceIndex > 0) {
QString styleName = name.left(spaceIndex);
style = stringToStyleEnum(name.startsWith("fa-") ? name.mid(3) : name);
style = stringToStyleEnum(styleName.startsWith("fa-") ? styleName.mid(3) : name);
iconName = name.mid(spaceIndex + 1);
} else {
iconName = name;
Expand Down Expand Up @@ -499,6 +502,7 @@ int QtAwesome::stringToStyleEnum(const QString style) const
else if (style == "fa-sharp-solid") return fa::fa_sharp_solid;
else if (style == "fa-sharp-regular") return fa::fa_sharp_regular;
else if (style == "fa-sharp-light") return fa::fa_sharp_light;
else if (style == "fa-sharp-thin") return fa::fa_sharp_thin;
#endif
return fa::fa_solid;
}
Expand All @@ -516,6 +520,7 @@ const QString QtAwesome::styleEnumToString(int style) const
case fa::fa_sharp_solid: return "fa-sharp-solid";
case fa::fa_sharp_regular: return "fa-sharp-regular";
case fa::fa_sharp_light: return "fa-sharp-light";
case fa::fa_sharp_thin: return "fa-sharp-thin";
#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 @@ -35,6 +35,7 @@ enum fa_styles {
fa_sharp_solid = 6,
fa_sharp_regular = 7,
fa_sharp_light = 8,
fa_sharp_thin = 9,
#endif
fa_brands = 2
};
Expand Down Expand Up @@ -91,13 +92,15 @@ Q_OBJECT
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 QString FA_SHARP_LIGHT_FONT_FILENAME; // fa-sharp fa-light
static const QString FA_SHARP_THIN_FONT_FILENAME; // fa-sharp fa-thin
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;
static const QFont::Weight FA_SHARP_LIGHT_FONT_WEIGHT = QFont::Light;
static const QFont::Weight FA_SHARP_THIN_FONT_WEIGHT = QFont::ExtraLight;
#endif

public:
Expand Down
Loading

0 comments on commit 3622b85

Please sign in to comment.