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

Adding Flags of different country? #8

Open
Karthik-Nayak98 opened this issue Aug 22, 2020 · 12 comments
Open

Adding Flags of different country? #8

Karthik-Nayak98 opened this issue Aug 22, 2020 · 12 comments

Comments

@Karthik-Nayak98
Copy link

Is it possible to add Flags of different countries along with their country name?

@plibither8
Copy link
Owner

Hi! You can try adding flags by using the "Custom text" paramter. Does that solve the issue?

@Karthik-Nayak98
Copy link
Author

Is there any particular syntax for that? Can you give an example?

@plibither8
Copy link
Owner

You can head over to https://madewithlove.now.sh and generate your badge. There you'll find the "Custom text" input where you can add the flag and country name yourself :).

@Karthik-Nayak98
Copy link
Author

Karthik-Nayak98 commented Aug 24, 2020

It works for other emojis but not for flags. It will show letters instead 'IN' instead of the flag. I think these kinds of emojis are not supported.

@plibither8
Copy link
Owner

That's surprising and disappointing. It definitely has to do with how the badge generator handles zero-width characters that allow to make a. combinational emoji, like flags. If this is the case, I don't think it's possible to add flags.

@plibither8
Copy link
Owner

Onl a closer look at this issue, badges/shields#3638 (comment) provides an interesting approach which might even work - though this wil call for changing the layout around a bit.

@Karthik-Nayak98
Copy link
Author

Only a closer look at this issue, badges/shields#3638 (comment) provides an interesting approach which might even work - through this will call for changing the layout around a bit.

Flag-with-shield

I added the India flag to the badge. It looks good now.

@Karthik-Nayak98
Copy link
Author

I had to get the SVG of the country flag and then convert it to base64 encoding and then add this to the shield. This is a lot of work. Instead, we can add this as a new feature for this project. Can we do this?

@plibither8
Copy link
Owner

Definitely it's possible. As mentioned in the linked comment, we can take a look at this repo: https://www.npmjs.com/package/svg-country-flags to get the svg of the flag, with appropriate height settings. Do you want to take this up?

@Karthik-Nayak98
Copy link
Author

I am not that good at node.js. I can try adding this feature. Is there any other way to contact you? Your LinkedIn account maybe.

@plibither8
Copy link
Owner

Perhaps, Telegram? https://t.me/plibither8

@Karthik-Nayak98
Copy link
Author

Okay thanks

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

No branches or pull requests

2 participants