spyder-ide / qtawesome

Iconic fonts in PyQt and PySide applications
https://qtawesome.readthedocs.io/en/latest/index.html
MIT License
808 stars 107 forks source link

FontAwesome 5 fonts are not Debian-compatible #220

Open juliangilbey opened 1 year ago

juliangilbey commented 1 year ago

Hi!

I hadn't been aware of this issue until very recently, but it turns out that when FontAwesome became commercial and released version 5 (a completely fresh, redesigned set of fonts, not forked from version 4.7), they made their build system proprietary and closed-source, so Debian will not package FontAwesome 5 fonts. Here are some discussions about this:

Either my colleagues or I will have a go at using the Fork-Awesome FontAwesome compatibility layer over the next week or so to see whether this will allow us to continue using Spyder smoothly with a DFSG-free version of qtawesome; I really hope it turns out to be successful! If you would like to look into moving away from FontAwesome and to Fork-Awesome, that would be amazing for us all!

Thanks as ever for your work on this.

dalthviz commented 1 year ago

Hi @juliangilbey thank you for the feedback and letting us know about this! It could be an option to change for Fork-Awesome in a next QtAwesome major release (v2.0.0), although I'm not totally sure. As far as I remember we discussed at some point removing FontAwesome 4.7 and adding FontAwesome 6 support but maybe this new info could change the plans.

Checking Fork-Awesome, seems like it generates a single font file and maybe has less icons than FontAwesome 5, right?

What do you think @ccordoba12 ?

Also, for Spyder itself to work I believe you could even remove FontAwesome5 related things on Debian for QtAwesome and Spyder >=5.0.0 should work without issue (since starting on Spyder 5.0.0 Spyder uses Material design icons).

Just in case, the related lines where fonts are being registered as bundled are at: https://github.com/spyder-ide/qtawesome/blob/a1a7ff92da3af2e9362a69da49921f3c3606f99b/qtawesome/__init__.py#L35-L81

And the font files and charmaps definitions are at: https://github.com/spyder-ide/qtawesome/tree/master/qtawesome/fonts

dalthviz commented 1 year ago

Also, other approach that could help with this (and I believe was discussed before too in order reduce the current package size) is to reduce the bundled fonts and instead create a way to load fonts via entry-points. So with that, instead of bundling here a lot of fonts, each font should be in its own package and then if you want to use it you would need to explicitly install it along side QtAwesome.

What do you think about this other option for a future v2.0.0 @ccordoba12 ?

juliangilbey commented 1 year ago

Thanks @dalthviz! That is really useful to know. I'm also looking into the Material Design Icons, though that's a separate matter: I don't currently understand why there are two different MDI icon fonts in this package, as they only release one icon font. But I'll take a further look over the next week or two...

dalthviz commented 1 year ago

I don't currently understand why there are two different MDI icon fonts in this package

That's because mdi is for version 5.x and mdi6 is for version 6.x (similar to the management we have for FontAwesome: fa is version 4.x and fa5* is for version 5.x).

If you need any help or further clarification on the package and fonts available let us know!

ccordoba12 commented 1 year ago

Checking Fork-Awesome, seems like it generates a single font file and maybe has less icons than FontAwesome 5, right?

What do you think @ccordoba12 ?

This would introduce a regression for our users, so I'm -1 on it. As fas as I know, we're not violating FontAwesome license, so this is a Debian only problem which they need to address on their own.

What do you think about this other option for a future v2.0.0 @ccordoba12 ?

That's an interesting idea but I don't know if it'd work without being online. So, I'm not sure about it.

juliangilbey commented 1 year ago

Checking Fork-Awesome, seems like it generates a single font file and maybe has less icons than FontAwesome 5, right?

This would introduce a regression for our users, so I'm -1 on it. As fas as I know, we're not violating FontAwesome license, so this is a Debian only problem which they need to address on their own.

Fair enough; I just wanted to alert you to it. Knowing that Spyder doesn't actually use FontAwesome is a real help here - there are only a couple of other packages in Debian currently using qtawesome, so we are in good shape.

What do you think about this other option for a future v2.0.0 @ccordoba12 ?

That's an interesting idea but I don't know if it'd work without being online. So, I'm not sure about it.

I'm not sure how being online would make a difference, as the font is being served locally.

I don't currently understand why there are two different MDI icon fonts in this package

That's because mdi is for version 5.x and mdi6 is for version 6.x (similar to the management we have for FontAwesome: fa is version 4.x and fa5* is for version 5.x).

Ah, I see! I've had a look at the MDI website, and they do, indeed, have breaking changes between major versions. But there are also licensing issues that they are addressing between versions, for example: https://github.com/Templarian/MaterialDesign/issues/5797 about removing the Adobe icons. They're also planning on removing all brand icons in version 8 some time in late 2023.

Stability means that you want to continue providing old versions of the fonts, though, so that code which uses qtawesome and refers to an icon in MDI doesn't break when MDI changes the icon names. But it does mean that qtawesome will keep growing every time you include a new MDI major or minor version. (They say that they try to avoid breaking changes between minor versions, though, so it's probably OK to replace the MDI v6 font in qtawesome with version 6.9.96.)

dalthviz commented 1 year ago

That's an interesting idea but I don't know if it'd work without being online. So, I'm not sure about it.

Not totally sure to get the work without being online part either but just in case the idea would be something like if you want to use the FontAwesome 5 you will need to run something like pip install qtawesome qtawesome-fa5 instead of pip install qtawesome (maybe even just something like pip install qtawesome-fa5 since most probably we could set for qtawesome-fa5 or any other font package a dependency to qtawesome)

But it does mean that qtawesome will keep growing every time you include a new MDI major or minor version.

Yep, you are totally right there, one of the alternatives we though for that is to just bundle at most to major versions per font (so for example if we want to bundle FontAwesome 6.x, we will need to remove first FontAwesome 4.x )

They say that they try to avoid breaking changes between minor versions, though, so it's probably OK to replace the MDI v6 font in qtawesome with version 6.9.96

I will create an issue to track that missing update for mdi6 :+1: