Skip to content

Commit 4e06325

Browse files
feat: add pro(+) fonts
1 parent 6809e7f commit 4e06325

3 files changed

Lines changed: 301 additions & 1 deletion

File tree

lib/src/icon_data.dart

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,147 @@ class IconDataSharpSolid extends IconData {
120120
fontPackage: 'font_awesome_flutter',
121121
);
122122
}
123+
124+
/// [IconData] for a font awesome chisel thin icon from a code point. Only works if
125+
/// chisel icons (font awesome pro+, v7+) have been installed.
126+
///
127+
/// Code points can be obtained from fontawesome.com
128+
class IconDataChiselRegular extends IconData {
129+
const IconDataChiselRegular(super.codePoint)
130+
: super(
131+
fontFamily: 'FontAwesomeChiselRegular',
132+
fontPackage: 'font_awesome_flutter',
133+
);
134+
}
135+
136+
/// [IconData] for a font awesome chisel solid icon from a code point. Only works if
137+
/// chisel icons (font awesome pro+, v7+) have been installed.
138+
///
139+
/// Code points can be obtained from fontawesome.com
140+
class IconDataEtchSolid extends IconData {
141+
const IconDataEtchSolid(super.codePoint)
142+
: super(
143+
fontFamily: 'FontAwesomeEtchSolid',
144+
fontPackage: 'font_awesome_flutter',
145+
);
146+
}
147+
148+
/// [IconData] for a font awesome notdog solid icon from a code point. Only works if
149+
/// Notdog icons (font awesome pro+, v7+) have been installed.
150+
///
151+
/// Code points can be obtained from fontawesome.com
152+
class IconDataNotdogSolid extends IconData {
153+
const IconDataNotdogSolid(super.codePoint)
154+
: super(
155+
fontFamily: 'FontAwesomeNotdogSolid',
156+
fontPackage: 'font_awesome_flutter',
157+
);
158+
}
159+
160+
/// [IconData] for a font awesome graphite solid icon from a code point. Only works if
161+
/// graphite icons (font awesome pro+, v7+) have been installed.
162+
///
163+
/// Code points can be obtained from fontawesome.com
164+
class IconDataJellyRegular extends IconData {
165+
const IconDataJellyRegular(super.codePoint)
166+
: super(
167+
fontFamily: 'FontAwesomeJellyRegular',
168+
fontPackage: 'font_awesome_flutter',
169+
);
170+
}
171+
172+
/// [IconData] for a font awesome graphite solid icon from a code point. Only works if
173+
/// graphite icons (font awesome pro+, v7+) have been installed.
174+
///
175+
/// Code points can be obtained from fontawesome.com
176+
class IconDataJellyFillRegular extends IconData {
177+
const IconDataJellyFillRegular(super.codePoint)
178+
: super(
179+
fontFamily: 'FontAwesomeJellyFillRegular',
180+
fontPackage: 'font_awesome_flutter',
181+
);
182+
}
183+
184+
/// [IconData] for a font awesome graphite solid icon from a code point. Only works if
185+
/// graphite icons (font awesome pro+, v7+) have been installed.
186+
///
187+
/// Code points can be obtained from fontawesome.com
188+
class IconDataSlabRegular extends IconData {
189+
const IconDataSlabRegular(super.codePoint)
190+
: super(
191+
fontFamily: 'FontAwesomeSlabRegular',
192+
fontPackage: 'font_awesome_flutter',
193+
);
194+
}
195+
196+
/// [IconData] for a font awesome graphite solid icon from a code point. Only works if
197+
/// graphite icons (font awesome pro+, v7+) have been installed.
198+
///
199+
/// Code points can be obtained from fontawesome.com
200+
class IconDataSlabPressRegular extends IconData {
201+
const IconDataSlabPressRegular(super.codePoint)
202+
: super(
203+
fontFamily: 'FontAwesomeSlabPressRegular',
204+
fontPackage: 'font_awesome_flutter',
205+
);
206+
}
207+
208+
/// [IconData] for a font awesome graphite solid icon from a code point. Only works if
209+
/// graphite icons (font awesome pro+, v7+) have been installed.
210+
///
211+
/// Code points can be obtained from fontawesome.com
212+
class IconDataThumbprintLight extends IconData {
213+
const IconDataThumbprintLight(super.codePoint)
214+
: super(
215+
fontFamily: 'FontAwesomeThumbprintLight',
216+
fontPackage: 'font_awesome_flutter',
217+
);
218+
}
219+
220+
/// [IconData] for a font awesome whiteboard semibold icon from a code point. Only works if
221+
/// whiteboard icons (font awesome pro+, v7+) have been installed.
222+
///
223+
/// Code points can be obtained from fontawesome.com
224+
class IconDataWhiteboardSemibold extends IconData {
225+
const IconDataWhiteboardSemibold(super.codePoint)
226+
: super(
227+
fontFamily: 'FontAwesomeWhiteboardSemibold',
228+
fontPackage: 'font_awesome_flutter',
229+
);
230+
}
231+
232+
/// [IconData] for a font awesome utility semibold icon from a code point. Only works if
233+
/// utility icons (font awesome pro+, v7.1.0+) have been installed.
234+
///
235+
/// Code points can be obtained from fontawesome.com
236+
class IconDataUtilitySemibold extends IconData {
237+
const IconDataUtilitySemibold(super.codePoint)
238+
: super(
239+
fontFamily: 'FontAwesomeUtilitySemibold',
240+
fontPackage: 'font_awesome_flutter',
241+
);
242+
}
243+
244+
/// [IconData] for a font awesome utility fill semibold icon from a code point. Only works if
245+
/// utility fill icons (font awesome pro+, v7.1.0+) have been installed.
246+
///
247+
/// Code points can be obtained from fontawesome.com
248+
class IconDataUtilityFillSemibold extends IconData {
249+
const IconDataUtilityFillSemibold(super.codePoint)
250+
: super(
251+
fontFamily: 'FontAwesomeUtilityFillSemibold',
252+
fontPackage: 'font_awesome_flutter',
253+
);
254+
}
255+
256+
/// [IconData] for a font awesome graphite thin icon from a code point. Only works if
257+
/// graphite icons (font awesome pro+, v7.2.0+) have been installed.
258+
///
259+
/// Code points can be obtained from fontawesome.com
260+
class IconDataGraphiteThin extends IconData {
261+
const IconDataGraphiteThin(super.codePoint)
262+
: super(
263+
fontFamily: 'FontAwesomeGraphiteThin',
264+
fontPackage: 'font_awesome_flutter',
265+
);
266+
}

pubspec.yaml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,60 @@ flutter:
6060
# - family: FontAwesomeSharpSolid
6161
# fonts:
6262
# - asset: lib/fonts/Font-Awesome-7-Sharp-Solid-900.otf
63-
# weight: 900
63+
# weight: 900
64+
- family: FontAwesomeChiselRegular
65+
fonts:
66+
- asset: lib/fonts/Font-Awesome-7-Chisel-Regular-400.otf
67+
weight: 400
68+
- family: FontAwesomeEtchSolid
69+
fonts:
70+
- asset: lib/fonts/Font-Awesome-7-Etch-Solid-900.otf
71+
weight: 900
72+
- family: FontAwesomeGraphiteThin
73+
fonts:
74+
- asset: lib/fonts/Font-Awesome-7-Graphite-Thin-100.otf
75+
weight: 100
76+
- family: FontAwesomeJellyFillRegular
77+
fonts:
78+
- asset: lib/fonts/Font-Awesome-7-Jelly-Fill-Regular-400.otf
79+
weight: 400
80+
- family: FontAwesomeJellyRegular
81+
fonts:
82+
- asset: lib/fonts/Font-Awesome-7-Jelly-Regular-400.otf
83+
weight: 400
84+
- family: FontAwesomeNotdogSolid
85+
fonts:
86+
- asset: lib/fonts/Font-Awesome-7-Notdog-Solid-900.otf
87+
weight: 900
88+
- family: FontAwesomeSlabPressRegular
89+
fonts:
90+
- asset: lib/fonts/Font-Awesome-7-Slab-Press-Regular-400.otf
91+
weight: 400
92+
- family: FontAwesomeSlabRegular
93+
fonts:
94+
- asset: lib/fonts/Font-Awesome-7-Slab-Regular-400.otf
95+
weight: 400
96+
- family: FontAwesomeThumbprintLight
97+
fonts:
98+
- asset: lib/fonts/Font-Awesome-7-Thumbprint-Light-300.otf
99+
weight: 300
100+
- family: FontAwesomeUtilityFillSemibold
101+
fonts:
102+
- asset: lib/fonts/Font-Awesome-7-Utility-Fill-Semibold-600.otf
103+
weight: 600
104+
- family: FontAwesomeUtilitySemibold
105+
fonts:
106+
- asset: lib/fonts/Font-Awesome-7-Utility-Semibold-600.otf
107+
weight: 600
108+
- family: FontAwesomeWhiteboardSemibold
109+
fonts:
110+
- asset: lib/fonts/Font-Awesome-7-Whiteboard-Semibold-600.otf
111+
weight: 600
112+
- family: FontAwesomeChiselRegular
113+
fonts:
114+
- asset: lib/fonts/Font-Awesome-7-Chisel-Regular-400.otf
115+
weight: 400
116+
- family: FontAwesomeEtchSolid
117+
fonts:
118+
- asset: lib/fonts/Font-Awesome-7-Etch-Solid-400.otf
119+
weight: 400

util/lib/main.dart

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,90 @@ bool readAndPickMetadata(
630630
),
631631
); //"sharp thin ..."
632632
}
633+
if (icon['svgs']?['chisel'] != null) {
634+
iconStyles.addAll(
635+
(icon['svgs']['chisel'] as Map<String, dynamic>).keys.map(
636+
(key) => 'chisel $key',
637+
),
638+
); //"chisel thin ..."
639+
}
640+
if (icon['svgs']?['etch'] != null) {
641+
iconStyles.addAll(
642+
(icon['svgs']['etch'] as Map<String, dynamic>).keys.map(
643+
(key) => 'etch $key',
644+
),
645+
); //"etch thin ..."
646+
}
647+
if (icon['svgs']?['graphite'] != null) {
648+
iconStyles.addAll(
649+
(icon['svgs']['graphite'] as Map<String, dynamic>).keys.map(
650+
(key) => 'graphite $key',
651+
),
652+
); //"graphite thin ..."
653+
}
654+
if (icon['svgs']?['jelly'] != null) {
655+
iconStyles.addAll(
656+
(icon['svgs']['jelly'] as Map<String, dynamic>).keys.map(
657+
(key) => 'jelly $key',
658+
),
659+
); //"jelly thin ..."
660+
}
661+
if (icon['svgs']?['jelly-fill'] != null) {
662+
iconStyles.addAll(
663+
(icon['svgs']['jelly-fill'] as Map<String, dynamic>).keys.map(
664+
(key) => 'jelly fill $key',
665+
),
666+
); //"jelly fill thin ..."
667+
}
668+
if (icon['svgs']?['notdog'] != null) {
669+
iconStyles.addAll(
670+
(icon['svgs']['notdog'] as Map<String, dynamic>).keys.map(
671+
(key) => 'notdog $key',
672+
),
673+
); //"notdog thin ..."
674+
}
675+
if (icon['svgs']?['slab'] != null) {
676+
iconStyles.addAll(
677+
(icon['svgs']['slab'] as Map<String, dynamic>).keys.map(
678+
(key) => 'slab $key',
679+
),
680+
); //"slab thin ..."
681+
}
682+
if (icon['svgs']?['slab-press'] != null) {
683+
iconStyles.addAll(
684+
(icon['svgs']['slab-press'] as Map<String, dynamic>).keys.map(
685+
(key) => 'slab press $key',
686+
),
687+
); //"slab press thin ..."
688+
}
689+
if (icon['svgs']?['thumbprint'] != null) {
690+
iconStyles.addAll(
691+
(icon['svgs']['thumbprint'] as Map<String, dynamic>).keys.map(
692+
(key) => 'thumbprint $key',
693+
),
694+
); //"thumbprint thin ..."
695+
}
696+
if (icon['svgs']?['utility'] != null) {
697+
iconStyles.addAll(
698+
(icon['svgs']['utility'] as Map<String, dynamic>).keys.map(
699+
(key) => 'utility $key',
700+
),
701+
); //"utility thin ..."
702+
}
703+
if (icon['svgs']?['utility-fill'] != null) {
704+
iconStyles.addAll(
705+
(icon['svgs']['utility-fill'] as Map<String, dynamic>).keys.map(
706+
(key) => 'utility fill $key',
707+
),
708+
); //"utility fill thin ..."
709+
}
710+
if (icon['svgs']?['whiteboard'] != null) {
711+
iconStyles.addAll(
712+
(icon['svgs']['whiteboard'] as Map<String, dynamic>).keys.map(
713+
(key) => 'whiteboard $key',
714+
),
715+
); //"whiteboard thin ..."
716+
}
633717
}
634718
//TODO: Remove line once duotone support discontinuation notice is removed
635719
if (iconStyles.contains('duotone')) hasDuotoneIcons = true;
@@ -638,6 +722,10 @@ bool readAndPickMetadata(
638722
if (excluded == 'sharp') {
639723
//Since it's 'sharp thin' then remove any containing sharp
640724
iconStyles.removeWhere((element) => element.contains('sharp'));
725+
} else if (excluded.contains('-')) {
726+
iconStyles.removeWhere(
727+
(element) => element.contains(excluded.replaceAll('-', ' ')),
728+
);
641729
} else {
642730
iconStyles.remove(excluded);
643731
}
@@ -718,6 +806,18 @@ ArgParser setUpArgParser() {
718806
'light',
719807
'thin',
720808
'sharp',
809+
'chisel',
810+
'etch',
811+
'graphite',
812+
'jelly',
813+
'jelly-fill',
814+
'notdog',
815+
'slab',
816+
'slab-press',
817+
'thumbprint',
818+
'utility',
819+
'utility-fill',
820+
'whiteboard',
721821
],
722822
help: 'icon styles which are excluded by the generator',
723823
);

0 commit comments

Comments
 (0)