33 *
44 * MIT Licensed
55 *
6- * Copyright 2013-2024 - Reliable Bits Software by Blommers IT. All Rights Reserved.
6+ * Copyright 2013-2025 - Ribit Software by Blommers IT. All Rights Reserved.
77 * Author Rick Blommers
88 */
99
2727// Initializing namespaces need to happen outside a namespace
2828static void qtawesome_init_resources ()
2929{
30- #ifdef FONT_AWESOME_PRO
30+ #if defined(FONT_AWESOME_PRO_PLUS)
31+ Q_INIT_RESOURCE (QtAwesomeProPlus);
32+ #elif defined(FONT_AWESOME_PRO)
3133 Q_INIT_RESOURCE (QtAwesomePro);
3234#else
3335 Q_INIT_RESOURCE (QtAwesomeFree);
@@ -211,31 +213,49 @@ class QtAwesomeIconPainterIconEngine : public QIconEngine
211213
212214// ---------------------------------------------------------------------------------------
213215
214- const QString QtAwesome::FA_BRANDS_FONT_FILENAME = " Font Awesome 6 Brands-Regular-400.otf" ;
215- #ifdef FONT_AWESOME_PRO
216- const QString QtAwesome::FA_DUOTONE_FONT_FILENAME = " pro/Font Awesome 6 Duotone-Solid-900.otf" ; // DEPRECATED, use FA_DUOTONE_SOLID_FONT_FILENAME
217- const QString QtAwesome::FA_DUOTONE_SOLID_FONT_FILENAME = " pro/Font Awesome 6 Duotone-Solid-900.otf" ;
218- const QString QtAwesome::FA_DUOTONE_REGULAR_FONT_FILENAME = " pro/Font Awesome 6 Duotone-Regular-400.otf" ;
219- const QString QtAwesome::FA_DUOTONE_LIGHT_FONT_FILENAME = " pro/Font Awesome 6 Duotone-Light-300.otf" ;
220- const QString QtAwesome::FA_DUOTONE_THIN_FONT_FILENAME = " pro/Font Awesome 6 Duotone-Thin-100.otf" ;
221-
222- const QString QtAwesome::FA_SOLID_FONT_FILENAME = " pro/Font Awesome 6 Pro-Solid-900.otf" ;
223- const QString QtAwesome::FA_REGULAR_FONT_FILENAME = " pro/Font Awesome 6 Pro-Regular-400.otf" ;
224- const QString QtAwesome::FA_LIGHT_FONT_FILENAME = " pro/Font Awesome 6 Pro-Light-300.otf" ;
225- const QString QtAwesome::FA_THIN_FONT_FILENAME = " pro/Font Awesome 6 Pro-Thin-100.otf" ;
226-
227- const QString QtAwesome::FA_SHARP_SOLID_FONT_FILENAME = " pro/Font Awesome 6 Sharp-Solid-900.otf" ;
228- const QString QtAwesome::FA_SHARP_REGULAR_FONT_FILENAME = " pro/Font Awesome 6 Sharp-Regular-400.otf" ;
229- const QString QtAwesome::FA_SHARP_LIGHT_FONT_FILENAME = " pro/Font Awesome 6 Sharp-Light-300.otf" ;
230- const QString QtAwesome::FA_SHARP_THIN_FONT_FILENAME = " pro/Font Awesome 6 Sharp-Thin-100.otf" ;
231-
232- const QString QtAwesome::FA_SHARP_DUOTONE_SOLID_FONT_FILENAME = " pro/Font Awesome 6 Sharp Duotone-Solid-900.otf" ;
233- const QString QtAwesome::FA_SHARP_DUOTONE_REGULAR_FONT_FILENAME = " pro/Font Awesome 6 Sharp Duotone-Regular-400.otf" ;
234- const QString QtAwesome::FA_SHARP_DUOTONE_LIGHT_FONT_FILENAME = " pro/Font Awesome 6 Sharp Duotone-Light-300.otf" ;
235- const QString QtAwesome::FA_SHARP_DUOTONE_THIN_FONT_FILENAME = " pro/Font Awesome 6 Sharp Duotone-Thin-100.otf" ;
216+ const QString QtAwesome::FA_BRANDS_FONT_FILENAME = " Font Awesome 7 Brands-Regular-400.otf" ;
217+
218+ #if defined(FONT_AWESOME_PRO)
219+ const QString QtAwesome::FA_DUOTONE_FONT_FILENAME = " pro/Font Awesome 7 Duotone-Solid-900.otf" ; // DEPRECATED, use FA_DUOTONE_SOLID_FONT_FILENAME
220+ const QString QtAwesome::FA_DUOTONE_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Duotone-Solid-900.otf" ;
221+ const QString QtAwesome::FA_DUOTONE_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Duotone-Regular-400.otf" ;
222+ const QString QtAwesome::FA_DUOTONE_LIGHT_FONT_FILENAME = " pro/Font Awesome 7 Duotone-Light-300.otf" ;
223+ const QString QtAwesome::FA_DUOTONE_THIN_FONT_FILENAME = " pro/Font Awesome 7 Duotone-Thin-100.otf" ;
224+
225+ const QString QtAwesome::FA_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Pro-Solid-900.otf" ;
226+ const QString QtAwesome::FA_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Pro-Regular-400.otf" ;
227+ const QString QtAwesome::FA_LIGHT_FONT_FILENAME = " pro/Font Awesome 7 Pro-Light-300.otf" ;
228+ const QString QtAwesome::FA_THIN_FONT_FILENAME = " pro/Font Awesome 7 Pro-Thin-100.otf" ;
229+
230+ const QString QtAwesome::FA_SHARP_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Sharp-Solid-900.otf" ;
231+ const QString QtAwesome::FA_SHARP_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Sharp-Regular-400.otf" ;
232+ const QString QtAwesome::FA_SHARP_LIGHT_FONT_FILENAME = " pro/Font Awesome 7 Sharp-Light-300.otf" ;
233+ const QString QtAwesome::FA_SHARP_THIN_FONT_FILENAME = " pro/Font Awesome 7 Sharp-Thin-100.otf" ;
234+
235+ const QString QtAwesome::FA_SHARP_DUOTONE_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Sharp Duotone-Solid-900.otf" ;
236+ const QString QtAwesome::FA_SHARP_DUOTONE_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Sharp Duotone-Regular-400.otf" ;
237+ const QString QtAwesome::FA_SHARP_DUOTONE_LIGHT_FONT_FILENAME = " pro/Font Awesome 7 Sharp Duotone-Light-300.otf" ;
238+ const QString QtAwesome::FA_SHARP_DUOTONE_THIN_FONT_FILENAME = " pro/Font Awesome 7 Sharp Duotone-Thin-100.otf" ;
239+
240+ #ifdef FONT_AWESOME_PRO_PLUS
241+
242+ const QString QtAwesome::FA_CHISEL_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Chisel-Regular-400" ;
243+ const QString QtAwesome::FA_ETCH_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Etch-Solid-900.otf" ;
244+ const QString QtAwesome::FA_JELLY_DUOTONE_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Jelly Duo-Regular-400.otf" ;
245+ const QString QtAwesome::FA_JELLY_FILL_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Jelly Fill-Regular-400" ;
246+ const QString QtAwesome::FA_JELLY_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Jelly-Regular-400.otf" ;
247+ const QString QtAwesome::FA_NOTDOG_DUOTONE_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Notdog Duo-Solid-900.otf" ;
248+ const QString QtAwesome::FA_NOTDOG_SOLID_FONT_FILENAME = " pro/Font Awesome 7 Notdog-Solid-900.otf" ;
249+ const QString QtAwesome::FA_SLAB_PRESS_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Slab Press-Regular-400.otf" ;
250+ const QString QtAwesome::FA_SLAB_REGULAR_FONT_FILENAME = " pro/Font Awesome 7 Slab-Regular-400.otf" ;
251+ const QString QtAwesome::FA_THUMBPRINT_LIGHT_FONT_FILENAME = " pro/Font Awesome 7 Thumbprint-Light-300.otf" ;
252+ const QString QtAwesome::FA_WHITEBOARD_SEMIBOLD_FONT_FILENAME = " pro/Font Awesome 7 Whiteboard-Semibold-600.otf" ;
253+
254+ #endif
255+
236256#else
237- const QString QtAwesome::FA_REGULAR_FONT_FILENAME = " Font Awesome 6 Free-Regular-400.otf" ;
238- const QString QtAwesome::FA_SOLID_FONT_FILENAME = " Font Awesome 6 Free-Solid-900.otf" ;
257+ const QString QtAwesome::FA_REGULAR_FONT_FILENAME = " Font Awesome 7 Free-Regular-400.otf" ;
258+ const QString QtAwesome::FA_SOLID_FONT_FILENAME = " Font Awesome 7 Free-Solid-900.otf" ;
239259#endif
240260
241261// / The default icon colors
@@ -270,6 +290,20 @@ QtAwesome::QtAwesome(QObject* parent)
270290 _fontDetails.insert (fa::fa_sharp_duotone_thin, QtAwesomeFontData (FA_SHARP_DUOTONE_THIN_FONT_FILENAME, FA_SHARP_DUOTONE_THIN_FONT_WEIGHT));
271291#endif
272292
293+ #ifdef FONT_AWESOME_PRO_PLUS
294+ _fontDetails.insert (fa::fa_chisel_regular, QtAwesomeFontData (FA_CHISEL_REGULAR_FONT_FILENAME, FA_CHISEL_REGULAR_FONT_WEIGHT));
295+ _fontDetails.insert (fa::fa_etch_solid, QtAwesomeFontData (FA_ETCH_SOLID_FONT_FILENAME, FA_ETCH_SOLID_FONT_WEIGHT));
296+ _fontDetails.insert (fa::fa_jelly_regular, QtAwesomeFontData (FA_JELLY_REGULAR_FONT_FILENAME, FA_JELLY_REGULAR_FONT_WEIGHT));
297+ _fontDetails.insert (fa::fa_jelly_duotone_regular, QtAwesomeFontData (FA_JELLY_DUOTONE_REGULAR_FONT_FILENAME, FA_JELLY_DUOTONE_REGULAR_FONT_WEIGHT));
298+ _fontDetails.insert (fa::fa_jelly_fill_regular, QtAwesomeFontData (FA_JELLY_FILL_REGULAR_FONT_FILENAME, FA_JELLY_FILL_REGULAR_FONT_WEIGHT));
299+ _fontDetails.insert (fa::fa_notdog_duotone_solid, QtAwesomeFontData (FA_NOTDOG_DUOTONE_SOLID_FONT_FILENAME, FA_NOTDOG_DUOTONE_SOLID_FONT_WEIGHT));
300+ _fontDetails.insert (fa::fa_notdog_solid, QtAwesomeFontData (FA_NOTDOG_SOLID_FONT_FILENAME, FA_NOTDOG_SOLID_FONT_WEIGHT));
301+ _fontDetails.insert (fa::fa_slab_press_regular, QtAwesomeFontData (FA_SLAB_PRESS_REGULAR_FONT_FILENAME, FA_SLAB_REGULAR_FONT_WEIGHT));
302+ _fontDetails.insert (fa::fa_slab_regular, QtAwesomeFontData (FA_SLAB_REGULAR_FONT_FILENAME, FA_SLAB_REGULAR_FONT_WEIGHT));
303+ _fontDetails.insert (fa::fa_thumbprint_light, QtAwesomeFontData (FA_THUMBPRINT_LIGHT_FONT_FILENAME, FA_THUMBPRINT_LIGHT_FONT_WEIGHT));
304+ _fontDetails.insert (fa::fa_whiteboard_semibold, QtAwesomeFontData (FA_WHITEBOARD_SEMIBOLD_FONT_FILENAME, FA_WHITEBOARD_SEMIBOLD_FONT_WEIGHT));
305+ #endif
306+
273307#ifdef USE_COLOR_SCHEME
274308 // support dark/light mode
275309 QObject::connect (QApplication::styleHints (), &QStyleHints::colorSchemeChanged, this , [this ](Qt::ColorScheme colorScheme){
@@ -311,18 +345,18 @@ QtAwesome::~QtAwesome()
311345 qDeleteAll (_namedCodepointsList);
312346}
313347
314- // / a specialized init function so font-awesome is loaded and initialized
315- // / this method return true on success, it will return false if the fnot cannot be initialized
348+ // / A specialized init function so font-awesome is loaded and initialized
349+ // / This method return true on success, it will return false if the font cannot be initialized
316350// / To initialize QtAwesome with font-awesome you need to call this method
317351bool QtAwesome::initFontAwesome ()
318352{
319353 bool success = true ;
320354 // The macro below internally calls "qInitResources_QtAwesome()". this initializes
321355 // the resource system. For a .pri project this isn't required, but when building and using a
322356 // static library the resource need to initialized first.
323- // /
324- // I've checked th qInitResource_* code and calling this method mutliple times shouldn't be any problem
325- // (More info about this subject: http://qt-project.org/wiki/QtResources)
357+ //
358+ // I've checked th qInitResource_* code and calling this method multiple times shouldn't be any problem
359+ // (More info about this subject: < http://qt-project.org/wiki/QtResources> )
326360 qtawesome_init_resources ();
327361
328362 for (QtAwesomeFontData &fd : _fontDetails) {
@@ -376,6 +410,20 @@ bool QtAwesome::initFontAwesome()
376410 _namedCodepointsByStyle.insert (fa::fa_sharp_duotone_regular, _namedCodepointsByStyle.value (fa::fa_solid));
377411 _namedCodepointsByStyle.insert (fa::fa_sharp_duotone_light, _namedCodepointsByStyle.value (fa::fa_solid));
378412 _namedCodepointsByStyle.insert (fa::fa_sharp_duotone_thin, _namedCodepointsByStyle.value (fa::fa_solid));
413+
414+ #ifdef FONT_AWESOME_PRO_PLUS
415+ _namedCodepointsByStyle.insert (fa::fa_chisel_regular, _namedCodepointsByStyle.value (fa::fa_solid));
416+ _namedCodepointsByStyle.insert (fa::fa_etch_solid, _namedCodepointsByStyle.value (fa::fa_solid));
417+ _namedCodepointsByStyle.insert (fa::fa_jelly_regular, _namedCodepointsByStyle.value (fa::fa_solid));
418+ _namedCodepointsByStyle.insert (fa::fa_jelly_duotone_regular, _namedCodepointsByStyle.value (fa::fa_solid));
419+ _namedCodepointsByStyle.insert (fa::fa_jelly_fill_regular, _namedCodepointsByStyle.value (fa::fa_solid));
420+ _namedCodepointsByStyle.insert (fa::fa_notdog_duotone_solid, _namedCodepointsByStyle.value (fa::fa_solid));
421+ _namedCodepointsByStyle.insert (fa::fa_notdog_solid, _namedCodepointsByStyle.value (fa::fa_solid));
422+ _namedCodepointsByStyle.insert (fa::fa_slab_press_regular, _namedCodepointsByStyle.value (fa::fa_solid));
423+ _namedCodepointsByStyle.insert (fa::fa_slab_regular, _namedCodepointsByStyle.value (fa::fa_solid));
424+ _namedCodepointsByStyle.insert (fa::fa_thumbprint_light, _namedCodepointsByStyle.value (fa::fa_solid));
425+ _namedCodepointsByStyle.insert (fa::fa_whiteboard_semibold, _namedCodepointsByStyle.value (fa::fa_solid));
426+ #endif
379427#else
380428 addToNamedCodePoints (fa::fa_regular, faRegularFreeIconArray, sizeof (faRegularFreeIconArray)/sizeof (QtAwesomeNamedIcon));
381429#endif
@@ -560,7 +608,23 @@ int QtAwesome::stringToStyleEnum(const QString style) const
560608 else if (style == " fa-sharp-duotone-regular" ) return fa::fa_sharp_duotone_regular;
561609 else if (style == " fa-sharp-duotone-light" ) return fa::fa_sharp_duotone_light;
562610 else if (style == " fa-sharp-duotone-thin" ) return fa::fa_sharp_duotone_thin;
611+
612+ #ifdef FONT_AWESOME_PRO_PLUS
613+ else if (style == " fa-chisel" ) return fa::fa_chisel_regular;
614+ else if (style == " fa-etch" ) return fa::fa_etch_solid;
615+ else if (style == " fa-jelly" ) return fa::fa_jelly_regular;
616+ else if (style == " fa-jelly-duo" ) return fa::fa_jelly_duotone_regular;
617+ else if (style == " fa-jelly-fill" ) return fa::fa_jelly_fill_regular;
618+ else if (style == " fa-notdog" ) return fa::fa_notdog_solid;
619+ else if (style == " fa-notdog-duo" ) return fa::fa_notdog_duotone_solid;
620+ else if (style == " fa-slab" ) return fa::fa_slab_regular;
621+ else if (style == " fa-slab-press" ) return fa::fa_slab_press_regular;
622+ else if (style == " fa-thumbprint" ) return fa::fa_thumbprint_light;
623+ else if (style == " fa-whiteboard" ) return fa::fa_whiteboard_semibold;
624+ #endif
563625#endif
626+
627+
564628 return fa::fa_solid;
565629}
566630
@@ -586,7 +650,21 @@ const QString QtAwesome::styleEnumToString(int style) const
586650 case fa::fa_sharp_duotone_regular: return " fa-sharp-duotone-regular" ;
587651 case fa::fa_sharp_duotone_light: return " fa-sharp-duotone-light" ;
588652 case fa::fa_sharp_duotone_thin: return " fa-sharp-duotone-thin" ;
653+
654+ #ifdef FONT_AWESOME_PRO_PLUS
655+ case fa::fa_etch_solid: return " fa-chisel" ;
656+ case fa::fa_jelly_regular: return " fa-jelly" ;
657+ case fa::fa_jelly_duotone_regular: return " fa-jelly-duo" ;
658+ case fa::fa_jelly_fill_regular: return " fa-jelly-fill" ;
659+ case fa::fa_notdog_solid: return " fa-notdog" ;
660+ case fa::fa_notdog_duotone_solid: return " fa-notdog-duo" ;
661+ case fa::fa_slab_regular: return " fa-slab" ;
662+ case fa::fa_slab_press_regular: return " fa-slab-press" ;
663+ case fa::fa_thumbprint_light: return " fa-thumbprint" ;
664+ case fa::fa_whiteboard_semibold: return " fa-whiteboard" ;
665+ #endif
589666#endif
667+
590668 }
591669 return " fa-solid" ;
592670}
0 commit comments