Commit 06cc595a authored by Brian Egan's avatar Brian Egan

Version 7.0.0: upgrade to FontAwesome 5.0.13 with code Generator.

parent 77e86738
## 7.0.0
* Renames:
- All icons that end with capital-O (for outline) have been renamed. E.g. `addressBookO` has been renamed `addressBook`
- All solid icons have been renamed to `solidIconName`. E.g. `addressBook` renamed `solidAddressBook`
* Generate Icon pack based on JSON definition from source. Much easier upgrades / maintenance / consistency going forward! Big thanks to @pplante on Github for the contribution :)
* Move fonts into the `lib` folder.
## 6.0.0
* Update to Font Awesome Icons 5.0.2, which includes tons of new Icons!
......
......@@ -2,7 +2,7 @@
The [Font Awesome](http://fontawesome.io/icons/) Icon pack available as set of Flutter Icons.
Based on Font Awesome 5.0.2. Includes all free icons:
Based on Font Awesome 5.0.13. Includes all free icons:
* Regular
* Solid
......@@ -13,7 +13,7 @@ Based on Font Awesome 5.0.2. Includes all free icons:
In the `dependencies:` section of your `pubspec.yaml`, add the following line:
```yaml
font_awesome_flutter: 6.0.0
font_awesome_flutter: <latest_version>
```
## Usage
......@@ -35,3 +35,8 @@ class MyWidget extends StatelessWidget {
## Example
View the Flutter app in the `example` directory to see all the available `FontAwesomeIcons`.
## Contributors
- Brian Egan
- Phil Plante
<html><body>You are being <a href="https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/web-fonts-with-css/webfonts/fa-brands-400.ttf">redirected</a>.</body></html>
\ No newline at end of file
<html><body>You are being <a href="https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/web-fonts-with-css/webfonts/fa-regular-400.ttf">redirected</a>.</body></html>
\ No newline at end of file
<html><body>You are being <a href="https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/web-fonts-with-css/webfonts/fa-solid-900.ttf">redirected</a>.</body></html>
\ No newline at end of file
......@@ -9,13 +9,13 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
9740EEBB1CF902C7004384FC /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
......@@ -42,13 +42,13 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEB71CF902C7004384FC /* app.flx */ = {isa = PBXFileReference; lastKnownFileType = file; name = app.flx; path = Flutter/app.flx; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
......@@ -74,9 +74,9 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
9740EEB71CF902C7004384FC /* app.flx */,
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
......@@ -187,10 +187,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9740EEBB1CF902C7004384FC /* app.flx in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
......
import 'package:flutter/widgets.dart';
class ExampleIcon implements Comparable {
final IconData iconData;
final String title;
ExampleIcon(this.iconData, this.title);
@override
String toString() => 'IconDefinition{iconData: $iconData, title: $title}';
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ExampleIcon &&
runtimeType == other.runtimeType &&
iconData == other.iconData &&
title == other.title;
@override
int get hashCode => iconData.hashCode ^ title.hashCode;
@override
int compareTo(other) => title.compareTo(other.title);
}
This diff is collapsed.
This diff is collapsed.
library font_awesome_flutter;
import 'package:flutter/widgets.dart';
import '_fonts.dart';
import 'package:font_awesome_flutter/icon_data.dart';
// THIS FILE IS AUTOMATICALLY GENERATED!
......
......@@ -2,7 +2,7 @@ name: font_awesome_flutter
description: The Font Awesome Icon pack available as Flutter Icons
author: Brian Egan <brian@brianegan.com>
homepage: https://github.com/brianegan/font_awesome_flutter
version: 6.0.0
version: 7.0.0
dependencies:
flutter:
......@@ -15,13 +15,13 @@ flutter:
fonts:
- family: FontAwesomeBrands
fonts:
- asset: assets/fa-brands-400.ttf
- asset: lib/fonts/fa-brands-400.ttf
weight: 400
- family: FontAwesomeRegular
fonts:
- asset: assets/fa-regular-400.ttf
- asset: lib/fonts/fa-regular-400.ttf
weight: 400
- family: FontAwesomeSolid
fonts:
- asset: assets/fa-solid-900.ttf
- asset: lib/fonts/fa-solid-900.ttf
weight: 900
import 'dart:convert';
import 'dart:io';
import 'package:recase/recase.dart';
void main(List<String> arguments) {
var file = new File(arguments.first);
if (!file.existsSync()) {
print('Cannot find the file "${arguments.first}".');
}
var content = file.readAsStringSync();
Map<String, dynamic> icons = json.decode(content);
Map<String, String> iconDefinitions = {};
for (String iconName in icons.keys) {
var icon = icons[iconName];
List<String> styles = icon['styles'];
if (styles.length > 1) {
if (styles.contains('regular')) {
styles.remove('regular');
iconDefinitions[iconName] = generateExampleIcon(iconName);
}
for (String style in styles) {
String name = '${style}_$iconName';
iconDefinitions[name] = generateExampleIcon(name);
}
} else {
iconDefinitions[iconName] = generateExampleIcon(iconName);
}
}
List<String> generatedOutput = [
'',
"import 'package:font_awesome_flutter/font_awesome_flutter.dart';",
"import 'package:font_awesome_flutter_example/example_icon.dart';",
'',
'// THIS FILE IS AUTOMATICALLY GENERATED!',
'',
'final icons = <ExampleIcon>[',
];
generatedOutput.addAll(iconDefinitions.values);
generatedOutput.add('];');
File output = new File('example/lib/icons.dart');
output.writeAsStringSync(generatedOutput.join('\n'));
}
String generateExampleIcon(String iconName) {
if (iconName == '500px') {
iconName = 'fiveHundredPx';
}
iconName = new ReCase(iconName).camelCase;
return "ExampleIcon(FontAwesomeIcons.$iconName, '$iconName'),";
}
......@@ -51,7 +51,7 @@ void main(List<String> arguments) {
'library font_awesome_flutter;',
'',
"import 'package:flutter/widgets.dart';",
"import '_fonts.dart';",
"import 'package:font_awesome_flutter/icon_data.dart';",
'',
'// THIS FILE IS AUTOMATICALLY GENERATED!',
'',
......@@ -67,9 +67,9 @@ void main(List<String> arguments) {
}
String generateIconDefinition(String iconName, String style, String unicode) {
style = '${style[0].toUpperCase()}${style.substring(1
)}';
String iconDataSource = 'IconData${style}';
style = '${style[0].toUpperCase()}${style.substring(1)}';
String iconDataSource = 'IconData$style';
if (iconName == '500px') {
iconName = 'fiveHundredPx';
......
#!/usr/bin/env bash
pushd assets/
pushd lib/fonts/
curl -O "https://github.com/FortAwesome/Font-Awesome/raw/master/web-fonts-with-css/webfonts/fa-brands-400.ttf"
curl -O "https://github.com/FortAwesome/Font-Awesome/raw/master/web-fonts-with-css/webfonts/fa-regular-400.ttf"
curl -O "https://github.com/FortAwesome/Font-Awesome/raw/master/web-fonts-with-css/webfonts/fa-solid-900.ttf"
curl -O -L "https://github.com/FortAwesome/Font-Awesome/raw/master/web-fonts-with-css/webfonts/fa-brands-400.ttf"
curl -O -L "https://github.com/FortAwesome/Font-Awesome/raw/master/web-fonts-with-css/webfonts/fa-regular-400.ttf"
curl -O -L "https://github.com/FortAwesome/Font-Awesome/raw/master/web-fonts-with-css/webfonts/fa-solid-900.ttf"
popd
curl -o /tmp/icons.json "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/advanced-options/metadata/icons.json"
dart ./tool/generate_font.dart /tmp/icons.json
dart ./tool/generate_example.dart /tmp/icons.json
dartfmt -w ./lib/font_awesome_flutter.dart
dartfmt -w ./example/lib/icons.dart
rm /tmp/icons.json
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment