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 fonts are not Debian-compatible #220

Open
juliangilbey opened this issue Dec 9, 2022 · 7 comments
Open

FontAwesome 5 fonts are not Debian-compatible #220

juliangilbey opened this issue Dec 9, 2022 · 7 comments

Comments

@juliangilbey
Copy link
Contributor

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
Copy link
Member

dalthviz commented Dec 9, 2022

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:

_BUNDLED_FONTS = (
('fa',
'fontawesome4.7-webfont.ttf',
'fontawesome4.7-webfont-charmap.json'),
('fa5',
'fontawesome5-regular-webfont.ttf',
'fontawesome5-regular-webfont-charmap.json'),
('fa5s',
'fontawesome5-solid-webfont.ttf',
'fontawesome5-solid-webfont-charmap.json'),
('fa5b',
'fontawesome5-brands-webfont.ttf',
'fontawesome5-brands-webfont-charmap.json'),
('ei',
'elusiveicons-webfont.ttf',
'elusiveicons-webfont-charmap.json'),
('mdi',
'materialdesignicons5-webfont.ttf',
'materialdesignicons5-webfont-charmap.json'),
('mdi6',
'materialdesignicons6-webfont.ttf',
'materialdesignicons6-webfont-charmap.json'),
('ph',
'phosphor.ttf',
'phosphor-charmap.json'),
('ri',
'remixicon.ttf',
'remixicon-charmap.json'),
('msc',
'codicon.ttf',
'codicon-charmap.json'),
)
# MD5 Hashes for font files bundled with qtawesome:
_MD5_HASHES = {
'fontawesome4.7-webfont.ttf': 'b06871f281fee6b241d60582ae9369b9',
'fontawesome5-regular-webfont.ttf': 'dc47e4089f5bcb25f241bdeb2de0fb58',
'fontawesome5-solid-webfont.ttf': '5de19800fc9ae73438c2e5c61d041b48',
'fontawesome5-brands-webfont.ttf': '513aa607d398efaccc559916c3431403',
'elusiveicons-webfont.ttf': '207966b04c032d5b873fd595a211582e',
'materialdesignicons5-webfont.ttf': 'b7d40e7ef80c1d4af6d94902af66e524',
'materialdesignicons6-webfont.ttf': '9a2f455e7cbce011368aee95d292613b',
'phosphor.ttf': '5b8dc57388b2d86243566b996cc3a789',
'remixicon.ttf': '888e61f04316f10bddfff7bee10c6dd0',
'codicon.ttf': 'd8565ee605ac4d2fa71fe018863337ca',
}

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

@dalthviz
Copy link
Member

dalthviz commented Dec 9, 2022

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
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

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
Copy link
Contributor Author

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: Templarian/MaterialDesign#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
Copy link
Member

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 👍

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

No branches or pull requests

3 participants