Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontAwesome 5 with fallback #787

Merged
merged 38 commits into from
Jul 28, 2018
Merged

Conversation

hampustagerud
Copy link
Collaborator

@hampustagerud hampustagerud commented Jul 20, 2018

Added fallback which enables IconExplorer and directory to show all icons. Fallback is implemented using metadata automatically generated from FontAwesome 5 npm packages.

+ GlyphMap for FontAwesome 5.1.0 Pro
+ Font files for FontAwesome 5.1.0 Free
+ Implementation enabling FontAwesome5 icons

Handles the copying and renaming of FontAwesome5 Pro font files

Removed debug code
Now a default import from a separate file, instead of
creating it using FA5iconSet(bool).
Fixes to pass tests
+ FontAwesome 5.1.1
+ Temporary folder and npm pack when building
+ Separate glyphmaps
if (brand) return BrandsSet;
if (light) return LightSet;
if (solid) return SolidSet;
if (brand) return FA5Style.brand;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought we were able to remove the brand prop with this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to my last comment 👇🏻

@@ -0,0 +1,3491 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very verbose data structure, could we invert it by doing { "brands": ["500px"...] ... } instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 🙂

glyphMap,
metadata = {},
proVersion = false,
fallback = true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this fallback argument if it's always true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was meant to give more control in case some people want to disable the fallback (for whatever reason). It adds no complexity to normal users but adds some options for those who wish to do this. If it's disabled then the brand prop is needed (with the fallback it can be omitted). 🙂

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly don't see the need for the brand prop, it's not really a variant, just a different font.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey, I'll just remove the brand prop and the fallback option!

@oblador
Copy link
Owner

oblador commented Jul 27, 2018

@hampustagerud This is blocking release, do you have time to address my comments? 😃

let familyName = family;

if (family === 'FontAwesome5') {
if (FontAwesome5Meta[name].indexOf('solid') === -1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess this test is now broken

const generatedJSON = {};

const path = `${argv.path}/svgs/`;
fs.readdirSync(path).forEach(file => {
Copy link
Owner

@oblador oblador Jul 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor this to a filter/map instead?

@@ -8,6 +8,7 @@
"adn": 61808,
"adversal": 62314,
"affiliatetheme": 62315,
"air-freshener": 62928,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we suddenly get new free icons?

Copy link

@migsc migsc Jul 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! I've been following this and felt like chiming in. :) Seems this icon and all the others added here came from the 5.2 release that came out this week.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, when I worked on the metadata generator it automatically updated the fonts so I just put them in there as well 🙂

@hampustagerud
Copy link
Collaborator Author

I tried to implement the metadata generator using filter/map but ended up using filter/forEach in combination since I'm not really sure how to create the object otherwise 🙂

@oblador oblador merged commit 4aa125f into oblador:master Jul 28, 2018
@oblador
Copy link
Owner

oblador commented Jul 28, 2018

Thanks so much for your hard work and swift resolution of comments @hampustagerud 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants