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

Simplify some outlines #127

Merged
merged 4 commits into from
Mar 16, 2024
Merged

Simplify some outlines #127

merged 4 commits into from
Mar 16, 2024

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Mar 15, 2024

[why]
The SVG contains groups of paths that were obviously differently colored before resulting in a glyph with very strange outlines.

[how]
Flatten all path to one path.
Simplify the path.
Hand-optimize some points and remove others.
Double points and very sharp tips.

From 511 points to 176.

Reported-by: Aaron Bell <@aaronbell>

Current glyph in font-logos.ttf:

image

New simplified path:

image

Old Tux left and optimized Tux right:

image

Old to new size comparsion (34k -> 5k).

$ ls -l --sort=size vectors
total 648
-rw-rw-r-- 1 fini fini 64358 Nov 18 16:24 openbsd.svg
-rw-rw-r-- 1 fini fini 34033 Nov 18 16:24 tux_old.svg
-rw-rw-r-- 1 fini fini 16595 Nov 18 16:24 illumos.svg
-rw-rw-r-- 1 fini fini 10845 Nov 18 16:24 gnu-guix.svg
-rw-rw-r-- 1 fini fini 10224 Nov 18 16:24 raspberry-pi.svg
-rw-rw-r-- 1 fini fini  7482 Nov 19 18:13 kubuntu.svg
-rw-rw-r-- 1 fini fini  7443 Nov 19 18:13 ferris.svg
-rw-rw-r-- 1 fini fini  7149 Nov 18 16:24 kali-linux.svg
-rw-rw-r-- 1 fini fini  6991 Nov 18 16:24 debian.svg
-rw-rw-r-- 1 fini fini  6628 Nov 18 16:24 docker.svg
-rw-rw-r-- 1 fini fini  6455 Nov 19 18:13 kde-neon.svg
-rw-rw-r-- 1 fini fini  6212 Nov 18 16:24 redhat.svg
-rw-rw-r-- 1 fini fini  6166 Nov 18 16:24 opensuse.svg
-rw-rw-r-- 1 fini fini  5797 Nov 18 16:24 mandriva.svg
-rw-rw-r-- 1 fini fini  5581 Nov 18 16:24 centos.svg
-rw-rw-r-- 1 fini fini  5379 Nov 18 16:24 gentoo.svg
-rw-rw-r-- 1 fini fini  5154 Mär 15 21:55 tux.svg
-rw-rw-r-- 1 fini fini  4910 Nov 19 18:13 codeberg.svg
-rw-rw-r-- 1 fini fini  4768 Nov 18 16:24 elementary.svg

[why]
The SVG contains groups of paths that were obviously differently colored
before resulting in a glyph with very strange outlines.

[how]
Flatten all path to one path.
Simplify the path.
Hand-optimize some points and remove others.
Double points and very sharp tips.

From 511 points to 176.

Reported-by: Aaron Bell <@aaronbell>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii added the bug label Mar 15, 2024
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Points unchanged

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii
Copy link
Collaborator Author

Finii commented Mar 15, 2024

Examining the other big file sized icons...

OH MY

image

314 to 29 points in 3 seconds 😒

image
10k -> 1k

And this:

image

218 to 95 points...
16k -> 3.2k

The next in size (raspberry) is already as optimized as possible, point wise:

image

@Finii Finii marked this pull request as ready for review March 15, 2024 22:33
@Finii Finii requested review from lukas-w and hasecilu March 15, 2024 22:33
@Finii
Copy link
Collaborator Author

Finii commented Mar 15, 2024

Sorry I did not mean to ping Lukas specifically...

Copy link
Collaborator

@hasecilu hasecilu left a comment

Choose a reason for hiding this comment

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

The icons looks the same, LGTM

@Finii
Copy link
Collaborator Author

Finii commented Mar 16, 2024

Thank you for reviewing :-)

@Finii Finii merged commit 16aead7 into master Mar 16, 2024
@Finii Finii deleted the feature/simplify-tux branch March 16, 2024 01:41
@Finii
Copy link
Collaborator Author

Finii commented Mar 16, 2024

Did similar things here

Hope most of the really bad things are now fixed. Well, one PR is pending at MaterialDesign, and Codicons also had two broken glyphs. Do you think we should update Codicons? But then a lot icons changed dramatically to some more modern version. Sigh.

@hasecilu
Copy link
Collaborator

hasecilu commented Mar 16, 2024

Do you think we should update Codicons? But then a lot icons changed dramatically to some more modern version. Sigh.

Mmm, seems last update was about 3 years ago, could be that some users are expecting to have the same exact icons as in VSCode.

Also the fact that are some "missing" icons (could be instances in other font sets), there are 387 nf-cod-* icons on NF but 457 on https://github.com/microsoft/vscode-codicons/tree/main/src/icons with 35 changes last year.

Maybe is worth a discussion on NF. Personally I won't oppose to the change because pretty much all the icons for code that arrive to my terminal it's because I'm using fancy plugins on Neovim & other applications, so the maintainers of such plugins are the ones who really control which icons to use, at the end I'm just a final user that uses whatever arrives from upstream.

@Finii
Copy link
Collaborator Author

Finii commented Mar 16, 2024

Thanks for your thoughts! 💚

there are 387 nf-cod-* icons on NF but 457 on ...

Hmm, that does not look like so many, but I have not counted.

And I was mistaken, it was Material that has changed dramatically, the changes in codicons seem all very acceptable and I see no reason to not do it.

And all (that means 100%) of the users I talked to (n = 1) said an update would be welcome :-)
The problem is that one can not reach 'the Nerd Font users' in any meaningful manner.

I think this will go.
https://github.com/ryanoasis/nerd-fonts/pull/1544

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

Successfully merging this pull request may close these issues.

2 participants