Code Monkey home page Code Monkey logo

Comments (10)

jamesblasco avatar jamesblasco commented on June 12, 2024 2

Okey, apparently is a Flutter problem => flutter/flutter#34958

from font_awesome_flutter.

brianegan avatar brianegan commented on June 12, 2024

Hey there -- unfortunately I don't quite think that'd be possible, since the font itself comes from original FontAwesome team and Flutter is rendering that as-is. Also, since I don't know exactly what you're going for design-wise and if that's specific to your app, it might be tough to make it work for the wider audience.

As an alternative, you could create a custom Widget that accepted an Icon as a parameter and sets the correct font size / padded according to make it work for your design!

from font_awesome_flutter.

ZAYEC77 avatar ZAYEC77 commented on June 12, 2024

@brianegan
I'm not sure about all icons but have found an issue with a coffee icon.
Here is an example of two icons:

  • Icons.shopping_basket
  • FontAwesomeIcons.coffee

I have wrapped it to a colored container to show sizes:

image

I guess it's not a problem with this repo, but since I used it, I reported it here at first.
Should I create an issue at FontAwesome repo, what do you think?

from font_awesome_flutter.

ZAYEC77 avatar ZAYEC77 commented on June 12, 2024

Although not, I found the same issue with other icons:
image

from font_awesome_flutter.

jamesblasco avatar jamesblasco commented on June 12, 2024

Same problem for me

Captura de pantalla 2019-09-15 a las 14 19 03

I think If you give a size to an icon it shouldn’t exceed the edges of the Icon Widget

from font_awesome_flutter.

hamishjohnson avatar hamishjohnson commented on June 12, 2024

I don't think it's impossible to do. The material icons appear to be 75% of the size of the font awesome icons, so in the FaIcon widget, instead of inheriting the default IconTheme size, you inherit 75% of the default IconTheme size.

from font_awesome_flutter.

michaelspiss avatar michaelspiss commented on June 12, 2024

This was discussed way before FaIcon was a thing. You are right, this issue can be fixed with the steps you described above - reopening (providing a fix as soon as my schedule allows)

from font_awesome_flutter.

hamishjohnson avatar hamishjohnson commented on June 12, 2024

Awesome. I edited the code and did the same thing and for the most part it works, however the size discrepancy does vary a bit but for the most part I think a value of 75% - 85% does the job.

from font_awesome_flutter.

NuclleaR avatar NuclleaR commented on June 12, 2024

I have the same problem also on iOS platform
iPhone 12 2020-12-14 14-54-06

from font_awesome_flutter.

michaelspiss avatar michaelspiss commented on June 12, 2024

Material icons are all set within squares, font awesome icons within rectangles. This is why they don't work well together and why we need a special FaIcon class instead of material's Icon. There is nothing we can do about the geometric differences. It's actually not even a bug, it's intentional.

For the size discrepancy we could add an attribute which multiplies the size with .75 for example. The same result can be obtained by simply wrapping the FaIcon in a widget which sets the icon's size parameter to the value needed. In the spirit of keeping the api as clean and as close to the original Icon as possible, the latter is the recommended way.

Marking this as wontfix.

from font_awesome_flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.