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

fix: filter meta font json from render method #1522

Merged

Conversation

danieltvaz
Copy link
Contributor

What's the problem:

Library website with icons list stop rendering due an error on render method.

How i resolved:

The problem is the script that generates the glyphmaps, for some reason, the script that merge the files into one map json, is putting _meta json in too, and thats causes an exception on rendering function. I just filter the json property name if there's a family with "_meta" in the name. Probaly the script should be fixed, but I don't know exactly how things work here, so it's a quick solution.

@@ -1,6 +1,8 @@
import './App.css';
Copy link
Owner

Choose a reason for hiding this comment

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

Why was this import moved?

Copy link
Contributor Author

@danieltvaz danieltvaz Jul 17, 2023

Choose a reason for hiding this comment

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

Sorry! vscode extensions messing things up
Mine is configured to sort 'near' imports early

</div>
);
const renderIcon = (family, name) =>
family.includes('_meta') ? null : (
Copy link
Owner

Choose a reason for hiding this comment

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

Can we change the script that generates this data instead?

Copy link
Contributor Author

@danieltvaz danieltvaz Jul 17, 2023

Choose a reason for hiding this comment

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

Pretty sure, fixing the script will be the best choice.
I don't touch the script because I can't understand it (why we need meta data and things like that). It's just a quick fix to make the icon search page become online again.

Copy link
Owner

Choose a reason for hiding this comment

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

AFAIK the meta files are needed to point to the correct font file, just like it's done for FA5: https://github.com/oblador/react-native-vector-icons/blob/master/directory/bin/generate-glyphmap-index.js So simply just copy paste FA5 and apply to FA6 would fix this issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, working on it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ready for review

I returned the render method to original, and fixed the script that generates the glyphmaps, adding an exception if the file is a _meta, that was the source of the problem.

let me know if I need to change or improve something

Copy link
Owner

Choose a reason for hiding this comment

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

The _meta thing does nothing if the fix is applied correctly, so I removed it and fixed the logic condition 👍

@danieltvaz danieltvaz marked this pull request as draft July 19, 2023 11:40
@danieltvaz danieltvaz marked this pull request as ready for review July 19, 2023 15:35
@oblador oblador merged commit 7f22d41 into oblador:master Jul 20, 2023
1 check passed
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

2 participants